From e60037cb80a3f3e65ac44e0e1029e399e7df1fce Mon Sep 17 00:00:00 2001 From: Edison Su Date: Mon, 4 Nov 2013 14:36:49 -0800 Subject: [PATCH 001/108] Remove primarydatastoreTo in vmwareresource --- .../vmware/resource/VmwareResource.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index a205fb6ae12..f6f84f6f835 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -113,7 +113,6 @@ import org.apache.cloudstack.engine.orchestration.VolumeOrchestrator; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.storage.command.DeleteCommand; import org.apache.cloudstack.storage.command.StorageSubSystemCommand; -import org.apache.cloudstack.storage.to.PrimaryDataStoreTO; import org.apache.cloudstack.storage.to.TemplateObjectTO; import org.apache.cloudstack.storage.to.VolumeObjectTO; @@ -2513,7 +2512,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa for (DiskTO vol : disks) { if (vol.getType() != Volume.Type.ISO) { VolumeObjectTO volumeTO = (VolumeObjectTO)vol.getData(); - PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)volumeTO.getDataStore(); + DataStoreTO primaryStore = volumeTO.getDataStore(); if (primaryStore.getUuid() != null && !primaryStore.getUuid().isEmpty()) { validatedDisks.add(vol); } @@ -2673,7 +2672,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa Pair rootDiskDataStoreDetails = null; for (DiskTO vol : disks) { if (vol.getType() == Volume.Type.ROOT) { - PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)vol.getData().getDataStore(); + DataStoreTO primaryStore = vol.getData().getDataStore(); rootDiskDataStoreDetails = dataStoresDetails.get(primaryStore.getUuid()); } } @@ -2832,7 +2831,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa deviceConfigSpecArray[i] = new VirtualDeviceConfigSpec(); VolumeObjectTO volumeTO = (VolumeObjectTO)vol.getData(); - PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)volumeTO.getDataStore(); + DataStoreTO primaryStore = volumeTO.getDataStore(); Pair volumeDsDetails = dataStoresDetails.get(primaryStore.getUuid()); assert (volumeDsDetails != null); @@ -2984,7 +2983,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa ) throws Exception { VolumeObjectTO volumeTO = (VolumeObjectTO)vol.getData(); - PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)volumeTO.getDataStore(); + DataStoreTO primaryStore = volumeTO.getDataStore(); Map details = vol.getDetails(); boolean isManaged = details != null && Boolean.parseBoolean(details.get(DiskTO.MANAGED)); @@ -3431,7 +3430,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa for (DiskTO vol : disks) { if (vol.getType() != Volume.Type.ISO) { VolumeObjectTO volumeTO = (VolumeObjectTO)vol.getData(); - PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)volumeTO.getDataStore(); + DataStoreTO primaryStore = volumeTO.getDataStore(); String poolUuid = primaryStore.getUuid(); if(poolMors.get(poolUuid) == null) { boolean isManaged = false; @@ -3462,7 +3461,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa Pair rootDiskDataStoreDetails = null; for (DiskTO vol : disks) { if (vol.getType() == Volume.Type.ROOT) { - PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)vol.getData().getDataStore(); + DataStoreTO primaryStore = vol.getData().getDataStore(); rootDiskDataStoreDetails = dataStoresDetails.get(primaryStore.getUuid()); } } @@ -5456,11 +5455,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa VmwareContext context = getServiceContext(); VmwareHypervisorHost hyperHost = getHyperHost(context); VolumeObjectTO vol = (VolumeObjectTO)cmd.getData(); - PrimaryDataStoreTO store = (PrimaryDataStoreTO)vol.getDataStore(); + DataStoreTO store = vol.getDataStore(); ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, store.getUuid()); if (morDs == null) { - String msg = "Unable to find datastore based on volume mount point " + store.getPath(); + String msg = "Unable to find datastore based on volume mount point " + store.getUrl(); s_logger.error(msg); throw new Exception(msg); } From c350999c932dcafbc2fbe592ba6b7ce38d443d50 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 4 Nov 2013 15:34:48 -0800 Subject: [PATCH 002/108] CLOUDSTACK-730: UI > VPC > Router > site-to-site VPN > VPN Connection > detailView > add "Passive" field. --- ui/scripts/vpc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index 2dc916244a0..9775f606de8 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -2858,13 +2858,13 @@ id: { label: 'label.id' }, - - //s2svpngatewayid: { label: 'VPN gateway ID' }, + passive: { + label: 'Passive', + converter: cloudStack.converters.toBooleanText + }, publicip: { label: 'label.ip.address' - }, - - //s2scustomergatewayid: { label: 'Customer gateway ID' }, + }, gateway: { label: 'label.gateway' }, From 57678257a123da1f74fa2a81407beb94450444b3 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 4 Nov 2013 16:25:24 -0800 Subject: [PATCH 003/108] CLOUDSTACK-4908: UI > Infrastructure > Sockets > view all > calculate Hosts for each hypervisor. --- ui/scripts/system.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 15959483367..381d884e2ce 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7125,20 +7125,32 @@ var listView = { id: 'sockets', fields: { - hypervisor: { label: 'label.hypervisor' }, - sockets: { label: 'label.sockets' }, - hosts: { label: 'label.hosts' } + hypervisor: { label: 'label.hypervisor' }, + hosts: { label: 'label.hosts' }, + sockets: { label: 'label.sockets' } }, dataProvider: function(args) { $.ajax({ url: createURL('listHypervisors'), success: function(json) { args.response.success({ - data: $(json.listhypervisorsresponse.hypervisor).map(function(index, hypervisor) { + data: $(json.listhypervisorsresponse.hypervisor).map(function(index, hypervisor) { + var hostCount; + $.ajax({ + url: createURL('listHosts'), + async: false, + data: { + hypervisortype: hypervisor.name + }, + success: function(json) { + hostCount = json.listhostsresponse.count; + } + }); + return { hypervisor: hypervisor.name, - sockets: 0, - hosts: 0 + hosts: hostCount, + sockets: 0 }; }) }); From 4be79472819d6100579a44fee71253ab54766713 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Fri, 25 Oct 2013 16:34:51 -0700 Subject: [PATCH 004/108] CLOUDSTACK-4948: DeploymentPlanner: Logic to check if cluster can be avoided, needs to consider if VM is using local storage and/or shared storage Changes: - Consider if VM requires the local storage or shared storage or both for its disks. - Accordingly all pools in the cluster should consider local or shared or both pools Conflicts: server/src/com/cloud/agent/manager/allocator/HostAllocator.java --- .../manager/allocator/HostAllocator.java | 68 ++++++++++++------ .../api/storage/StoragePoolAllocator.java | 5 ++ .../deploy/DeploymentPlanningManagerImpl.java | 72 ++++++++++++++----- 3 files changed, 105 insertions(+), 40 deletions(-) diff --git a/api/src/com/cloud/agent/manager/allocator/HostAllocator.java b/api/src/com/cloud/agent/manager/allocator/HostAllocator.java index 14525aa52de..f21455eeb31 100755 --- a/api/src/com/cloud/agent/manager/allocator/HostAllocator.java +++ b/api/src/com/cloud/agent/manager/allocator/HostAllocator.java @@ -38,7 +38,7 @@ public interface HostAllocator extends Adapter { /** * Determines which physical hosts are suitable to * allocate the guest virtual machines on - * + * * @param VirtualMachineProfile vmProfile * @param DeploymentPlan plan * @param GuestType type @@ -46,35 +46,57 @@ public interface HostAllocator extends Adapter { * @param int returnUpTo (use -1 to return all possible hosts) * @return List List of hosts that are suitable for VM allocation **/ - + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo); - + /** - * Determines which physical hosts are suitable to - * allocate the guest virtual machines on - * - * @param VirtualMachineProfile vmProfile - * @param DeploymentPlan plan - * @param GuestType type - * @param ExcludeList avoid - * @param int returnUpTo (use -1 to return all possible hosts) - * @param boolean considerReservedCapacity (default should be true, set to false if host capacity calculation should not look at reserved capacity) - * @return List List of hosts that are suitable for VM allocation - **/ - + * Determines which physical hosts are suitable to allocate the guest + * virtual machines on + * + * Allocators must set any other hosts not considered for allocation in the + * ExcludeList avoid. Thus the avoid set and the list of hosts suitable, + * together must cover the entire host set in the cluster. + * + * @param VirtualMachineProfile + * vmProfile + * @param DeploymentPlan + * plan + * @param GuestType + * type + * @param ExcludeList + * avoid + * @param int returnUpTo (use -1 to return all possible hosts) + * @param boolean considerReservedCapacity (default should be true, set to + * false if host capacity calculation should not look at reserved + * capacity) + * @return List List of hosts that are suitable for VM allocation + **/ + public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, int returnUpTo, boolean considerReservedCapacity); /** - * Determines which physical hosts are suitable to - * allocate the guest virtual machines on + * Determines which physical hosts are suitable to allocate the guest + * virtual machines on * - * @param VirtualMachineProfile vmProfile - * @param DeploymentPlan plan - * @param GuestType type - * @param ExcludeList avoid - * @param List hosts + * Allocators must set any other hosts not considered for allocation in the + * ExcludeList avoid. Thus the avoid set and the list of hosts suitable, + * together must cover the entire host set in the cluster. + * + * + * @param VirtualMachineProfile + * vmProfile + * @param DeploymentPlan + * plan + * @param GuestType + * type + * @param ExcludeList + * avoid + * @param List + * hosts * @param int returnUpTo (use -1 to return all possible hosts) - * @param boolean considerReservedCapacity (default should be true, set to false if host capacity calculation should not look at reserved capacity) + * @param boolean considerReservedCapacity (default should be true, set to + * false if host capacity calculation should not look at reserved + * capacity) * @return List List of hosts that are suitable for VM allocation **/ public List allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan plan, Type type, ExcludeList avoid, List hosts, diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java index 54808c195c5..e8ade44f475 100644 --- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java +++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/StoragePoolAllocator.java @@ -30,6 +30,11 @@ import com.cloud.vm.VirtualMachineProfile; public interface StoragePoolAllocator extends Adapter { /** * Determines which storage pools are suitable for the guest virtual machine + * and returns a list of pools suitable. + * + * Allocators must set any other pools not considered for allocation in the + * ExcludeList avoid. Thus the avoid set and the list of pools suitable, + * together must cover the entire pool set in the cluster. * * @param DiskProfile * dskCh diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java index e79e8e3883f..f268957636f 100644 --- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java +++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java @@ -864,6 +864,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy DataCenterDeployment potentialPlan = new DataCenterDeployment(plan.getDataCenterId(), clusterVO.getPodId(), clusterVO.getId(), null, plan.getPoolId(), null, plan.getReservationContext()); + // find suitable hosts under this cluster, need as many hosts as we // get. List suitableHosts = findSuitableHosts(vmProfile, potentialPlan, avoid, HostAllocator.RETURN_UPTO_ALL); @@ -906,7 +907,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy s_logger.debug("No suitable hosts found under this Cluster: " + clusterId); } - if (canAvoidCluster(clusterVO, avoid, PlannerAvoidOutput)) { + if (canAvoidCluster(clusterVO, avoid, PlannerAvoidOutput, vmProfile)) { avoid.addCluster(clusterVO.getId()); } } @@ -914,7 +915,8 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy return null; } - private boolean canAvoidCluster(Cluster clusterVO, ExcludeList avoids, ExcludeList plannerAvoidOutput) { + private boolean canAvoidCluster(Cluster clusterVO, ExcludeList avoids, ExcludeList plannerAvoidOutput, + VirtualMachineProfile vmProfile) { ExcludeList allocatorAvoidOutput = new ExcludeList(avoids.getDataCentersToAvoid(), avoids.getPodsToAvoid(), avoids.getClustersToAvoid(), avoids.getHostsToAvoid(), avoids.getPoolsToAvoid()); @@ -938,26 +940,27 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy } } + // all hosts in avoid set, avoid the cluster. Otherwise check the pools + if (avoidAllHosts) { + return true; + } + // Cluster can be put in avoid set in following scenarios: // 1. If storage allocators haven't put any pools in avoid set means either no pools in cluster - // or pools not suitable for the allocators to handle. + // or pools not suitable for the allocators to handle or there is no + // linkage of any suitable host to any of the pools in cluster // 2. If all 'shared' or 'local' pools are in avoid set if (allocatorAvoidOutput.getPoolsToAvoid() != null && !allocatorAvoidOutput.getPoolsToAvoid().isEmpty()) { - // check shared pools - List allPoolsInCluster = _storagePoolDao.findPoolsByTags(clusterVO.getDataCenterId(), - clusterVO.getPodId(), clusterVO.getId(), null); - for (StoragePoolVO pool : allPoolsInCluster) { - if (!allocatorAvoidOutput.shouldAvoid(pool)) { - // there's some pool in the cluster that is not yet in avoid set - avoidAllPools = false; - break; - } - } - if (avoidAllPools) { - // check local pools - List allLocalPoolsInCluster = _storagePoolDao.findLocalStoragePoolsByTags(clusterVO.getDataCenterId(), + + Pair storageRequirements = findVMStorageRequirements(vmProfile); + boolean vmRequiresSharedStorage = storageRequirements.first(); + boolean vmRequiresLocalStorege = storageRequirements.second(); + + if (vmRequiresSharedStorage) { + // check shared pools + List allPoolsInCluster = _storagePoolDao.findPoolsByTags(clusterVO.getDataCenterId(), clusterVO.getPodId(), clusterVO.getId(), null); - for (StoragePoolVO pool : allLocalPoolsInCluster) { + for (StoragePoolVO pool : allPoolsInCluster) { if (!allocatorAvoidOutput.shouldAvoid(pool)) { // there's some pool in the cluster that is not yet in avoid set avoidAllPools = false; @@ -965,6 +968,20 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy } } } + + if (vmRequiresLocalStorege) { + // check local pools + List allLocalPoolsInCluster = _storagePoolDao.findLocalStoragePoolsByTags( + clusterVO.getDataCenterId(), clusterVO.getPodId(), clusterVO.getId(), null); + for (StoragePoolVO pool : allLocalPoolsInCluster) { + if (!allocatorAvoidOutput.shouldAvoid(pool)) { + // there's some pool in the cluster that is not yet + // in avoid set + avoidAllPools = false; + break; + } + } + } } if (avoidAllHosts || avoidAllPools) { @@ -973,6 +990,27 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy return false; } + private Pair findVMStorageRequirements(VirtualMachineProfile vmProfile) { + + boolean requiresShared = false, requiresLocal = false; + + List volumesTobeCreated = _volsDao.findUsableVolumesForInstance(vmProfile.getId()); + + // for each volume find whether shared or local pool is required + for (VolumeVO toBeCreated : volumesTobeCreated) { + DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId()); + + if (diskOffering != null) { + if (diskOffering.getUseLocalStorage()) { + requiresLocal = true; + } else { + requiresShared = true; + } + } + } + + return new Pair(requiresShared, requiresLocal); + } protected Pair> findPotentialDeploymentResources(List suitableHosts, Map> suitableVolumeStoragePools, ExcludeList avoid, DeploymentPlanner.PlannerResourceUsage resourceUsageRequired) { From 863a84a15dca7889692323e9e024fc8cedc1dc2b Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Fri, 25 Oct 2013 16:40:01 -0700 Subject: [PATCH 005/108] CLOUDSTACK-4948: DeploymentPlanner: Logic to check if cluster can be avoided, needs to consider if VM is using local storage and/or shared storage Changes: - Changes due to VirtualMachineProfile changes done in master --- .../src/com/cloud/deploy/DeploymentPlanningManagerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java index f268957636f..0886840e435 100644 --- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java +++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java @@ -916,7 +916,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy } private boolean canAvoidCluster(Cluster clusterVO, ExcludeList avoids, ExcludeList plannerAvoidOutput, - VirtualMachineProfile vmProfile) { + VirtualMachineProfile vmProfile) { ExcludeList allocatorAvoidOutput = new ExcludeList(avoids.getDataCentersToAvoid(), avoids.getPodsToAvoid(), avoids.getClustersToAvoid(), avoids.getHostsToAvoid(), avoids.getPoolsToAvoid()); @@ -990,7 +990,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy return false; } - private Pair findVMStorageRequirements(VirtualMachineProfile vmProfile) { + private Pair findVMStorageRequirements(VirtualMachineProfile vmProfile) { boolean requiresShared = false, requiresLocal = false; From 3cc823903a0aa99b20a55b13e871d0ad8f6caf79 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Mon, 4 Nov 2013 16:37:55 -0800 Subject: [PATCH 006/108] CLOUDSTACK-4755: cloudstack 4.x does not allow memory upgrade Changes: - Set total capacity of a host if it has changed in the CapacityChecker thread - Fix bug while setting the reserved/used cpu/mem capacity - only one of them used to get set --- .../cloud/capacity/CapacityManagerImpl.java | 64 +++++++++++++------ 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/server/src/com/cloud/capacity/CapacityManagerImpl.java b/server/src/com/cloud/capacity/CapacityManagerImpl.java index 72905a7c0c4..1c5f189237f 100755 --- a/server/src/com/cloud/capacity/CapacityManagerImpl.java +++ b/server/src/com/cloud/capacity/CapacityManagerImpl.java @@ -599,34 +599,58 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager, CapacityVO memCap = _capacityDao.findByHostIdType(host.getId(), CapacityVO.CAPACITY_TYPE_MEMORY); if (cpuCap != null && memCap != null){ + + long hostTotalCpu = host.getCpus().longValue() * host.getSpeed().longValue(); + + if (cpuCap.getTotalCapacity() != hostTotalCpu) { + s_logger.debug("Calibrate total cpu for host: " + host.getId() + " old total CPU:" + + cpuCap.getTotalCapacity() + " new total CPU:" + hostTotalCpu); + cpuCap.setTotalCapacity(hostTotalCpu); + + } + if (cpuCap.getUsedCapacity() == usedCpu && cpuCap.getReservedCapacity() == reservedCpu) { s_logger.debug("No need to calibrate cpu capacity, host:" + host.getId() + " usedCpu: " + cpuCap.getUsedCapacity() + " reservedCpu: " + cpuCap.getReservedCapacity()); - } else if (cpuCap.getReservedCapacity() != reservedCpu) { - s_logger.debug("Calibrate reserved cpu for host: " + host.getId() + " old reservedCpu:" + cpuCap.getReservedCapacity() - + " new reservedCpu:" + reservedCpu); - cpuCap.setReservedCapacity(reservedCpu); - } else if (cpuCap.getUsedCapacity() != usedCpu) { - s_logger.debug("Calibrate used cpu for host: " + host.getId() + " old usedCpu:" + cpuCap.getUsedCapacity() + " new usedCpu:" - + usedCpu); - cpuCap.setUsedCapacity(usedCpu); + } else { + if (cpuCap.getReservedCapacity() != reservedCpu) { + s_logger.debug("Calibrate reserved cpu for host: " + host.getId() + " old reservedCpu:" + + cpuCap.getReservedCapacity() + " new reservedCpu:" + reservedCpu); + cpuCap.setReservedCapacity(reservedCpu); + } + if (cpuCap.getUsedCapacity() != usedCpu) { + s_logger.debug("Calibrate used cpu for host: " + host.getId() + " old usedCpu:" + + cpuCap.getUsedCapacity() + " new usedCpu:" + usedCpu); + cpuCap.setUsedCapacity(usedCpu); + } } + if (memCap.getTotalCapacity() != host.getTotalMemory()) { + s_logger.debug("Calibrate total memory for host: " + host.getId() + " old total memory:" + + memCap.getTotalCapacity() + " new total memory:" + host.getTotalMemory()); + memCap.setTotalCapacity(host.getTotalMemory()); + + } + if (memCap.getUsedCapacity() == usedMemory && memCap.getReservedCapacity() == reservedMemory) { s_logger.debug("No need to calibrate memory capacity, host:" + host.getId() + " usedMem: " + memCap.getUsedCapacity() + " reservedMem: " + memCap.getReservedCapacity()); - } else if (memCap.getReservedCapacity() != reservedMemory) { - s_logger.debug("Calibrate reserved memory for host: " + host.getId() + " old reservedMem:" + memCap.getReservedCapacity() - + " new reservedMem:" + reservedMemory); - memCap.setReservedCapacity(reservedMemory); - } else if (memCap.getUsedCapacity() != usedMemory) { - /* - * Didn't calibrate for used memory, because VMs can be in state(starting/migrating) that I don't know on which host they are - * allocated - */ - s_logger.debug("Calibrate used memory for host: " + host.getId() + " old usedMem: " + memCap.getUsedCapacity() - + " new usedMem: " + usedMemory); - memCap.setUsedCapacity(usedMemory); + } else { + if (memCap.getReservedCapacity() != reservedMemory) { + s_logger.debug("Calibrate reserved memory for host: " + host.getId() + " old reservedMem:" + + memCap.getReservedCapacity() + " new reservedMem:" + reservedMemory); + memCap.setReservedCapacity(reservedMemory); + } + if (memCap.getUsedCapacity() != usedMemory) { + /* + * Didn't calibrate for used memory, because VMs can be in + * state(starting/migrating) that I don't know on which host + * they are allocated + */ + s_logger.debug("Calibrate used memory for host: " + host.getId() + " old usedMem: " + + memCap.getUsedCapacity() + " new usedMem: " + usedMemory); + memCap.setUsedCapacity(usedMemory); + } } try { From 2f459404934ee5ce78499828881a379ae180eee7 Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Mon, 4 Nov 2013 16:15:14 +0530 Subject: [PATCH 007/108] CLOUDSTACK-5028. Vmware instance fails to start when the chain_info of any volume that belongs to the VM is longer than 255 characters. If the VM has snapshots then the chain_info of a volume can be longer than 255 characters. Increasing the column length of chain_info in VolumeVO to match the maximum length of type text(db schema type) --- engine/schema/src/com/cloud/storage/VolumeVO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/schema/src/com/cloud/storage/VolumeVO.java b/engine/schema/src/com/cloud/storage/VolumeVO.java index 1bdd09f9ab6..86c8b3d90c6 100755 --- a/engine/schema/src/com/cloud/storage/VolumeVO.java +++ b/engine/schema/src/com/cloud/storage/VolumeVO.java @@ -136,7 +136,7 @@ public class VolumeVO implements Volume { @Enumerated(value = EnumType.STRING) private State state; - @Column(name = "chain_info") + @Column(name = "chain_info",length=65535) String chainInfo; @Column(name = "uuid") From 1058e3049a2141cad8bfba4cf8afca6916396d77 Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Tue, 5 Nov 2013 03:16:24 +0530 Subject: [PATCH 008/108] CLOUDSTACK-5032 Provides custom assert facility to test features Added assertElementInList to cloudstackTestCase. Users can use this new custom addition to add assertions, thus replacing current multiple assertions Signed-off-by: Santhosh Edukulla --- tools/marvin/marvin/cloudstackTestCase.py | 14 ++++ tools/marvin/marvin/integration/lib/utils.py | 80 +++++++++++--------- 2 files changed, 58 insertions(+), 36 deletions(-) diff --git a/tools/marvin/marvin/cloudstackTestCase.py b/tools/marvin/marvin/cloudstackTestCase.py index 85ef5423091..6456bb1fe61 100644 --- a/tools/marvin/marvin/cloudstackTestCase.py +++ b/tools/marvin/marvin/cloudstackTestCase.py @@ -16,6 +16,8 @@ # under the License. import unittest +from marvin.integration.lib.utils import verifyElementInList +from marvin.codes import PASS def user(Name, DomainName, AcctType): @@ -35,6 +37,18 @@ def user(Name, DomainName, AcctType): class cloudstackTestCase(unittest.case.TestCase): clstestclient = None + def assertElementInList(inp, toverify, responsevar=None, pos=0, + assertmsg="TC Failed for reason"): + ''' + @Name: assertElementInList + @desc:Uses the utility function verifyElementInList and + asserts based upon PASS\FAIL value of the output. + Takes one additional argument of what message to assert with + when failed + ''' + out = verifyElementInList(inp, toverify, responsevar, pos) + unittest.TestCase.assertEquals(out[0], PASS, "msg:%s" % out[1]) + @classmethod def getClsTestClient(cls): return cls.clstestclient diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index d53c1ae301d..4d048f0f4e9 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -354,42 +354,50 @@ def validateList(inp): return ret return [PASS, inp[0], None] -def verifyElementInList(inp, toverify, pos = 0): - ''' - @name: verifyElementInList - @Description: - 1. A utility function to validate - whether the input passed is a list. - The list is empty or not. - If it is list and not empty, verify - whether a given element is there in that list or not - at a given pos - @Input: - I : Input to be verified whether its a list or not +def verifyElementInList(inp, toverify, responsevar=None, pos=0): + ''' + @name: verifyElementInList + @Description: + 1. A utility function to validate + whether the input passed is a list. + The list is empty or not. + If it is list and not empty, verify + whether a given element is there in that list or not + at a given pos + @Input: + I : Input to be verified whether its a list or not II : Element to verify whether it exists in the list - III : Position in the list at which the input element to verify - default to 0 - @output: List, containing [ Result,Reason ] - Ist Argument('Result') : FAIL : If it is not a list - If it is list but empty - PASS : If it is list and not empty + III : variable name in response object to verify + default to None, if None, we will verify for the complete + first element EX: state of response object object + IV : Position in the list at which the input element to verify + default to 0 + @output: List, containing [ Result,Reason ] + Ist Argument('Result') : FAIL : If it is not a list + If it is list but empty + PASS : If it is list and not empty and matching element was found - IIrd Argument( 'Reason' ): Reason for failure ( FAIL ), - default to None. - INVALID_INPUT - EMPTY_LIST - MATCH_NOT_FOUND - ''' - if toverify is None or toverify == '' \ - or pos is None or pos < -1 or pos == '': - return [FAIL, INVALID_INPUT] - out = validateList(inp) - if out[0] == FAIL: - return [FAIL, out[2]] - if out[0] == PASS: - if len(inp) > pos and inp[pos] == toverify: - return [PASS, None] - else: - return [FAIL, MATCH_NOT_FOUND] - + IIrd Argument( 'Reason' ): Reason for failure ( FAIL ), + default to None. + INVALID_INPUT + EMPTY_LIST + MATCH_NOT_FOUND + ''' + if toverify is None or toverify == '' \ + or pos is None or pos < -1 or pos == '': + return [FAIL, INVALID_INPUT] + out = validateList(inp) + if out[0] == FAIL: + return [FAIL, out[2]] + if len(inp) > pos: + if responsevar is None: + if inp[pos] == toverify: + return [PASS, None] + else: + if responsevar in inp[pos].__dict__ and getattr(inp[pos], responsevar) == toverify: + return [PASS, None] + else: + return [FAIL, MATCH_NOT_FOUND] + else: + return [FAIL, MATCH_NOT_FOUND] From 3a9150017339fa9447e7e30b854ccd3351695dcc Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Sun, 3 Nov 2013 18:42:24 +0530 Subject: [PATCH 009/108] CLOUDSTACK-3715. Socket timeout error is observed in VMware setup if a VMware task (RelocateVM_Task, CloneVM_Task etc.) takes more than 10 minutes. Making this value configurable to allow admins to modify the timeout if required. It defaults to the current value i.e. 10 minutes. --- .../vmware/manager/VmwareManager.java | 2 ++ .../vmware/manager/VmwareManagerImpl.java | 9 +++++++++ .../vmware/resource/VmwareContextFactory.java | 1 + .../VmwareSecondaryStorageContextFactory.java | 18 +++++++++++++++++- server/src/com/cloud/configuration/Config.java | 1 + .../hypervisor/vmware/util/VmwareClient.java | 10 ++++++++-- .../vmware/mo/TestVmwareContextFactory.java | 1 + 7 files changed, 39 insertions(+), 3 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java index 6c675990bb3..bc0c9a48420 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java @@ -69,5 +69,7 @@ public interface VmwareManager { public String getRootDiskController(); + public int getVcenterSessionTimeout(); + boolean isLegacyZone(long dcId); } diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 9af0aa002d8..183d6761a9b 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -177,6 +177,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw int _additionalPortRangeStart; int _additionalPortRangeSize; int _routerExtraPublicNics = 2; + int _vCenterSessionTimeout = 600000; // Timeout in milliseconds String _reserveCpu = "false"; @@ -279,6 +280,9 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw _routerExtraPublicNics = NumbersUtil.parseInt(_configDao.getValue(Config.RouterExtraPublicNics.key()), 2); + _vCenterSessionTimeout = NumbersUtil.parseInt(_configDao.getValue(Config.VmwareVcenterSessionTimeout.key()), 600) * 1000; + s_logger.info("VmwareManagerImpl config - vmware.vcenter.session.timeout: " + _vCenterSessionTimeout); + _reserveCpu = _configDao.getValue(Config.VmwareReserveCpu.key()); if(_reserveCpu == null || _reserveCpu.isEmpty()) { _reserveCpu = "false"; @@ -985,6 +989,11 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw return _rootDiskController; } + @Override + public int getVcenterSessionTimeout() { + return _vCenterSessionTimeout; + } + @Override public List> getCommands() { List> cmdList = new ArrayList>(); diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java index 3079998198c..f108fda078a 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java @@ -63,6 +63,7 @@ public class VmwareContextFactory { s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword)); VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++); + vimClient.setVcenterSessionTimeout(s_vmwareMgr.getVcenterSessionTimeout()); vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword); VmwareContext context = new VmwareContext(vimClient, vCenterAddress); diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java index 253d6fd3517..3d7a18de0e2 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java @@ -16,11 +16,17 @@ // under the License. package com.cloud.storage.resource; +import javax.annotation.PostConstruct; +import javax.inject.Inject; + import org.apache.log4j.Logger; +import com.cloud.configuration.Config; +import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.hypervisor.vmware.util.VmwareClient; import com.cloud.hypervisor.vmware.util.VmwareContext; import com.cloud.hypervisor.vmware.util.VmwareContextPool; +import com.cloud.utils.NumbersUtil; public class VmwareSecondaryStorageContextFactory { private static final Logger s_logger = Logger.getLogger(VmwareSecondaryStorageContextFactory.class); @@ -28,20 +34,30 @@ public class VmwareSecondaryStorageContextFactory { private static volatile int s_seq = 1; private static VmwareContextPool s_pool; + private static ConfigurationDao s_configDao; + + @Inject ConfigurationDao _configDao; public static void initFactoryEnvironment() { System.setProperty("axis.socketSecureFactory", "org.apache.axis.components.net.SunFakeTrustSocketFactory"); s_pool = new VmwareContextPool(); } + @PostConstruct + void init() { + s_configDao = _configDao; + } + public static VmwareContext create(String vCenterAddress, String vCenterUserName, String vCenterPassword) throws Exception { assert(vCenterAddress != null); assert(vCenterUserName != null); assert(vCenterPassword != null); String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService"; + int vCenterSessionTimeout = NumbersUtil.parseInt(s_configDao.getValue(Config.VmwareVcenterSessionTimeout.key()), 600) * 1000; VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++); - vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword); + vimClient.setVcenterSessionTimeout(vCenterSessionTimeout); + vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword); VmwareContext context = new VmwareContext(vimClient, vCenterAddress); assert(context != null); diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index e78757639ee..e4413251400 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -265,6 +265,7 @@ public enum Config { VmwareRecycleHungWorker("Advanced", ManagementServer.class, Boolean.class, "vmware.recycle.hung.wokervm", "false", "Specify whether or not to recycle hung worker VMs", null), VmwareHungWorkerTimeout("Advanced", ManagementServer.class, Long.class, "vmware.hung.wokervm.timeout", "7200", "Worker VM timeout in seconds", null), VmwareEnableNestedVirtualization("Advanced", ManagementServer.class, Boolean.class, "vmware.nested.virtualization", "false", "When set to true this will enable nested virtualization when this is supported by the hypervisor", null), + VmwareVcenterSessionTimeout("Advanced", ManagementServer.class, Long.class, "vmware.vcenter.session.timeout", "600", "VMware client timeout in seconds", null), // Midonet MidoNetAPIServerAddress("Network", ManagementServer.class, String.class, "midonet.apiserver.address", "http://localhost:8081", "Specify the address at which the Midonet API server can be contacted (if using Midonet)", null), diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java index d1adbc2dc30..a0122d29e22 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java @@ -109,6 +109,7 @@ public class VmwareClient { private VimPortType vimPort; private String serviceCookie; private final String SVC_INST_NAME = "ServiceInstance"; + private int vCenterSessionTimeout = 600000; // Timeout in milliseconds private boolean isConnected = false; @@ -132,8 +133,8 @@ public class VmwareClient { ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true); - ctxt.put("com.sun.xml.internal.ws.request.timeout", 600000); - ctxt.put("com.sun.xml.internal.ws.connect.timeout", 600000); + ctxt.put("com.sun.xml.internal.ws.request.timeout", vCenterSessionTimeout); + ctxt.put("com.sun.xml.internal.ws.connect.timeout", vCenterSessionTimeout); ServiceContent serviceContent = vimPort.retrieveServiceContent(SVC_INST_REF); @@ -616,4 +617,9 @@ public class VmwareClient { } return propmor; } + + public void setVcenterSessionTimeout(int vCenterSessionTimeout) { + this.vCenterSessionTimeout = vCenterSessionTimeout; + } + } diff --git a/vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java b/vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java index c0bd5620d94..c8363d6e78d 100644 --- a/vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java +++ b/vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java @@ -48,6 +48,7 @@ public class TestVmwareContextFactory { s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword)); VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++); + vimClient.setVcenterSessionTimeout(600000); // Timeout in milliseconds vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword); VmwareContext context = new VmwareContext(vimClient, vCenterAddress); From a286dec098ec9fe663c2bbead128f88bf9f18418 Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Tue, 5 Nov 2013 16:00:43 +0530 Subject: [PATCH 010/108] CLOUDSTACK-4908: CPU socket count of host Adding cpu socket count of the host in hostresponse Signed-off-by: Koushik Das --- api/src/com/cloud/host/Host.java | 5 ++ .../api/command/admin/host/ListHostsCmd.java | 8 ++ .../cloudstack/api/response/HostResponse.java | 7 ++ .../agent/api/StartupRoutingCommand.java | 9 +++ .../agent/test/CheckOnHostCommandTest.java | 10 +++ .../entity/api/db/EngineHostVO.java | 8 ++ engine/schema/src/com/cloud/host/HostVO.java | 12 +++ .../resource/LibvirtComputingResource.java | 6 +- .../vmware/resource/VmwareResource.java | 1 + .../xen/resource/CitrixResourceBase.java | 7 +- .../com/cloud/api/query/QueryManagerImpl.java | 6 ++ .../cloud/api/query/dao/HostJoinDaoImpl.java | 1 + .../com/cloud/api/query/vo/HostJoinVO.java | 7 ++ .../cloud/resource/ResourceManagerImpl.java | 1 + setup/db/db/schema-421to430.sql | 74 +++++++++++++++++++ .../cloud/hypervisor/vmware/mo/HostMO.java | 1 + .../vmware/mo/VmwareHypervisorHost.java | 1 - .../VmwareHypervisorHostResourceSummary.java | 9 +++ 18 files changed, 170 insertions(+), 3 deletions(-) diff --git a/api/src/com/cloud/host/Host.java b/api/src/com/cloud/host/Host.java index 17b0ba86f7f..581bd47c5f4 100755 --- a/api/src/com/cloud/host/Host.java +++ b/api/src/com/cloud/host/Host.java @@ -106,6 +106,11 @@ public interface Host extends StateObject, Identity, InternalIdentity { */ Long getTotalMemory(); + /** + * @return # of cpu sockets in a machine. + */ + Integer getCpuSockets(); + /** * @return # of cores in a machine. Note two cpus with two cores each returns 4. */ diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java index 95b9ac33799..c6f1e70ae9c 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java @@ -21,6 +21,7 @@ import java.util.EnumSet; import java.util.List; import java.util.Map; +import com.cloud.hypervisor.Hypervisor.HypervisorType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -88,6 +89,9 @@ public class ListHostsCmd extends BaseListCmd { @Parameter(name=ApiConstants.HA_HOST, type=CommandType.BOOLEAN, description="if true, list only hosts dedicated to HA") private Boolean haHost; + @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="hypervisor type of host: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator") + private String hypervisor; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -128,6 +132,10 @@ public class ListHostsCmd extends BaseListCmd { return virtualMachineId; } + public HypervisorType getHypervisor() { + return HypervisorType.getType(hypervisor); + } + public EnumSet getDetails() throws InvalidParameterValueException { EnumSet dv; if (viewDetails==null || viewDetails.size() <=0){ diff --git a/api/src/org/apache/cloudstack/api/response/HostResponse.java b/api/src/org/apache/cloudstack/api/response/HostResponse.java index 687687d37fc..7b6b5348a91 100644 --- a/api/src/org/apache/cloudstack/api/response/HostResponse.java +++ b/api/src/org/apache/cloudstack/api/response/HostResponse.java @@ -72,6 +72,9 @@ public class HostResponse extends BaseResponse { @SerializedName(ApiConstants.HYPERVISOR) @Param(description="the host hypervisor") private HypervisorType hypervisor; + @SerializedName("cpusockets") @Param(description="the number of CPU sockets on the host") + private Integer cpuSockets; + @SerializedName("cpunumber") @Param(description="the CPU number of the host") private Integer cpuNumber; @@ -225,6 +228,10 @@ public class HostResponse extends BaseResponse { this.hypervisor = hypervisor; } + public void setCpuSockets(Integer cpuSockets) { + this.cpuSockets = cpuSockets; + } + public void setCpuNumber(Integer cpuNumber) { this.cpuNumber = cpuNumber; } diff --git a/core/src/com/cloud/agent/api/StartupRoutingCommand.java b/core/src/com/cloud/agent/api/StartupRoutingCommand.java index d52666b7d9d..f312e0fc72d 100755 --- a/core/src/com/cloud/agent/api/StartupRoutingCommand.java +++ b/core/src/com/cloud/agent/api/StartupRoutingCommand.java @@ -42,6 +42,7 @@ public class StartupRoutingCommand extends StartupCommand { return host; } } + Integer cpuSockets; int cpus; long speed; long memory; @@ -133,6 +134,10 @@ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStr _clusterVMStates = allStates; } + public Integer getCpuSockets() { + return cpuSockets; + } + public int getCpus() { return cpus; } @@ -165,6 +170,10 @@ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStr this.speed = speed; } + public void setCpuSockets(Integer cpuSockets) { + this.cpuSockets = cpuSockets; + } + public void setCpus(int cpus) { this.cpus = cpus; } diff --git a/core/test/org/apache/cloudstack/api/agent/test/CheckOnHostCommandTest.java b/core/test/org/apache/cloudstack/api/agent/test/CheckOnHostCommandTest.java index 1b682761996..031ef5cfea8 100644 --- a/core/test/org/apache/cloudstack/api/agent/test/CheckOnHostCommandTest.java +++ b/core/test/org/apache/cloudstack/api/agent/test/CheckOnHostCommandTest.java @@ -86,6 +86,10 @@ public class CheckOnHostCommandTest { public Long getTotalMemory() { return 100000000000L; + } + + public Integer getCpuSockets() { + return 1; }; public Integer getCpus() { @@ -289,6 +293,12 @@ public class CheckOnHostCommandTest { assertTrue(m == 100000000000L); } + @Test + public void testGetCpuSockets() { + Integer cpuSockets = host.getCpuSockets(); + assertTrue(cpuSockets == 1); + } + @Test public void testGetCpus() { int cpus = host.getCpus(); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java index 249c2db01c0..e8f42b49b1b 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java @@ -325,6 +325,9 @@ public class EngineHostVO implements EngineHost, Identity { @Column(name="pod_id") private Long podId; + @Column(name="cpu_sockets") + private Integer cpuSockets; + @Column(name="cpus") private Integer cpus; @@ -648,6 +651,11 @@ public class EngineHostVO implements EngineHost, Identity { this.guid = guid; } + @Override + public Integer getCpuSockets() { + return cpuSockets; + } + @Override public Integer getCpus() { return cpus; diff --git a/engine/schema/src/com/cloud/host/HostVO.java b/engine/schema/src/com/cloud/host/HostVO.java index c814b94a426..2ac3d07948e 100755 --- a/engine/schema/src/com/cloud/host/HostVO.java +++ b/engine/schema/src/com/cloud/host/HostVO.java @@ -321,6 +321,9 @@ public class HostVO implements Host { @Column(name="pod_id") private Long podId; + @Column(name="cpu_sockets") + private Integer cpuSockets; + @Column(name="cpus") private Integer cpus; @@ -501,6 +504,10 @@ public class HostVO implements Host { this.privateIpAddress = ipAddress; } + public void setCpuSockets(Integer cpuSockets) { + this.cpuSockets = cpuSockets; + } + public void setCpus(Integer cpus) { this.cpus = cpus; } @@ -621,6 +628,11 @@ public class HostVO implements Host { this.guid = guid; } + @Override + public Integer getCpuSockets() { + return cpuSockets; + } + @Override public Integer getCpus() { return cpus; diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index e3f60f2357f..9f75fa808b2 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -3986,6 +3986,7 @@ ServerResource { (Long) info.get(4), (String) info.get(3), _hypervisorType, RouterPrivateIpStrategy.HostLocal); cmd.setStateChanges(changes); + cmd.setCpuSockets((Integer)info.get(5)); fillNetworkInformation(cmd); _privateIp = cmd.getPrivateIpAddress(); cmd.getHostDetails().putAll(getVersionStrings()); @@ -4311,6 +4312,7 @@ ServerResource { long speed = 0; long cpus = 0; long ram = 0; + int cpuSockets = 0; String cap = null; try { Connect conn = LibvirtConnection.getConnection(); @@ -4334,6 +4336,7 @@ ServerResource { speed = hosts.mhz; } + cpuSockets = hosts.sockets; cpus = hosts.cpus; ram = hosts.memory * 1024L; LibvirtCapXMLParser parser = new LibvirtCapXMLParser(); @@ -4366,8 +4369,9 @@ ServerResource { // 768M dom0ram = Math.max(dom0ram, _dom0MinMem); info.add(dom0ram); + info.add(cpuSockets); s_logger.debug("cpus=" + cpus + ", speed=" + speed + ", ram=" + ram - + ", dom0ram=" + dom0ram); + + ", dom0ram=" + dom0ram + ", cpu sockets=" + cpuSockets); return info; } diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index f6f84f6f835..317af166b17 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -6040,6 +6040,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa cmd.setCaps("hvm"); cmd.setDom0MinMemory(0); cmd.setSpeed(summary.getCpuSpeed()); + cmd.setCpuSockets(summary.getCpuSockets()); cmd.setCpus((int) summary.getCpuCount()); cmd.setMemory(summary.getMemoryBytes()); } diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index ccb27ea400b..5c9f4e568d2 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -4829,7 +4829,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe if (_host.cpus <= 0) { throw new CloudRuntimeException("Cannot get the numbers of cpu from XenServer host " + _host.ip); } - + Map cpuInfo = myself.getCpuInfo(conn); + if (cpuInfo.get("socket_count") != null) { + _host.cpuSockets = Integer.parseInt(cpuInfo.get("socket_count")); + } for (final HostCpu hc : hcs) { _host.speed = hc.getSpeed(conn).intValue(); break; @@ -5974,6 +5977,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe cmd.setCaps(caps.toString()); cmd.setSpeed(_host.speed); + cmd.setCpuSockets(_host.cpuSockets); cmd.setCpus(_host.cpus); HostMetrics hm = host.getMetrics(conn); @@ -8074,6 +8078,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe public String storagePif2; public String pool; public int speed; + public Integer cpuSockets; public int cpus; public String product_version; public String localSRuuid; diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index 735bbc92295..f34e60efc96 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -26,6 +26,7 @@ import java.util.Set; import javax.ejb.Local; import javax.inject.Inject; +import com.cloud.hypervisor.Hypervisor; import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.affinity.AffinityGroupDomainMapVO; import org.apache.cloudstack.affinity.AffinityGroupResponse; @@ -1530,6 +1531,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { Object haHosts = cmd.getHaHost(); Long startIndex = cmd.getStartIndex(); Long pageSize = cmd.getPageSizeVal(); + Hypervisor.HypervisorType hypervisorType = cmd.getHypervisor(); Filter searchFilter = new Filter(HostJoinVO.class, "id", Boolean.TRUE, startIndex, pageSize); @@ -1544,6 +1546,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { sb.and("podId", sb.entity().getPodId(), SearchCriteria.Op.EQ); sb.and("clusterId", sb.entity().getClusterId(), SearchCriteria.Op.EQ); sb.and("resourceState", sb.entity().getResourceState(), SearchCriteria.Op.EQ); + sb.and("hypervisor_type", sb.entity().getHypervisorType(), SearchCriteria.Op.EQ); String haTag = _haMgr.getHaTag(); if (haHosts != null && haTag != null && !haTag.isEmpty()) { @@ -1599,6 +1602,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { sc.setParameters("tag", haTag); } + if (hypervisorType != HypervisorType.None && hypervisorType != HypervisorType.Any) { + sc.setParameters("hypervisor_type", hypervisorType); + } // search host details by ids Pair, Integer> uniqueHostPair = _hostJoinDao.searchAndCount(sc, searchFilter); Integer count = uniqueHostPair.second(); diff --git a/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java index 97f8bf92d41..68475438a16 100644 --- a/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java @@ -78,6 +78,7 @@ public class HostJoinDaoImpl extends GenericDaoBase implements hostResponse.setId(host.getUuid()); hostResponse.setCapabilities(host.getCapabilities()); hostResponse.setClusterId(host.getClusterUuid()); + hostResponse.setCpuSockets(host.getCpuSockets()); hostResponse.setCpuNumber(host.getCpus()); hostResponse.setZoneId(host.getZoneUuid()); hostResponse.setDisconnectedOn(host.getDisconnectedOn()); diff --git a/server/src/com/cloud/api/query/vo/HostJoinVO.java b/server/src/com/cloud/api/query/vo/HostJoinVO.java index fbc59cd5884..2f10a67223d 100644 --- a/server/src/com/cloud/api/query/vo/HostJoinVO.java +++ b/server/src/com/cloud/api/query/vo/HostJoinVO.java @@ -98,6 +98,9 @@ public class HostJoinVO extends BaseViewVO implements InternalIdentity, Identity @Column(name="mgmt_server_id") private Long managementServerId; + @Column(name="cpu_sockets") + private Integer cpuSockets; + @Column(name="cpus") private Integer cpus; @@ -249,6 +252,10 @@ public class HostJoinVO extends BaseViewVO implements InternalIdentity, Identity return managementServerId; } + public Integer getCpuSockets() { + return cpuSockets; + } + public Integer getCpus() { return cpus; } diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index e9d51936878..428a57b8af3 100755 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -1926,6 +1926,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager, host.setType(com.cloud.host.Host.Type.Routing); host.setDetails(details); host.setCaps(ssCmd.getCapabilities()); + host.setCpuSockets(ssCmd.getCpuSockets()); host.setCpus(ssCmd.getCpus()); host.setTotalMemory(ssCmd.getMemory()); host.setSpeed(ssCmd.getSpeed()); diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index 1c99e3f79d0..9fe56c08441 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -461,6 +461,80 @@ CREATE VIEW `cloud`.`storage_pool_view` AS and async_job.instance_type = 'StoragePool' and async_job.job_status = 0; +ALTER TABLE `cloud`.`host` ADD COLUMN `cpu_sockets` int(10) unsigned DEFAULT NULL COMMENT "the number of CPU sockets on the host" AFTER pod_id; + +DROP VIEW IF EXISTS `cloud`.`host_view`; +CREATE VIEW `cloud`.`host_view` AS + select + host.id, + host.uuid, + host.name, + host.status, + host.disconnected, + host.type, + host.private_ip_address, + host.version, + host.hypervisor_type, + host.hypervisor_version, + host.capabilities, + host.last_ping, + host.created, + host.removed, + host.resource_state, + host.mgmt_server_id, + host.cpu_sockets, + host.cpus, + host.speed, + host.ram, + cluster.id cluster_id, + cluster.uuid cluster_uuid, + cluster.name cluster_name, + cluster.cluster_type, + data_center.id data_center_id, + data_center.uuid data_center_uuid, + data_center.name data_center_name, + data_center.networktype data_center_type, + host_pod_ref.id pod_id, + host_pod_ref.uuid pod_uuid, + host_pod_ref.name pod_name, + host_tags.tag, + guest_os_category.id guest_os_category_id, + guest_os_category.uuid guest_os_category_uuid, + guest_os_category.name guest_os_category_name, + mem_caps.used_capacity memory_used_capacity, + mem_caps.reserved_capacity memory_reserved_capacity, + cpu_caps.used_capacity cpu_used_capacity, + cpu_caps.reserved_capacity cpu_reserved_capacity, + async_job.id job_id, + async_job.uuid job_uuid, + async_job.job_status job_status, + async_job.account_id job_account_id + from + `cloud`.`host` + left join + `cloud`.`cluster` ON host.cluster_id = cluster.id + left join + `cloud`.`data_center` ON host.data_center_id = data_center.id + left join + `cloud`.`host_pod_ref` ON host.pod_id = host_pod_ref.id + left join + `cloud`.`host_details` ON host.id = host_details.host_id + and host_details.name = 'guest.os.category.id' + left join + `cloud`.`guest_os_category` ON guest_os_category.id = CONVERT( host_details.value , UNSIGNED) + left join + `cloud`.`host_tags` ON host_tags.host_id = host.id + left join + `cloud`.`op_host_capacity` mem_caps ON host.id = mem_caps.host_id + and mem_caps.capacity_type = 0 + left join + `cloud`.`op_host_capacity` cpu_caps ON host.id = cpu_caps.host_id + and cpu_caps.capacity_type = 1 + left join + `cloud`.`async_job` ON async_job.instance_id = host.id + and async_job.instance_type = 'Host' + and async_job.job_status = 0; + CREATE TABLE `cloud`.`firewall_rule_details` ( `id` bigint unsigned NOT NULL auto_increment, `firewall_rule_id` bigint unsigned NOT NULL COMMENT 'Firewall rule id', diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java index 108a3ecb194..c4836a8ad1d 100755 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java @@ -913,6 +913,7 @@ public class HostMO extends BaseMO implements VmwareHypervisorHost { summary.setCpuCount(hardwareSummary.getNumCpuThreads()); summary.setMemoryBytes(hardwareSummary.getMemorySize()); summary.setCpuSpeed(hardwareSummary.getCpuMhz()); + summary.setCpuSockets((int)hardwareSummary.getNumCpuPkgs()); if(s_logger.isTraceEnabled()) s_logger.trace("vCenter API trace - getHyperHostResourceSummary() done"); diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VmwareHypervisorHost.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VmwareHypervisorHost.java index f7288f1b149..c2c326a9751 100755 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VmwareHypervisorHost.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VmwareHypervisorHost.java @@ -21,7 +21,6 @@ import com.vmware.vim25.ComputeResourceSummary; import com.vmware.vim25.ManagedObjectReference; import com.vmware.vim25.ObjectContent; import com.vmware.vim25.VirtualMachineConfigSpec; - import com.cloud.hypervisor.vmware.util.VmwareContext; /** diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VmwareHypervisorHostResourceSummary.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VmwareHypervisorHostResourceSummary.java index fa11dc3488c..323cb35e362 100755 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VmwareHypervisorHostResourceSummary.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VmwareHypervisorHostResourceSummary.java @@ -20,6 +20,7 @@ public class VmwareHypervisorHostResourceSummary { private long memoryBytes; private long cpuCount; private long cpuSpeed; + private Integer cpuSockets; public VmwareHypervisorHostResourceSummary() { } @@ -47,4 +48,12 @@ public class VmwareHypervisorHostResourceSummary { public void setCpuSpeed(long cpuSpeed) { this.cpuSpeed = cpuSpeed; } + + public Integer getCpuSockets() { + return cpuSockets; + } + + public void setCpuSockets(Integer cpuSockets) { + this.cpuSockets = cpuSockets; + } } From 0ef61351988088e695a0bf1aa6ff273c5c2da1fb Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Tue, 5 Nov 2013 17:27:48 +0530 Subject: [PATCH 011/108] CLOUDSTACK-3715. Fix import error. --- .../storage/resource/VmwareSecondaryStorageContextFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java index 3d7a18de0e2..254e89b58f8 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java @@ -21,8 +21,9 @@ import javax.inject.Inject; import org.apache.log4j.Logger; +import org.apache.cloudstack.framework.config.dao.ConfigurationDao; + import com.cloud.configuration.Config; -import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.hypervisor.vmware.util.VmwareClient; import com.cloud.hypervisor.vmware.util.VmwareContext; import com.cloud.hypervisor.vmware.util.VmwareContextPool; From 80813375ae9eab84118a4905946ab6073d176d71 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Tue, 5 Nov 2013 11:02:41 -0700 Subject: [PATCH 012/108] Allow disabling modules and extensions from module.properties Discovery of modules is based on classpath scanning. In some situations it may not be possible or desirable to change the classpath. To force a module to not load you can create a file called modules.properties on the classpath that can exclude specific modules from loading. Additionally this same file can be used to exclude a specific extension. Extension loading is typically done through global configuration. If you want to set up an environment and you don't even want the extension/module loaded on the first start, then using the config file is appropriate. Example: modules.properties modules.exclude=storage-image-s3,storage-volume-solidfire extensions.exclude=ClusterScopeStoragePoolAllocator,ZoneWideStoragePoolAllocator Typically you would want to place this file in /etc/cloudstack/management --- .../lifecycle/registry/ExtensionRegistry.java | 15 +---- .../lifecycle/registry/RegistryLifecycle.java | 46 +++++++++++++- .../lifecycle/registry/RegistryUtils.java | 35 +++++++++++ .../module/factory/QuietLoaderFactory.java | 62 +++++++++++++++++++ .../impl/DefaultModuleDefinitionSet.java | 59 +++++++++++++++++- .../module/model/impl/defaults-context.xml | 9 +++ .../ModuleBasedContextFactoryTest.java | 10 +++ ...asspathModuleDefinitionSetLocatorTest.java | 2 +- .../testhierarchy/excluded/module.properties | 19 ++++++ .../testhierarchy/excluded/test-context.xml | 33 ++++++++++ .../testhierarchy/excluded2/module.properties | 19 ++++++ .../testhierarchy/excluded2/test-context.xml | 33 ++++++++++ .../orphan-of-excluded/defaults.properties | 20 ++++++ .../orphan-of-excluded/module.properties | 19 ++++++ .../orphan-of-excluded/test-context.xml | 33 ++++++++++ 15 files changed, 396 insertions(+), 18 deletions(-) create mode 100644 framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryUtils.java create mode 100644 framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/QuietLoaderFactory.java create mode 100644 framework/spring/module/src/test/resources/testhierarchy/excluded/module.properties create mode 100644 framework/spring/module/src/test/resources/testhierarchy/excluded/test-context.xml create mode 100644 framework/spring/module/src/test/resources/testhierarchy/excluded2/module.properties create mode 100644 framework/spring/module/src/test/resources/testhierarchy/excluded2/test-context.xml create mode 100644 framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/defaults.properties create mode 100644 framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/module.properties create mode 100644 framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/test-context.xml diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java index 2bd362eb8e3..38008bb76f2 100644 --- a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java +++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/ExtensionRegistry.java @@ -34,7 +34,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.BeanNameAware; -import com.cloud.utils.component.Named; import com.cloud.utils.component.Registry; public class ExtensionRegistry implements Registry, Configurable, BeanNameAware { @@ -81,7 +80,7 @@ public class ExtensionRegistry implements Registry, Configurable, BeanNa } } - String name = getName(item); + String name = RegistryUtils.getName(item); if ( name != null && exclude.size() > 0 && exclude.contains(name) ) { return false; @@ -103,7 +102,7 @@ public class ExtensionRegistry implements Registry, Configurable, BeanNa break; } - if ( getName(registered.get(i)).equals(orderTest) ) { + if ( RegistryUtils.getName(registered.get(i)).equals(orderTest) ) { i++; } } @@ -116,16 +115,6 @@ public class ExtensionRegistry implements Registry, Configurable, BeanNa return true; } - - protected String getName(Object object) { - if ( object instanceof Named ) { - String name = ((Named)object).getName(); - if ( name != null ) - return name; - } - - return object == null ? null : object.getClass().getSimpleName(); - } @Override public void unregister(Object type) { diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java index bd7a0334a6f..4975c5a4d70 100644 --- a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java +++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryLifecycle.java @@ -20,6 +20,7 @@ package org.apache.cloudstack.spring.lifecycle.registry; import java.util.HashSet; import java.util.Iterator; +import java.util.Properties; import java.util.Set; import org.slf4j.Logger; @@ -29,6 +30,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.SmartLifecycle; +import org.springframework.util.StringUtils; import com.cloud.utils.component.Registry; @@ -36,6 +38,9 @@ public class RegistryLifecycle implements BeanPostProcessor, SmartLifecycle, App private static final Logger log = LoggerFactory.getLogger(RegistryLifecycle.class); + public static final String EXTENSION_EXCLUDE = "extensions.exclude"; + public static final String EXTENSION_INCLUDE_PREFIX = "extensions.include."; + Registry registry; /* The bean name works around circular dependency issues in Spring. This shouldn't be @@ -46,15 +51,52 @@ public class RegistryLifecycle implements BeanPostProcessor, SmartLifecycle, App Set beans = new HashSet(); Class typeClass; ApplicationContext applicationContext; + Set excludes = null; @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { - if ( typeClass.isAssignableFrom(bean.getClass()) ) + if ( typeClass.isAssignableFrom(bean.getClass()) && ! isExcluded(bean) ) { beans.add(bean); - + } + return bean; } + protected synchronized boolean isExcluded(Object bean) { + String name = RegistryUtils.getName(bean); + + if ( excludes == null ) { + loadExcluded(); + } + + boolean result = excludes.contains(name); + if ( result ) { + log.info("Excluding extension [{}] based on configuration", name); + } + + return result; + } + + protected synchronized void loadExcluded() { + Properties props = applicationContext.getBean("DefaultConfigProperties", Properties.class); + excludes = new HashSet(); + for ( String exclude : props.getProperty(EXTENSION_EXCLUDE, "").trim().split("\\s*,\\s*") ) { + if ( StringUtils.hasText(exclude) ) { + excludes.add(exclude); + } + } + + for ( String key : props.stringPropertyNames() ) { + if ( key.startsWith(EXTENSION_INCLUDE_PREFIX) ) { + String module = key.substring(EXTENSION_INCLUDE_PREFIX.length()); + boolean include = props.getProperty(key).equalsIgnoreCase("true"); + if ( ! include ) { + excludes.add(module); + } + } + } + } + @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { return bean; diff --git a/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryUtils.java b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryUtils.java new file mode 100644 index 00000000000..8d7e9b68fb6 --- /dev/null +++ b/framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/registry/RegistryUtils.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cloudstack.spring.lifecycle.registry; + +import com.cloud.utils.component.Named; + +public class RegistryUtils { + + public static String getName(Object object) { + if ( object instanceof Named ) { + String name = ((Named)object).getName(); + if ( name != null ) + return name; + } + + return object == null ? null : object.getClass().getSimpleName(); + } + +} diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/QuietLoaderFactory.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/QuietLoaderFactory.java new file mode 100644 index 00000000000..74fc068fa74 --- /dev/null +++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/QuietLoaderFactory.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cloudstack.spring.module.factory; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.FactoryBean; +import org.springframework.core.io.Resource; + +public class QuietLoaderFactory implements FactoryBean { + + Resource[] resources; + + @Override + public Resource[] getObject() throws Exception { + List existing = new ArrayList(); + + for ( Resource resource : resources ) { + if ( resource.exists() ) { + existing.add(resource); + } + } + + return existing.toArray(new Resource[existing.size()]); + } + + @Override + public Class getObjectType() { + return Resource[].class; + } + + @Override + public boolean isSingleton() { + return false; + } + + public Resource[] getResources() { + return resources; + } + + public void setResources(Resource[] resources) { + this.resources = resources; + } + +} diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java index 15df839cf1a..3106ee5234a 100644 --- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java +++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java @@ -19,19 +19,23 @@ package org.apache.cloudstack.spring.module.model.impl; import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.util.ArrayList; import java.util.EmptyStackException; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Set; import java.util.Stack; import org.apache.cloudstack.spring.module.context.ResourceApplicationContext; import org.apache.cloudstack.spring.module.model.ModuleDefinition; import org.apache.cloudstack.spring.module.model.ModuleDefinitionSet; +import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; @@ -40,18 +44,25 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; +import org.springframework.util.StringUtils; public class DefaultModuleDefinitionSet implements ModuleDefinitionSet { private static final Logger log = LoggerFactory.getLogger(DefaultModuleDefinitionSet.class); public static final String DEFAULT_CONFIG_RESOURCES = "DefaultConfigResources"; + public static final String DEFAULT_CONFIG_PROPERTIES = "DefaultConfigProperties"; + public static final String MODULES_EXCLUDE = "modules.exclude"; + public static final String MODULES_INCLUDE_PREFIX = "modules.include."; + public static final String MODULE_PROPERITES = "ModuleProperties"; public static final String DEFAULT_CONFIG_XML = "defaults-context.xml"; String root; Map modules; Map contexts = new HashMap(); ApplicationContext rootContext = null; + Set excludes = new HashSet(); + Properties configProperties = null; public DefaultModuleDefinitionSet(Map modules, String root) { super(); @@ -136,7 +147,7 @@ public class DefaultModuleDefinitionSet implements ModuleDefinitionSet { } protected boolean shouldLoad(ModuleDefinition def) { - return true; + return ! excludes.contains(def.getName()); } protected ApplicationContext getDefaultsContext() { @@ -156,9 +167,52 @@ public class DefaultModuleDefinitionSet implements ModuleDefinitionSet { } } }); - + + configProperties = (Properties) context.getBean(DEFAULT_CONFIG_PROPERTIES); + for ( Resource resource : resources ) { + load(resource, configProperties); + } + + for ( Resource resource : (Resource[])context.getBean(MODULE_PROPERITES) ) { + load(resource, configProperties); + } + + parseExcludes(); + return context; } + + protected void parseExcludes() { + for ( String exclude : configProperties.getProperty(MODULES_EXCLUDE, "").trim().split("\\s*,\\s*") ) { + if ( StringUtils.hasText(exclude) ) { + excludes.add(exclude); + } + } + + for ( String key : configProperties.stringPropertyNames() ) { + if ( key.startsWith(MODULES_INCLUDE_PREFIX) ) { + String module = key.substring(MODULES_INCLUDE_PREFIX.length()); + boolean include = configProperties.getProperty(key).equalsIgnoreCase("true"); + if ( ! include ) { + excludes.add(module); + } + } + } + } + + protected void load(Resource resource, Properties props) { + InputStream is = null; + try { + if ( resource.exists() ) { + is = resource.getInputStream(); + props.load(is); + } + } catch (IOException e) { + throw new IllegalStateException("Failed to load resource [" + resource + "]", e); + } finally { + IOUtils.closeQuietly(is); + } + } protected void printHierarchy() { withModule(new WithModule() { @@ -178,6 +232,7 @@ public class DefaultModuleDefinitionSet implements ModuleDefinitionSet { return; if ( ! shouldLoad(def) ) { + log.info("Excluding context [{}] based on configuration", def.getName()); return; } diff --git a/framework/spring/module/src/main/resources/org/apache/cloudstack/spring/module/model/impl/defaults-context.xml b/framework/spring/module/src/main/resources/org/apache/cloudstack/spring/module/model/impl/defaults-context.xml index b19833a735b..8c133ec5a94 100644 --- a/framework/spring/module/src/main/resources/org/apache/cloudstack/spring/module/model/impl/defaults-context.xml +++ b/framework/spring/module/src/main/resources/org/apache/cloudstack/spring/module/model/impl/defaults-context.xml @@ -24,5 +24,14 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd"> + + + + + + classpath:modules.properties + + + diff --git a/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactoryTest.java b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactoryTest.java index 2947615d597..3cb00bcc714 100644 --- a/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactoryTest.java +++ b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/factory/ModuleBasedContextFactoryTest.java @@ -66,6 +66,16 @@ public class ModuleBasedContextFactoryTest { assertEquals("a string", set.getApplicationContext("child1").getBean("override", String.class)); } + @Test + public void testExcluded() throws IOException { + ModuleBasedContextFactory factory = new ModuleBasedContextFactory(); + ModuleDefinitionSet set = factory.loadModules(defs, "base"); + + assertNull(set.getApplicationContext("excluded")); + assertNull(set.getApplicationContext("excluded2")); + assertNull(set.getApplicationContext("orphan-of-excluded")); + } + @Test public void testBeans() throws IOException { ModuleBasedContextFactory factory = new ModuleBasedContextFactory(); diff --git a/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionSetLocatorTest.java b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionSetLocatorTest.java index 5114187b9a5..989aa9fbcb9 100644 --- a/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionSetLocatorTest.java +++ b/framework/spring/module/src/test/java/org/apache/cloudstack/spring/module/locator/impl/ClasspathModuleDefinitionSetLocatorTest.java @@ -34,7 +34,7 @@ public class ClasspathModuleDefinitionSetLocatorTest { Collection modules = factory.locateModules("testhierarchy"); - assertEquals(5, modules.size()); + assertEquals(8, modules.size()); } } diff --git a/framework/spring/module/src/test/resources/testhierarchy/excluded/module.properties b/framework/spring/module/src/test/resources/testhierarchy/excluded/module.properties new file mode 100644 index 00000000000..abd83684710 --- /dev/null +++ b/framework/spring/module/src/test/resources/testhierarchy/excluded/module.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name=excluded +parent=base \ No newline at end of file diff --git a/framework/spring/module/src/test/resources/testhierarchy/excluded/test-context.xml b/framework/spring/module/src/test/resources/testhierarchy/excluded/test-context.xml new file mode 100644 index 00000000000..57e68ddd595 --- /dev/null +++ b/framework/spring/module/src/test/resources/testhierarchy/excluded/test-context.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + diff --git a/framework/spring/module/src/test/resources/testhierarchy/excluded2/module.properties b/framework/spring/module/src/test/resources/testhierarchy/excluded2/module.properties new file mode 100644 index 00000000000..2d06f6918f1 --- /dev/null +++ b/framework/spring/module/src/test/resources/testhierarchy/excluded2/module.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name=excluded2 +parent=base \ No newline at end of file diff --git a/framework/spring/module/src/test/resources/testhierarchy/excluded2/test-context.xml b/framework/spring/module/src/test/resources/testhierarchy/excluded2/test-context.xml new file mode 100644 index 00000000000..55fd9b4810d --- /dev/null +++ b/framework/spring/module/src/test/resources/testhierarchy/excluded2/test-context.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + diff --git a/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/defaults.properties b/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/defaults.properties new file mode 100644 index 00000000000..b1f6ab97976 --- /dev/null +++ b/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/defaults.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +modules.include.excluded=false +modules.include.base=True +modules.exclude=excluded2,excluded2 \ No newline at end of file diff --git a/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/module.properties b/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/module.properties new file mode 100644 index 00000000000..7684deb6c26 --- /dev/null +++ b/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/module.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name=orphan-of-excluded +parent=excluded \ No newline at end of file diff --git a/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/test-context.xml b/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/test-context.xml new file mode 100644 index 00000000000..6495e1b48b8 --- /dev/null +++ b/framework/spring/module/src/test/resources/testhierarchy/orphan-of-excluded/test-context.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + From b464a20a5264f043cdeb306cc8ebace608ded6c8 Mon Sep 17 00:00:00 2001 From: Jayapal Date: Tue, 5 Nov 2013 23:19:22 +0530 Subject: [PATCH 013/108] CLOUDSTACK-4736: Monitoring services in VR --- .../cloud/agent/api/to/MonitorServiceTO.java | 74 +++++ .../com/cloud/network/MonitoringService.java | 42 +++ .../api/routing/SetMonitorServiceCommand.java | 56 ++++ ...spring-engine-schema-core-daos-context.xml | 1 + .../network/dao/MonitoringServiceDao.java | 31 +++ .../network/dao/MonitoringServiceDaoImpl.java | 68 +++++ .../network/dao/MonitoringServiceVO.java | 119 ++++++++ .../xen/resource/CitrixResourceBase.java | 55 ++-- .../VirtualNetworkApplianceManagerImpl.java | 62 ++++- setup/db/db/schema-421to430.sql | 15 + .../config/opt/cloud/bin/monitor_service.sh | 71 +++++ .../debian/config/root/monitorServices.py | 263 ++++++++++++++++++ 12 files changed, 822 insertions(+), 35 deletions(-) create mode 100644 api/src/com/cloud/agent/api/to/MonitorServiceTO.java create mode 100644 api/src/com/cloud/network/MonitoringService.java create mode 100644 core/src/com/cloud/agent/api/routing/SetMonitorServiceCommand.java create mode 100644 engine/schema/src/com/cloud/network/dao/MonitoringServiceDao.java create mode 100644 engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java create mode 100644 engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java create mode 100755 systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh create mode 100755 systemvm/patches/debian/config/root/monitorServices.py diff --git a/api/src/com/cloud/agent/api/to/MonitorServiceTO.java b/api/src/com/cloud/agent/api/to/MonitorServiceTO.java new file mode 100644 index 00000000000..deced16eff9 --- /dev/null +++ b/api/src/com/cloud/agent/api/to/MonitorServiceTO.java @@ -0,0 +1,74 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.agent.api.to; + +import org.apache.cloudstack.api.InternalIdentity; + +public class MonitorServiceTO implements InternalIdentity { + long id; + String service; + String processname; + String serviceName; + String servicePath; + String pidFile; + boolean isDefault; + + protected MonitorServiceTO() { + } + + public MonitorServiceTO (String service, String processname, String serviceName, String servicepath, String pidFile, boolean isDefault) { + this.service = service; + this.processname = processname; + this.serviceName = serviceName; + this.servicePath = servicepath; + this.pidFile = pidFile; + this.isDefault = isDefault; + } + + + + public boolean isDefault() { + return isDefault; + } + + public String getPidFile() { + return pidFile; + } + + @Override + public long getId() { + return id; + } + + + public String getService() { + return service; + } + + public String getServiceName() { + return serviceName; + } + + public String getServicePath() { + return servicePath; + } + + public String getProcessname() { + return processname; + } + +} diff --git a/api/src/com/cloud/network/MonitoringService.java b/api/src/com/cloud/network/MonitoringService.java new file mode 100644 index 00000000000..2a1754ab970 --- /dev/null +++ b/api/src/com/cloud/network/MonitoringService.java @@ -0,0 +1,42 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package com.cloud.network; +import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Identity; +import org.apache.cloudstack.api.InternalIdentity; + + +/** + * Nic represents one nic on the VM. + */ +public interface MonitoringService extends ControlledEntity, Identity, InternalIdentity { + /** + * @return id in the CloudStack database + */ + enum Service { + Dhcp, + LoadBalancing, + Ssh, + Webserver, + } + long getId(); + String getService(); + String getServiceName(); + String getPidFile(); + String getServicePath(); +} diff --git a/core/src/com/cloud/agent/api/routing/SetMonitorServiceCommand.java b/core/src/com/cloud/agent/api/routing/SetMonitorServiceCommand.java new file mode 100644 index 00000000000..109daf2c2b6 --- /dev/null +++ b/core/src/com/cloud/agent/api/routing/SetMonitorServiceCommand.java @@ -0,0 +1,56 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.agent.api.routing; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import com.cloud.agent.api.to.MonitorServiceTO; + +/** + * + * AccessDetails allow different components to put in information about + * how to access the components inside the command. + */ +public class SetMonitorServiceCommand extends NetworkElementCommand { + MonitorServiceTO[] services; + + protected SetMonitorServiceCommand() { + } + + public SetMonitorServiceCommand(List services) { + this.services = services.toArray(new MonitorServiceTO[services.size()]); + } + + public MonitorServiceTO[] getRules() { + return services; + } + + public String getConfiguration() { + + StringBuilder sb = new StringBuilder(); + for (MonitorServiceTO service: services) { + sb.append("[").append(service.getService()).append("]").append(":"); + sb.append("processname=").append(service.getProcessname()).append(":"); + sb.append("servicename=").append(service.getServiceName()).append(":"); + sb.append("pidfile=").append(service.getPidFile()).append(":"); + sb.append(","); + } + + return sb.toString(); + } +} diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml index e811cce2362..98ef018d791 100644 --- a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml +++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml @@ -155,6 +155,7 @@ + diff --git a/engine/schema/src/com/cloud/network/dao/MonitoringServiceDao.java b/engine/schema/src/com/cloud/network/dao/MonitoringServiceDao.java new file mode 100644 index 00000000000..7cc7cc08b68 --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/MonitoringServiceDao.java @@ -0,0 +1,31 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package com.cloud.network.dao; + +import com.cloud.utils.db.GenericDao; + +import java.util.List; + +public interface MonitoringServiceDao extends GenericDao { + + List listAllServices(); + List listDefaultServices(boolean isDefault); + + MonitoringServiceVO getServiceByName(String service); + +} diff --git a/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java b/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java new file mode 100644 index 00000000000..53dc7d455bb --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java @@ -0,0 +1,68 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + +package com.cloud.network.dao; + +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import org.springframework.stereotype.Component; + +import javax.ejb.Local; +import java.util.List; + +@Component +@Local(value=MonitoringServiceDao.class) +public class MonitoringServiceDaoImpl extends GenericDaoBase implements MonitoringServiceDao { + private final SearchBuilder AllFieldsSearch; + + public MonitoringServiceDaoImpl() { + super(); + AllFieldsSearch = createSearchBuilder(); + AllFieldsSearch.and("isDefault", AllFieldsSearch.entity().getDefault(), SearchCriteria.Op.EQ); + AllFieldsSearch.and("service", AllFieldsSearch.entity().getService(), SearchCriteria.Op.EQ); + AllFieldsSearch.and("processname", AllFieldsSearch.entity().getProcessname(), SearchCriteria.Op.EQ); + AllFieldsSearch.and("servicename", AllFieldsSearch.entity().getServiceName(), SearchCriteria.Op.EQ); + AllFieldsSearch.and("servicepath", AllFieldsSearch.entity().getServicePath(), SearchCriteria.Op.EQ); + AllFieldsSearch.and("servicePidFile", AllFieldsSearch.entity().getPidFile(), SearchCriteria.Op.EQ); + + AllFieldsSearch.done(); + } + + + + @Override + public List listAllServices() { + return null; + } + + @Override + public List listDefaultServices(boolean isDefault) { + SearchCriteria sc = AllFieldsSearch.create(); + sc.setParameters("isDefault", isDefault); + return listBy(sc); + } + + @Override + public MonitoringServiceVO getServiceByName(String service) { + SearchCriteria sc = AllFieldsSearch.create(); + sc.setParameters("service", service); + return findOneBy(sc); + } +} \ No newline at end of file diff --git a/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java b/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java new file mode 100644 index 00000000000..3f9122cec73 --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java @@ -0,0 +1,119 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.dao; + +import com.cloud.network.MonitoringService; + +import javax.persistence.*; +import java.util.UUID; + +@Entity +@Table(name = "monitoring_services") +public class MonitoringServiceVO implements MonitoringService { + + public MonitoringServiceVO(String service, String processname, String serviceName, String servicePath, + String pidFile) { + this.service = service; + this.processname = processname; + this.servicename = serviceName; + this.servicePath = servicePath; + this.servicePidFile= pidFile; + + } + + protected MonitoringServiceVO() { + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + long id; + + @Column(name = "service") + String service; + + @Column(name="process_name", updatable=false) + String processname; + + @Column(name="service_name", updatable=false) + String servicename; + + @Column(name="service_path", updatable=false) + private String servicePath; + + @Column(name="pidFile", updatable=false) + private String servicePidFile; + + @Column(name="isDefault") + private boolean isDefault; + + + @Column(name = "uuid") + String uuid = UUID.randomUUID().toString(); + + public long getId() { + return id; + } + + @Override + public String getService() { + return this.service; + } + + @Override + public String getServiceName() { + return this.servicename; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public String getPidFile() { + return this.servicePidFile; + + } + + @Override + public String getServicePath() { + return this.servicePidFile; + } + + @Override + public String getUuid() { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public long getAccountId() { + return 0; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public long getDomainId() { + return 0; //To change body of implemented methods use File | Settings | File Templates. + } + + public boolean getDefault() { + return isDefault; + } + + public void setDefault(boolean isDefault) { + isDefault = isDefault; + } + + public String getProcessname() { + return processname; + } +} diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 5c9f4e568d2..69b7c9e07c7 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -118,34 +118,7 @@ import com.cloud.agent.api.check.CheckSshCommand; import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand; import com.cloud.agent.api.proxy.ConsoleProxyLoadAnswer; import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand; -import com.cloud.agent.api.routing.CreateIpAliasCommand; -import com.cloud.agent.api.routing.DeleteIpAliasCommand; -import com.cloud.agent.api.routing.DhcpEntryCommand; -import com.cloud.agent.api.routing.DnsMasqConfigCommand; -import com.cloud.agent.api.routing.IpAliasTO; -import com.cloud.agent.api.routing.IpAssocAnswer; -import com.cloud.agent.api.routing.IpAssocCommand; -import com.cloud.agent.api.routing.IpAssocVpcCommand; -import com.cloud.agent.api.routing.LoadBalancerConfigCommand; -import com.cloud.agent.api.routing.NetworkElementCommand; -import com.cloud.agent.api.routing.RemoteAccessVpnCfgCommand; -import com.cloud.agent.api.routing.SavePasswordCommand; -import com.cloud.agent.api.routing.SetFirewallRulesAnswer; -import com.cloud.agent.api.routing.SetFirewallRulesCommand; -import com.cloud.agent.api.routing.SetNetworkACLAnswer; -import com.cloud.agent.api.routing.SetNetworkACLCommand; -import com.cloud.agent.api.routing.SetPortForwardingRulesAnswer; -import com.cloud.agent.api.routing.SetPortForwardingRulesCommand; -import com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand; -import com.cloud.agent.api.routing.SetSourceNatAnswer; -import com.cloud.agent.api.routing.SetSourceNatCommand; -import com.cloud.agent.api.routing.SetStaticNatRulesAnswer; -import com.cloud.agent.api.routing.SetStaticNatRulesCommand; -import com.cloud.agent.api.routing.SetStaticRouteAnswer; -import com.cloud.agent.api.routing.SetStaticRouteCommand; -import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand; -import com.cloud.agent.api.routing.VmDataCommand; -import com.cloud.agent.api.routing.VpnUsersCfgCommand; +import com.cloud.agent.api.routing.*; import com.cloud.agent.api.storage.CopyVolumeAnswer; import com.cloud.agent.api.storage.CopyVolumeCommand; import com.cloud.agent.api.storage.CreateAnswer; @@ -633,6 +606,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe return execute((ScaleVmCommand) cmd); } else if (clazz == PvlanSetupCommand.class) { return execute((PvlanSetupCommand) cmd); + } else if (clazz == SetMonitorServiceCommand.class) { + return execute((SetMonitorServiceCommand) cmd); } else { return Answer.createUnsupportedCommandAnswer(cmd); } @@ -8121,6 +8096,30 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe return new Answer(cmd, success, ""); } + private Answer execute(SetMonitorServiceCommand cmd) { + boolean success = true; + + String config = cmd.getConfiguration(); + + Connection conn = getConnection(); + String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + + if (routerIp == null) { + return new Answer(cmd); + } + + String args = "monitor_service.sh " + routerIp; + args += " -c " + config; + + String result = callHostPlugin(conn, "vmops", "routerProxy", "args", args); + if (result == null || result.isEmpty()) { + return new Answer(cmd, false, "SetMonitorServiceCommand failed to create cfg file."); + } + + return new Answer(cmd, success, ""); + + } + protected SetFirewallRulesAnswer execute(SetFirewallRulesCommand cmd) { String[] results = new String[cmd.getRules().length]; String callResult; diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index a93480be56d..9b35a4b0fbd 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -41,6 +41,7 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.agent.api.to.*; import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; @@ -82,17 +83,12 @@ import com.cloud.agent.api.routing.NetworkElementCommand; import com.cloud.agent.api.routing.RemoteAccessVpnCfgCommand; import com.cloud.agent.api.routing.SavePasswordCommand; import com.cloud.agent.api.routing.SetFirewallRulesCommand; +import com.cloud.agent.api.routing.SetMonitorServiceCommand; import com.cloud.agent.api.routing.SetPortForwardingRulesCommand; import com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand; import com.cloud.agent.api.routing.SetStaticNatRulesCommand; import com.cloud.agent.api.routing.VmDataCommand; import com.cloud.agent.api.routing.VpnUsersCfgCommand; -import com.cloud.agent.api.to.DhcpTO; -import com.cloud.agent.api.to.FirewallRuleTO; -import com.cloud.agent.api.to.IpAddressTO; -import com.cloud.agent.api.to.LoadBalancerTO; -import com.cloud.agent.api.to.PortForwardingRuleTO; -import com.cloud.agent.api.to.StaticNatRuleTO; import com.cloud.agent.manager.Commands; import com.cloud.alert.AlertManager; import com.cloud.cluster.ClusterManager; @@ -164,6 +160,7 @@ import com.cloud.network.dao.IPAddressVO; import com.cloud.network.dao.LoadBalancerDao; import com.cloud.network.dao.LoadBalancerVMMapDao; import com.cloud.network.dao.LoadBalancerVO; +import com.cloud.network.dao.MonitoringServiceVO; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkVO; import com.cloud.network.dao.PhysicalNetworkServiceProviderDao; @@ -175,6 +172,7 @@ import com.cloud.network.dao.Site2SiteVpnGatewayDao; import com.cloud.network.dao.UserIpv6AddressDao; import com.cloud.network.dao.VirtualRouterProviderDao; import com.cloud.network.dao.VpnUserDao; +import com.cloud.network.dao.MonitoringServiceDao; import com.cloud.network.lb.LoadBalancingRule; import com.cloud.network.lb.LoadBalancingRule.LbDestination; import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy; @@ -183,6 +181,7 @@ import com.cloud.network.lb.LoadBalancingRulesManager; import com.cloud.network.router.VirtualRouter.RedundantState; import com.cloud.network.router.VirtualRouter.Role; import com.cloud.network.rules.FirewallRule; +import com.cloud.network.MonitoringService; import com.cloud.network.rules.FirewallRule.Purpose; import com.cloud.network.rules.LoadBalancerContainer.Scheme; import com.cloud.network.rules.PortForwardingRule; @@ -369,8 +368,11 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V IpAddressManager _ipAddrMgr; @Inject ConfigDepot _configDepot; + @Inject + MonitoringServiceDao _monitorServiceDao; + + - int _routerRamSize; int _routerCpuMHz; int _retry = 2; @@ -2332,10 +2334,56 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V finalizeUserDataAndDhcpOnStart(cmds, router, provider, guestNetworkId); } + finalizeMonitorServiceOnStrat(cmds, router, provider, routerGuestNtwkIds.get(0)); return true; } + private void finalizeMonitorServiceOnStrat(Commands cmds, DomainRouterVO router, Provider provider, long networkId) { + + NetworkVO network = _networkDao.findById(networkId); + + s_logger.debug("Creating monitoring services on "+ router +" start..."); + + + // get the list of sevices for this network to monitor + List services = new ArrayList(); + if (_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, Provider.VirtualRouter) || + _networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dns, Provider.VirtualRouter)) { + MonitoringServiceVO dhcpService = _monitorServiceDao.getServiceByName(MonitoringService.Service.Dhcp.toString()); + if (dhcpService != null) { + services.add(dhcpService); + } + } + + if (_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Lb, Provider.VirtualRouter)) { + MonitoringServiceVO lbService = _monitorServiceDao.getServiceByName(MonitoringService.Service.LoadBalancing.toString()); + if (lbService != null) { + services.add(lbService); + } + } + List defaultServices = _monitorServiceDao.listDefaultServices(true); + services.addAll(defaultServices); + + List servicesTO = new ArrayList(); + for (MonitoringServiceVO service: services) { + MonitorServiceTO serviceTO = new MonitorServiceTO( service.getService(), service.getProcessname(), service.getServiceName(), service.getServicePath(), + service.getPidFile(), service.getDefault()); + servicesTO.add(serviceTO); + } + + SetMonitorServiceCommand command = new SetMonitorServiceCommand(servicesTO); + command.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId())); + command.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, getRouterIpInNetwork(networkId, router.getId())); + command.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName()); + + cmds.addCommand("monitor", command); + } + + + + + protected NicProfile getControlNic(VirtualMachineProfile profile) { DomainRouterVO router = _routerDao.findById(profile.getId()); DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId()); diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index 9fe56c08441..26e4abf2251 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -561,3 +561,18 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'manag 'Sets the attribute for uniquemembers within a group','uniquemember',NULL,NULL,0); UPDATE `cloud`.`volumes` SET display_volume=1 where id>0; + +create table `cloud`.`monitoring_services` ( +`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', +`uuid` varchar(40), `service` varchar(255) COMMENT 'Service name', +`process_name` varchar(255) COMMENT 'running process name', +`service_name` varchar(255) COMMENT 'exact name of the running service', +`service_path` varchar(255) COMMENT 'path of the service in system', +`pidfile` varchar(255) COMMENT 'path of the pid file of the service', +`isDefault` boolean COMMENT 'Default service', PRIMARY KEY (`id`) +); + +insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(1,'ssh','sshd', 'ssh','/etc/init.d/ssh','/var/run/sshd.pid',true); +insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(2,'dhcp','dnsmasq','dnsmasq','/etc/init.d/dnsmasq','/var/run/dnsmasq/dnsmasq.pid',false); +insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(3,'loadbalancing','haproxy','haproxy','/etc/init.d/haproxy','/var/run/haproxy.pid',false); +insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(4,'webserver','apache2','apache2','/etc/init.d/apache2','/var/run/apache2.pid', true); diff --git a/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh b/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh new file mode 100755 index 00000000000..a2b789cac8f --- /dev/null +++ b/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +source /root/func.sh + +lock="biglock" +locked=$(getLockFile $lock) +if [ "$locked" != "1" ] +then + exit 1 +fi + +set -x +usage() { + printf "Usage: %s: -c config string \n" $(basename $0) >&2 +} + +configFile='/etc/monitor.conf' + +create_config() { +services=$1; +services_list=$(echo $services | cut -d, -f1- --output-delimiter=" "); + +echo "#Monitor services config" >$configFile + +for s in $services_list +do +service=$(echo $s | cut -d: -f1); +processname=$(echo $s | cut -d: -f2); +service_name=$(echo $s | cut -d: -f3); +pidfile=$(echo $s | cut -d: -f4); + +echo $service >> $configFile; +echo $processname >> $configFile +echo $service_name >> $configFile +echo $pidfile >> $configFile + + + +done + +} + +config=$2 + +#delete cron job before updating config file +crontab -l | grep -v monitorServices.py | crontab - + +create_config $config + +#add cron job +(crontab -l ; echo "*/3 * * * * python /root/monitorServices.py") | crontab - + + +unlock_exit 0 $lock $locked + diff --git a/systemvm/patches/debian/config/root/monitorServices.py b/systemvm/patches/debian/config/root/monitorServices.py new file mode 100755 index 00000000000..358c9dcdfac --- /dev/null +++ b/systemvm/patches/debian/config/root/monitorServices.py @@ -0,0 +1,263 @@ +#!/usr/bin/python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + + + +__author__ = 'jayapalreddy' + +from ConfigParser import SafeConfigParser +from subprocess import * +from os import path +import time + +monitor_log='/var/log/monitor.log' +class StatusCodes: + SUCCESS = 0 + FAILED = 1 + INVALID_INP = 2 + RUNNING = 3 + STOPPED = 4 + STARTING = 5 + +class log: + INFO = 'INFO' + ALERT = 'ALERT' + CRIT = 'CRIT' + NOTIF = 'NOTIF' + + + + +def getConfig( config_file_path = "/etc/monitor.conf" ): + process_dict = {} + parser = SafeConfigParser() + parser.read( config_file_path ) + + #print 'Read values:\n' + + for section in parser.sections(): + # print section + process_dict[section] = {} + + for name, value in parser.items(section): + process_dict[section][name] = value +# print ' %s = %r' % (name, value) + + return process_dict + +def printd (msg): + return 0 + print msg + +def raisealert(severity, msg, process_name=None): + #timeStr=str(time.ctime()) + if process_name is not None: + log = '['+severity +']'+" " + '['+process_name+']' + " " + msg +"\n" + else: + log = '['+severity+']' + " " + msg +"\n" + + msg = 'logger -t monit '+ log + pout = Popen(msg, shell=True, stdout=PIPE) + + + #f= open(monitor_log,'r+') + #f.seek(0, 2) + #f.write(str(log)) + #f.close() + + +def isPidMatchPidFile(pidfile, pids): + + if pids is None or isinstance(pids,list) != True or len(pids) == 0: + print "Invalid Arguments" + return StatusCodes.FAILED + if not path.isfile(pidfile): + #It seems there is no pid file for this service + printd("The pid file "+pidfile+" is not there for this process") + return StatusCodes.FAILED + + fd=None + try: + fd = open(pidfile,'r') + except: + printd("pid file: "+ pidfile +" open failed") + return StatusCodes.FAILED + + + inp = fd.read() + printd("file content "+str(inp)) + printd(pids) + tocheck_pid = inp.strip() + for item in pids: + if str(tocheck_pid) == item.strip(): + printd("pid file matched") + return StatusCodes.SUCCESS + + fd.close() + return StatusCodes.FAILED + + + +def checkProcessStatus( process ): + process_name = process.get('processname') + service_name = process.get('servicename') + pidfile = process.get('pidfile') + #temp_out = None + restartFailed=0 + pidFileMatched=1 + cmd='' + if process_name is None: + print "\n Invalid Process Name" + return StatusCodes.INVALID_INP + else: + msg="checking the process " + process_name + printd(msg) + cmd = 'pidof ' + process_name + printd(cmd) + #cmd = 'service ' + process_name + ' status' + pout = Popen(cmd, shell=True, stdout=PIPE) + exitStatus = pout.wait() + temp_out = pout.communicate()[0] + + #check there is only one pid or not + if exitStatus == 0: + msg="pids: " +temp_out; + printd(msg) + pids = temp_out.split(' ') + + #there is more than one process so match the pid file + #if not matched set pidFileMatched=0 + printd("Checking pid file") + if isPidMatchPidFile(pidfile, pids) == StatusCodes.SUCCESS: + pidFileMatched = 1; + else: + pidFileMatched = 0; + + printd(pidFileMatched) + if exitStatus == 0 and pidFileMatched == 1: + printd("The process is running ....") + return StatusCodes.RUNNING + else: + printd('exit status:'+str(exitStatus)) + msg="The process " + process_name +" is not running trying recover " + printd(msg) + #Retry the process state for few seconds + for i in range(1,10): + pout = Popen(cmd, shell=True, stdout=PIPE) + exitStatus = pout.wait() + temp_out = pout.communicate()[0] + + if i < 5: # this is just for trying few more times + if exitStatus == 0: + pids = temp_out.split(' ') + + if isPidMatchPidFile(pidfile, pids) == StatusCodes.SUCCESS: + pidFileMatched = 1; + printd("pid file is matched ...") + raisealert(log.INFO, "The process detected as running", process_name) + break + else: + printd("pid file is not matched ...") + pidFileMatched = 0; + continue + time.sleep(1) + else: + msg="The process " +process_name+" is not running trying recover " + raisealert(log.INFO,process_name,msg) + + if service_name == 'apache2': + # Killing apache2 process with this the main service will not start + for pid in pids: + cmd = 'kill -9 '+pid; + printd(cmd) + Popen(cmd, shell=True, stdout=PIPE) + + cmd = 'service ' + service_name + ' restart' + try: + time.sleep(1) + return_val= check_call(cmd , shell=True) + except CalledProcessError: + restartFailed=1 + msg="service "+ process_name +" restart failed" + printd(msg) + continue + + if return_val == 0: + printd("The process" + process_name +" recovered successfully ") + msg="The process " +process_name+" is recovered successfully " + raisealert(log.ALERT,process_name,msg) + + break; + else: + #retry restarting the process for few tries + printd("process restart failing trying again ....") + restartFailed=1 + time.sleep(1) + continue + #for end here + + if restartFailed == 1: + msg="The process %s recover failed ", process_name; + raisealert(log.ALERT,process_name,msg) + + printd("Restart failed after number of retries") + return StatusCodes.STOPPED + + return StatusCodes.RUNNING + +def raiseAlert( process_name ): + print "process name %s is raised "%process_name + +def monitProcess( processes_info ): + if len( processes_info ) == 0: + print "Invalid Input" + return StatusCodes.INVALID_INP + for process,properties in processes_info.items(): + if checkProcessStatus( properties) != StatusCodes.RUNNING: + print "\n Process %s is not Running"%process + + +def main(): + ''' + Step1 : Get Config + ''' + + printd("monitoring started") + temp_dict = getConfig() + + ''' + Step2: Get Previous Run Log + ''' + + ''' + Step3: Monitor and Raise Alert + ''' + #raisealert(log.INFO, 'Monit started') + monitProcess( temp_dict ) + + +if __name__ == "__main__": + main() + + + + + + + From fdf7639eb839a88800b7eb19109a5d3e7921c33f Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Wed, 30 Oct 2013 12:08:45 +0530 Subject: [PATCH 014/108] Fixed some html validation errors language tag in script is deprecated. used type + + + - From c61d2eedf4a87107ae9a77c8c39b7f584995e617 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 5 Nov 2013 11:55:06 -0800 Subject: [PATCH 015/108] CLOUDSTACK-4908: UI > Infrastructure > Sockets > (1) calculate total number of CPU Sockets for all hypervisors. (2) > view all > calculate CPU Sockets for each hypervisor. --- ui/scripts/sharedFunctions.js | 1 + ui/scripts/system.js | 113 +++++++++++++++++++++++++++++----- 2 files changed, 99 insertions(+), 15 deletions(-) diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 05d2d9d43cd..fddbd70fafe 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -46,6 +46,7 @@ var md5HashedLogin = false; //page size for API call (e.g."listXXXXXXX&pagesize=N" ) var pageSize = 20; +//var pageSize = 1; //for testing only var rootAccountId = 1; diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 381d884e2ce..7d4ce2ab0e4 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -380,9 +380,64 @@ } }, - socketInfo: function(data) { + socketInfo: function(data) { + var socketCount = 0; + $.ajax({ + url: createURL('listHypervisors'), + async: false, + success: function(json) { + args.response.success({ + data: $(json.listhypervisorsresponse.hypervisor).map(function(index, hypervisor) { + var totalHostCount = 0; + var currentPage = 1; + var returnedHostCount = 0; + var returnedHostCpusocketsSum = 0; + var returnedHostHavingCpusockets = true; + + var callListHostsWithPage = function(setTotalHostCount) { + $.ajax({ + url: createURL('listHosts'), + async: false, + data: { + hypervisortype: hypervisor.name, + page: currentPage, + pagesize: pageSize //global variable + }, + success: function(json) { + if (setTotalHostCount) { + totalHostCount = json.listhostsresponse.count; + } + returnedHostCount += json.listhostsresponse.host.length; + + var items = json.listhostsresponse.host; + for (var i = 0; i < items.length; i++) { + if (items[i].cpusockets != undefined && isNaN(items[i].cpusockets) == false) { + returnedHostCpusocketsSum += items[i].cpusockets; + } else { + returnedHostHavingCpusockets = false; + } + } + + if (returnedHostCount < totalHostCount) { + currentPage++; + callListHostsWithPage(false); + } + } + }); + } + + callListHostsWithPage(true); + + if (returnedHostHavingCpusockets) { + socketCount += returnedHostCpusocketsSum; + } + }) + }); + } + }); + complete($.extend(data, { - socketCount: 0 + socketCount: socketCount })); } }; @@ -7135,22 +7190,50 @@ success: function(json) { args.response.success({ data: $(json.listhypervisorsresponse.hypervisor).map(function(index, hypervisor) { - var hostCount; - $.ajax({ - url: createURL('listHosts'), - async: false, - data: { - hypervisortype: hypervisor.name - }, - success: function(json) { - hostCount = json.listhostsresponse.count; - } - }); + var totalHostCount = 0; + var currentPage = 1; + var returnedHostCount = 0; + var returnedHostCpusocketsSum = 0; + var returnedHostHavingCpusockets = true; + + var callListHostsWithPage = function(setTotalHostCount) { + $.ajax({ + url: createURL('listHosts'), + async: false, + data: { + hypervisortype: hypervisor.name, + page: currentPage, + pagesize: pageSize //global variable + }, + success: function(json) { + if (setTotalHostCount) { + totalHostCount = json.listhostsresponse.count; + } + returnedHostCount += json.listhostsresponse.host.length; + + var items = json.listhostsresponse.host; + for (var i = 0; i < items.length; i++) { + if (items[i].cpusockets != undefined && isNaN(items[i].cpusockets) == false) { + returnedHostCpusocketsSum += items[i].cpusockets; + } else { + returnedHostHavingCpusockets = false; + } + } + + if (returnedHostCount < totalHostCount) { + currentPage++; + callListHostsWithPage(false); + } + } + }); + } + callListHostsWithPage(true); + return { hypervisor: hypervisor.name, - hosts: hostCount, - sockets: 0 + hosts: totalHostCount, + sockets: (returnedHostHavingCpusockets? returnedHostCpusocketsSum : 'unknown') }; }) }); From ac04a9f2e138fbfb46bdb8c28fd1d5d811b165ac Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 5 Nov 2013 13:16:26 -0800 Subject: [PATCH 016/108] CLOUDSTACK-4793: UI > Infrastructure > Virtual Routers > detail tab > add Version field which will include text "Requires Upgrade" if VR version is different from MS version. --- ui/scripts/system.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 7d4ce2ab0e4..1579d16c74d 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7688,6 +7688,9 @@ state: { label: 'label.state' }, + version: { + label: 'label.version' + }, guestnetworkid: { label: 'label.network.id' }, @@ -7736,7 +7739,7 @@ dataType: 'json', async: true, success: function(json) { - var jsonObj = json.listroutersresponse.router[0]; + var jsonObj = json.listroutersresponse.router[0]; addExtraPropertiesToRouterInstanceObject(jsonObj); args.response.success({ actionFilter: routerActionfilter, @@ -16435,10 +16438,18 @@ } var addExtraPropertiesToRouterInstanceObject = function(jsonObj) { - if (jsonObj.isredundantrouter == true) + if (jsonObj.isredundantrouter == true) { jsonObj["redundantRouterState"] = jsonObj.redundantstate; - else + } else { jsonObj["redundantRouterState"] = ""; + } + + //jsonObj.version = '4.2.0-SNAPSHOT'; //for testing only + if (jsonObj.version != undefined && jsonObj.version.length > 0) { + if (jsonObj.version != g_cloudstackversion) { //if VirtualRouter version is different from management server version + jsonObj.version += " (Requires Upgrade)"; + } + } } var refreshNspData = function(nspName) { From 599dd1a6e63d350f91c4ef384fa3aea70e178122 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 5 Nov 2013 14:35:05 -0800 Subject: [PATCH 017/108] multiEdit: extend field hide/show functionality -Support passing isHidden option as closure, for conditional hide/show based on context -Adds new option format for isHidden option: return false == show field and all columns (default) return true == hide only header and form column return 2 == hide header and form, as well as returned item column -- these item columns will be skipped over entirely, not just hidden --- ui/scripts/network.js | 6 ++++++ ui/scripts/ui/widgets/multiEdit.js | 19 +++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 4196b108cf3..4915691d737 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -3368,6 +3368,12 @@ requireValidation: true, buttonLabel: 'label.configure', action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler) + }, + isHidden: function(args) { + // return 2 == hide header and form, as well as returned item column + // return 2; + + return false; } }, diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js index 5d973aad949..79bb0d4f869 100755 --- a/ui/scripts/ui/widgets/multiEdit.js +++ b/ui/scripts/ui/widgets/multiEdit.js @@ -85,6 +85,12 @@ return true; } + var isHidden = $multi.find('th.' + fieldName).hasClass('always-hide'); + + if (isHidden) { + return true; + } + var $td = $('').addClass(fieldName).appendTo($tr); var $input, val; var $addButton = $multi.find('form .button.add-vm:not(.custom-action)').clone(); @@ -264,7 +270,7 @@ // Align width to main header _medit.refreshItemWidths($multi); - + if (data._hideFields && $.inArray(fieldName, data._hideFields) > -1) { $td.addClass('disabled'); @@ -891,7 +897,16 @@ $td.attr('rel', fieldName); $td.appendTo($inputForm); - if (field.isHidden) { + var isHidden = $.isFunction(field.isHidden) ? + field.isHidden({ context: context }) : field.isHidden; + + if (isHidden) { + // return true == hide only header and form column + // return 2 == hide header and form, as well as returned item column + if (isHidden === 2) { + $th.addClass('always-hide'); + } + $th.hide(); $td.hide(); } From 441e1685423ffd70fb1147119c75e1bdc295858d Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 5 Nov 2013 14:45:24 -0800 Subject: [PATCH 018/108] Network chart: Fix layout CSS --- ui/css/cloudstack3.css | 64 +++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index ba2439a3ca7..8676737ddc8 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -8531,26 +8531,26 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t } .network-chart li.firewall { - /*+placement:shift 206px 211px;*/ + /*+placement:shift 282px 188px;*/ position: relative; - left: 206px; - top: 211px; + left: 282px; + top: 188px; position: absolute; } .network-chart li.loadBalancing { - /*+placement:shift 92px 308px;*/ + /*+placement:shift 167px 342px;*/ position: relative; - left: 92px; - top: 308px; + left: 167px; + top: 342px; position: absolute; } .network-chart li.portForwarding { - /*+placement:shift 332px 308px;*/ + /*+placement:shift 401px 342px;*/ position: relative; - left: 332px; - top: 308px; + left: 401px; + top: 342px; position: absolute; } @@ -8579,20 +8579,44 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t } .network-chart li .view-details { - /*+placement:anchor-bottom-right 11px 11px;*/ + /*+placement:anchor-bottom-right 34px 19px;*/ position: absolute; - right: 11px; - bottom: 11px; + right: 34px; + bottom: 19px; cursor: pointer; - color: #FFFFFF; - background: url(../images/buttons.png) no-repeat -457px -503px; + background: #F7F7F7; + background: rgb(247, 247, 247); + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2Y3ZjdmNyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlYWVhZWEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); + background: -moz-linear-gradient(top, rgba(247,247,247,1) 1%, rgba(234,234,234,1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,rgba(247,247,247,1)), color-stop(100%,rgba(234,234,234,1))); + background: -webkit-linear-gradient(top, rgba(247,247,247,1) 1%,rgba(234,234,234,1) 100%); + background: -o-linear-gradient(top, rgba(247,247,247,1) 1%,rgba(234,234,234,1) 100%); + background: -ms-linear-gradient(top, rgba(247,247,247,1) 1%,rgba(234,234,234,1) 100%); + background: linear-gradient(to bottom, rgba(247,247,247,1) 1%,rgba(234,234,234,1) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7f7f7', endColorstr='#eaeaea',GradientType=0 ); font-size: 11px; - padding: 6px 17px 6px 9px; - /*+text-shadow:0px 1px 1px #395065;*/ - -moz-text-shadow: 0px 1px 1px #395065; - -webkit-text-shadow: 0px 1px 1px #395065; - -o-text-shadow: 0px 1px 1px #395065; - text-shadow: 0px 1px 1px #395065; + padding: 8px 20px; + color: #000000; + border: 1px solid #A2A2A2; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} + +.network-chart li .view-details:hover { + background: #D5D5D5; + /*+text-shadow:0px 1px 1px #FFFFFF;*/ + -moz-text-shadow: 0px 1px 1px #FFFFFF; + -webkit-text-shadow: 0px 1px 1px #FFFFFF; + -o-text-shadow: 0px 1px 1px #FFFFFF; + text-shadow: 0px 1px 1px #FFFFFF; + /*+box-shadow:inset 0px 0px 4px #000000;*/ + -moz-box-shadow: inset 0px 0px 4px #000000; + -webkit-box-shadow: inset 0px 0px 4px #000000; + -o-box-shadow: inset 0px 0px 4px #000000; + box-shadow: inset 0px 0px 4px #000000; } .network-chart li.disabled .view-details { From 2613c0a82179bf42a8463b225648e44cc2fe1936 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Tue, 5 Nov 2013 15:40:45 -0800 Subject: [PATCH 019/108] git config files were missing the ASF license --- .../hyperv/DotNet/ServerResource/.gitignore | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/.gitignore b/plugins/hypervisors/hyperv/DotNet/ServerResource/.gitignore index 99afc0b89f2..a2f30c86ba7 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/.gitignore +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/.gitignore @@ -1,3 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + packages *.suo */obj/* From 7a042e2330bff528208a5c9aed462180bc520028 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Tue, 5 Nov 2013 16:35:07 -0800 Subject: [PATCH 020/108] CLOUDSTACK-5038: used cpu is getting bumped up when the over provisioning factor > 1. This was because we didnt record the overprovisioning factors of the vms which got deployed pre 4.2 Upgrade path will fix that by populating the cpu/mem overprovisioning factors for each of the vms in user_vm_details table using the global overprovisioning factor. Reviewed by : bharat kumar Signed off by : nitin mehta --- .../cloud/upgrade/dao/Upgrade420to421.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java index 27704e8739e..d37c0a1a2c4 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java @@ -65,6 +65,52 @@ public class Upgrade420to421 implements DbUpgrade { @Override public void performDataMigration(Connection conn) { upgradeResourceCount(conn); + updateCpuOverprovisioning(conn); + } + + private void updateCpuOverprovisioning(Connection conn) { + PreparedStatement pstmt1 = null; + PreparedStatement pstmt2 = null; + PreparedStatement pstmt3 = null; + ResultSet result1 = null; + ResultSet result2 = null; + + // Get cpu overprovisioning factor from global setting and update user vm details table for all the vms if factor > 1 + + try { + pstmt1 = conn.prepareStatement("select value from `cloud`.`configuration` where name='cpu.overprovisioning.factor'"); + result1 = pstmt1.executeQuery(); + String overprov = "1"; + if(result1.next()){ + overprov = result1.getString(1); + } + // Need to populate only when overprovisioning factor doesn't pre exist. + s_logger.debug("Starting updating user_vm_details with cpu/memory overprovisioning factors"); + pstmt2 = conn.prepareStatement("select id from `cloud`.`vm_instance` where removed is null and id not in (select vm_id from `cloud`.`user_vm_details` where name='cpuOvercommitRatio')"); + pstmt3 = conn.prepareStatement("INSERT IGNORE INTO cloud.user_vm_details (vm_id, name, value) VALUES (?, ?, ?)"); + result2 = pstmt2.executeQuery(); + while (result2.next()) { + //For cpu + pstmt3.setLong(1, result2.getLong(1)); + pstmt3.setString(2, "cpuOvercommitRatio"); + pstmt3.setString(3, overprov); + pstmt3.executeUpdate(); + + // For memory + pstmt3.setLong(1, result2.getLong(1)); + pstmt3.setString(2, "memoryOvercommitRatio"); + pstmt3.setString(3, "1"); // memory overprovisioning didn't exist earlier. + pstmt3.executeUpdate(); + } + s_logger.debug("Done updating user_vm_details with cpu/memory overprovisioning factors"); + + + } catch (SQLException e) { + throw new CloudRuntimeException("Unable to update cpu/memory overprovisioning factors", e); + } finally { + + } + } private void upgradeResourceCount(Connection conn) { From 94f9b31c9a4c7ae67feabbe16d2ea753e3183289 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Tue, 5 Nov 2013 16:35:12 -0800 Subject: [PATCH 021/108] CLOUDSTACK-5046:Vmware- System's StartCommand failed with "NumberFormatException". --- .../cloud/hypervisor/vmware/mo/HypervisorHostHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java index 3a70744aa95..cd2c3e8746c 100755 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java @@ -937,7 +937,7 @@ public class HypervisorHostHelper { if(vlanId != null && !UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId) ) { createGCTag = true; - vid = Integer.parseInt(BroadcastDomainType.getValue(vlanId)); + vid = Integer.parseInt(vlanId); } } @@ -1205,7 +1205,7 @@ public class HypervisorHostHelper { return false; } - public static VirtualMachineMO createWorkerVM(VmwareHypervisorHost hyperHost, + public static VirtualMachineMO createWorkerVM(VmwareHypervisorHost hyperHost, DatastoreMO dsMo, String vmName) throws Exception { // Allow worker VM to float within cluster so that we will have better chance to @@ -1247,7 +1247,7 @@ public class HypervisorHostHelper { if(workingVM != null) { workingVM.setCustomFieldValue(CustomFieldConstants.CLOUD_WORKER, "true"); - String workerTag = String.format("%d-%s", System.currentTimeMillis(), + String workerTag = String.format("%d-%s", System.currentTimeMillis(), hyperHost.getContext().getStockObject("noderuninfo")); workingVM.setCustomFieldValue(CustomFieldConstants.CLOUD_WORKER_TAG, workerTag); } From 191dc80fa49d921a7a1b7cf5a2697c5c9e348851 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Tue, 5 Nov 2013 18:53:37 -0800 Subject: [PATCH 022/108] VM power state for job oritented sync processing --- api/.gitignore | 32431 ++++++++++++++++ .../agent/api/HostVmStateReportEntry.java | 41 + api/src/com/cloud/vm/VirtualMachine.java | 19 + .../com/cloud/vm/VirtualMachineManager.java | 6 +- .../vm/VirtualMachinePowerStateSync.java | 32 + .../vm/VirtualMachinePowerStateSyncImpl.java | 125 + .../schema/src/com/cloud/vm/VMInstanceVO.java | 49 + .../src/com/cloud/vm/dao/VMInstanceDao.java | 5 + .../com/cloud/vm/dao/VMInstanceDaoImpl.java | 66 +- .../framework/jobs/dao/VmWorkJobDao.java | 35 + .../framework/jobs/dao/VmWorkJobDaoImpl.java | 125 + .../framework/jobs/impl/VmWorkJobVO.java | 101 + 12 files changed, 33030 insertions(+), 5 deletions(-) create mode 100644 api/.gitignore create mode 100644 api/src/com/cloud/agent/api/HostVmStateReportEntry.java create mode 100644 engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSync.java create mode 100644 engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java create mode 100644 framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDao.java create mode 100644 framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDaoImpl.java create mode 100644 framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/VmWorkJobVO.java diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 00000000000..68ffd37c166 --- /dev/null +++ b/api/.gitignore @@ -0,0 +1,32431 @@ +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target +/target diff --git a/api/src/com/cloud/agent/api/HostVmStateReportEntry.java b/api/src/com/cloud/agent/api/HostVmStateReportEntry.java new file mode 100644 index 00000000000..7bcb50f361a --- /dev/null +++ b/api/src/com/cloud/agent/api/HostVmStateReportEntry.java @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.agent.api; + +import com.cloud.vm.VirtualMachine; +import com.cloud.vm.VirtualMachine.PowerState; + +public class HostVmStateReportEntry { + VirtualMachine.PowerState state; + String host; + + public HostVmStateReportEntry() { + } + + public HostVmStateReportEntry(PowerState state, String host) { + this.state = state; + this.host = host; + } + + public PowerState getState() { + return state; + } + + public String getHost() { + return host; + } +} diff --git a/api/src/com/cloud/vm/VirtualMachine.java b/api/src/com/cloud/vm/VirtualMachine.java index 0a968bc415f..9a8d88330c7 100755 --- a/api/src/com/cloud/vm/VirtualMachine.java +++ b/api/src/com/cloud/vm/VirtualMachine.java @@ -33,6 +33,12 @@ import com.cloud.utils.fsm.StateObject; */ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, InternalIdentity, StateObject { + public enum PowerState { + PowerUnknown, + PowerOn, + PowerOff, + } + public enum State { Starting(true, "VM is being started. At this state, you should find host id filled which means it's being started on that host."), Running(false, "VM is running. host id has the host that it is running on."), @@ -111,6 +117,15 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I s_fsm.addTransition(State.Expunging, VirtualMachine.Event.ExpungeOperation, State.Expunging); s_fsm.addTransition(State.Error, VirtualMachine.Event.DestroyRequested, State.Expunging); s_fsm.addTransition(State.Error, VirtualMachine.Event.ExpungeOperation, State.Expunging); + + s_fsm.addTransition(State.Stopping, VirtualMachine.Event.FollowAgentPowerOnReport, State.Running); + s_fsm.addTransition(State.Stopped, VirtualMachine.Event.FollowAgentPowerOnReport, State.Running); + s_fsm.addTransition(State.Running, VirtualMachine.Event.FollowAgentPowerOnReport, State.Running); + s_fsm.addTransition(State.Migrating, VirtualMachine.Event.FollowAgentPowerOnReport, State.Running); + s_fsm.addTransition(State.Starting, VirtualMachine.Event.FollowAgentPowerOffReport, State.Stopped); + s_fsm.addTransition(State.Stopping, VirtualMachine.Event.FollowAgentPowerOffReport, State.Stopped); + s_fsm.addTransition(State.Running, VirtualMachine.Event.FollowAgentPowerOffReport, State.Stopped); + s_fsm.addTransition(State.Migrating, VirtualMachine.Event.FollowAgentPowerOffReport, State.Stopped); } public static boolean isVmStarted(State oldState, Event e, State newState) { @@ -179,6 +194,10 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, I AgentReportMigrated, RevertRequested, SnapshotRequested, + + // added for new VMSync logic + FollowAgentPowerOnReport, + FollowAgentPowerOffReport, }; public enum Type { diff --git a/engine/api/src/com/cloud/vm/VirtualMachineManager.java b/engine/api/src/com/cloud/vm/VirtualMachineManager.java index afac6f39012..cb6c62dd69d 100644 --- a/engine/api/src/com/cloud/vm/VirtualMachineManager.java +++ b/engine/api/src/com/cloud/vm/VirtualMachineManager.java @@ -46,7 +46,11 @@ import com.cloud.utils.fsm.NoTransitionException; * Manages allocating resources to vms. */ public interface VirtualMachineManager extends Manager { - + + public interface Topics { + public static final String VM_POWER_STATE = "vm.powerstate"; + } + /** * Allocates a new virtual machine instance in the CloudStack DB. This * orchestrates the creation of all virtual resources needed in CloudStack diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSync.java b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSync.java new file mode 100644 index 00000000000..7a23ddd81e9 --- /dev/null +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSync.java @@ -0,0 +1,32 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.vm; + +import java.util.Map; + +import com.cloud.agent.api.HostVmStateReportEntry; +import com.cloud.vm.VirtualMachine.PowerState; + +public interface VirtualMachinePowerStateSync { + + void resetHostSyncState(long hostId); + + void processHostVmStateReport(long hostId, Map report); + + // to adapt legacy ping report + void processHostVmStatePingReport(long hostId, Map report); +} diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java new file mode 100644 index 00000000000..9c47727ed51 --- /dev/null +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java @@ -0,0 +1,125 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.vm; + +import java.util.HashMap; +import java.util.Map; + +import javax.inject.Inject; + +import org.apache.log4j.Logger; + +import org.apache.cloudstack.framework.messagebus.MessageBus; +import org.apache.cloudstack.framework.messagebus.PublishScope; + +import com.cloud.agent.api.HostVmStateReportEntry; +import com.cloud.vm.VirtualMachine.PowerState; +import com.cloud.vm.dao.VMInstanceDao; + +public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStateSync { + private static final Logger s_logger = Logger.getLogger(VirtualMachinePowerStateSyncImpl.class); + + @Inject MessageBus _messageBus; + @Inject VMInstanceDao _instanceDao; + @Inject VirtualMachineManager _vmMgr; + + public VirtualMachinePowerStateSyncImpl() { + } + + @Override + public void resetHostSyncState(long hostId) { + s_logger.info("Reset VM power state sync for host: " + hostId); + _instanceDao.resetHostPowerStateTracking(hostId); + } + + @Override + public void processHostVmStateReport(long hostId, Map report) { + if(s_logger.isDebugEnabled()) + s_logger.debug("Process host VM state report from ping process. host: " + hostId); + + Map translatedInfo = convertToInfos(report); + processReport(hostId, translatedInfo); + } + + @Override + public void processHostVmStatePingReport(long hostId, Map report) { + if(s_logger.isDebugEnabled()) + s_logger.debug("Process host VM state report from ping process. host: " + hostId); + + Map translatedInfo = convertHostPingInfos(report); + processReport(hostId, translatedInfo); + } + + private void processReport(long hostId, Map translatedInfo) { + + for(Map.Entry entry : translatedInfo.entrySet()) { + + if(s_logger.isDebugEnabled()) + s_logger.debug("VM state report. host: " + hostId + ", vm id: " + entry.getKey() + ", power state: " + entry.getValue()); + + if(_instanceDao.updatePowerState(entry.getKey(), hostId, entry.getValue())) { + + if(s_logger.isDebugEnabled()) + s_logger.debug("VM state report is updated. host: " + hostId + ", vm id: " + entry.getKey() + ", power state: " + entry.getValue()); + + _messageBus.publish(null, VirtualMachineManager.Topics.VM_POWER_STATE, PublishScope.GLOBAL, entry.getKey()); + } + } + } + + private Map convertHostPingInfos(Map states) { + final HashMap map = new HashMap(); + if (states == null) { + return map; + } + + for (Map.Entry entry : states.entrySet()) { + VMInstanceVO vm = findVM(entry.getKey()); + if(vm != null) { + map.put(vm.getId(), entry.getValue()); + break; + } else { + s_logger.info("Unable to find matched VM in CloudStack DB. name: " + entry.getKey()); + } + } + + return map; + } + + private Map convertToInfos(Map states) { + final HashMap map = new HashMap(); + if (states == null) { + return map; + } + + for (Map.Entry entry : states.entrySet()) { + VMInstanceVO vm = findVM(entry.getKey()); + if(vm != null) { + map.put(vm.getId(), entry.getValue().getState()); + break; + } else { + s_logger.info("Unable to find matched VM in CloudStack DB. name: " + entry.getKey()); + } + } + + return map; + } + + private VMInstanceVO findVM(String vmName) { + return _instanceDao.findVMByInstanceName(vmName); + } +} diff --git a/engine/schema/src/com/cloud/vm/VMInstanceVO.java b/engine/schema/src/com/cloud/vm/VMInstanceVO.java index 8cf7fd0dd87..96f534a4aac 100644 --- a/engine/schema/src/com/cloud/vm/VMInstanceVO.java +++ b/engine/schema/src/com/cloud/vm/VMInstanceVO.java @@ -163,6 +163,23 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject, StateDao< List listStartingWithNoHostId(); + boolean updatePowerState(long instanceId, long powerHostId, VirtualMachine.PowerState powerState); + + void resetVmPowerStateTracking(long instanceId); + + void resetHostPowerStateTracking(long hostId); } diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java index 2c62376d642..e7f907e6545 100644 --- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java @@ -37,6 +37,7 @@ import com.cloud.host.HostVO; import com.cloud.host.dao.HostDao; import com.cloud.server.ResourceTag.ResourceObjectType; import com.cloud.tags.dao.ResourceTagDao; +import com.cloud.utils.DateUtil; import com.cloud.utils.Pair; import com.cloud.utils.db.Attribute; import com.cloud.utils.db.DB; @@ -63,7 +64,8 @@ import com.cloud.vm.VirtualMachine.Type; public class VMInstanceDaoImpl extends GenericDaoBase implements VMInstanceDao { public static final Logger s_logger = Logger.getLogger(VMInstanceDaoImpl.class); - + private static final int MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT = 3; + protected SearchBuilder VMClusterSearch; protected SearchBuilder LHVMClusterSearch; protected SearchBuilder IdStatesSearch; @@ -638,8 +640,6 @@ public class VMInstanceDaoImpl extends GenericDaoBase implem return listBy(sc); } - - @Override public List listDistinctHostNames(long networkId, VirtualMachine.Type... types) { SearchCriteria sc = DistinctHostNameSearch.create(); @@ -679,5 +679,63 @@ public class VMInstanceDaoImpl extends GenericDaoBase implem sc.setParameters("state", State.Starting); return listBy(sc); } - + + @Override + public boolean updatePowerState(long instanceId, long powerHostId, VirtualMachine.PowerState powerState) { + boolean needToUpdate = false; + TransactionLegacy txn = TransactionLegacy.currentTxn(); + txn.start(); + + VMInstanceVO instance = findById(instanceId); + if(instance != null) { + Long savedPowerHostId = instance.getPowerHostId(); + if(instance.getPowerState() != powerState || savedPowerHostId == null + || savedPowerHostId.longValue() != powerHostId) { + instance.setPowerState(powerState); + instance.setPowerHostId(powerHostId); + instance.setPowerStateUpdateCount(1); + instance.setPowerStateUpdateTime(DateUtil.currentGMTTime()); + needToUpdate = true; + update(instanceId, instance); + } else { + // to reduce DB updates, consecutive same state update for more than 3 times + if(instance.getPowerStateUpdateCount() < MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT) { + instance.setPowerStateUpdateCount(instance.getPowerStateUpdateCount() + 1); + instance.setPowerStateUpdateTime(DateUtil.currentGMTTime()); + needToUpdate = true; + update(instanceId, instance); + } + } + } + + txn.commit(); + return needToUpdate; + } + + @Override + public void resetVmPowerStateTracking(long instanceId) { + TransactionLegacy txn = TransactionLegacy.currentTxn(); + txn.start(); + VMInstanceVO instance = findById(instanceId); + if(instance != null) { + instance.setPowerStateUpdateCount(0); + instance.setPowerStateUpdateTime(DateUtil.currentGMTTime()); + update(instanceId, instance); + } + + txn.commit(); + } + + + @Override @DB + public void resetHostPowerStateTracking(long hostId) { + SearchCriteria sc = createSearchCriteria(); + sc.addAnd("powerHostId", SearchCriteria.Op.EQ, hostId); + + VMInstanceVO instance = this.createForUpdate(); + instance.setPowerStateUpdateCount(0); + instance.setPowerStateUpdateTime(DateUtil.currentGMTTime()); + + this.update(instance, sc); + } } diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDao.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDao.java new file mode 100644 index 00000000000..dfb063f21a6 --- /dev/null +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDao.java @@ -0,0 +1,35 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.framework.jobs.dao; + +import java.util.Date; +import java.util.List; + +import org.apache.cloudstack.framework.jobs.impl.VmWorkJobVO; +import org.apache.cloudstack.framework.jobs.impl.VmWorkJobVO.Step; + +import com.cloud.utils.db.GenericDao; +import com.cloud.vm.VirtualMachine; + +public interface VmWorkJobDao extends GenericDao { + VmWorkJobVO findPendingWorkJob(VirtualMachine.Type type, long instanceId); + List listPendingWorkJobs(VirtualMachine.Type type, long instanceId); + List listPendingWorkJobs(VirtualMachine.Type type, long instanceId, String jobCmd); + + void updateStep(long workJobId, Step step); + void expungeCompletedWorkJobs(Date cutDate); +} diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDaoImpl.java new file mode 100644 index 00000000000..77515a797fe --- /dev/null +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/VmWorkJobDaoImpl.java @@ -0,0 +1,125 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.framework.jobs.dao; + +import java.util.Date; +import java.util.List; + +import javax.annotation.PostConstruct; + +import org.apache.cloudstack.framework.jobs.impl.VmWorkJobVO; +import org.apache.cloudstack.framework.jobs.impl.VmWorkJobVO.Step; +import org.apache.cloudstack.jobs.JobInfo; + +import com.cloud.utils.DateUtil; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.SearchCriteria.Op; +import com.cloud.vm.VirtualMachine; + +public class VmWorkJobDaoImpl extends GenericDaoBase implements VmWorkJobDao { + + protected SearchBuilder PendingWorkJobSearch; + protected SearchBuilder PendingWorkJobByCommandSearch; + protected SearchBuilder ExpungeWorkJobSearch; + + public VmWorkJobDaoImpl() { + } + + @PostConstruct + public void init() { + PendingWorkJobSearch = createSearchBuilder(); + PendingWorkJobSearch.and("jobStatus", PendingWorkJobSearch.entity().getStatus(), Op.EQ); + PendingWorkJobSearch.and("vmType", PendingWorkJobSearch.entity().getVmType(), Op.EQ); + PendingWorkJobSearch.and("vmInstanceId", PendingWorkJobSearch.entity().getVmInstanceId(), Op.EQ); + PendingWorkJobSearch.and("step", PendingWorkJobSearch.entity().getStep(), Op.NEQ); + PendingWorkJobSearch.done(); + + PendingWorkJobByCommandSearch = createSearchBuilder(); + PendingWorkJobByCommandSearch.and("jobStatus", PendingWorkJobByCommandSearch.entity().getStatus(), Op.EQ); + PendingWorkJobByCommandSearch.and("vmType", PendingWorkJobByCommandSearch.entity().getVmType(), Op.EQ); + PendingWorkJobByCommandSearch.and("vmInstanceId", PendingWorkJobByCommandSearch.entity().getVmInstanceId(), Op.EQ); + PendingWorkJobByCommandSearch.and("step", PendingWorkJobByCommandSearch.entity().getStep(), Op.NEQ); + PendingWorkJobByCommandSearch.and("cmd", PendingWorkJobByCommandSearch.entity().getCmd(), Op.EQ); + PendingWorkJobByCommandSearch.done(); + + ExpungeWorkJobSearch = createSearchBuilder(); + ExpungeWorkJobSearch.and("lastUpdated", ExpungeWorkJobSearch.entity().getLastUpdated(), Op.LT); + ExpungeWorkJobSearch.and("jobStatus", ExpungeWorkJobSearch.entity().getStatus(), Op.NEQ); + ExpungeWorkJobSearch.done(); + } + + @Override + public VmWorkJobVO findPendingWorkJob(VirtualMachine.Type type, long instanceId) { + + SearchCriteria sc = PendingWorkJobSearch.create(); + sc.setParameters("jobStatus", JobInfo. Status.IN_PROGRESS); + sc.setParameters("vmType", type); + sc.setParameters("vmInstanceId", instanceId); + + Filter filter = new Filter(VmWorkJobVO.class, "created", true, null, null); + List result = this.listBy(sc, filter); + if(result != null && result.size() > 0) + return result.get(0); + + return null; + } + + @Override + public List listPendingWorkJobs(VirtualMachine.Type type, long instanceId) { + + SearchCriteria sc = PendingWorkJobSearch.create(); + sc.setParameters("jobStatus", JobInfo.Status.IN_PROGRESS); + sc.setParameters("vmType", type); + sc.setParameters("vmInstanceId", instanceId); + + Filter filter = new Filter(VmWorkJobVO.class, "created", true, null, null); + return this.listBy(sc, filter); + } + + @Override + public List listPendingWorkJobs(VirtualMachine.Type type, long instanceId, String jobCmd) { + + SearchCriteria sc = PendingWorkJobByCommandSearch.create(); + sc.setParameters("jobStatus", JobInfo.Status.IN_PROGRESS); + sc.setParameters("vmType", type); + sc.setParameters("vmInstanceId", instanceId); + sc.setParameters("cmd", jobCmd); + + Filter filter = new Filter(VmWorkJobVO.class, "created", true, null, null); + return this.listBy(sc, filter); + } + + @Override + public void updateStep(long workJobId, Step step) { + VmWorkJobVO jobVo = findById(workJobId); + jobVo.setStep(step); + jobVo.setLastUpdated(DateUtil.currentGMTTime()); + update(workJobId, jobVo); + } + + @Override + public void expungeCompletedWorkJobs(Date cutDate) { + SearchCriteria sc = ExpungeWorkJobSearch.create(); + sc.setParameters("lastUpdated",cutDate); + sc.setParameters("jobStatus", JobInfo.Status.IN_PROGRESS); + + expunge(sc); + } +} diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/VmWorkJobVO.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/VmWorkJobVO.java new file mode 100644 index 00000000000..860cc57a315 --- /dev/null +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/VmWorkJobVO.java @@ -0,0 +1,101 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.framework.jobs.impl; + +import javax.persistence.Column; +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.PrimaryKeyJoinColumn; +import javax.persistence.Table; + +import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO; + +import com.cloud.vm.VirtualMachine; + +@Entity +@Table(name="vm_work_job") +@DiscriminatorValue(value="VmWork") +@PrimaryKeyJoinColumn(name="id") +public class VmWorkJobVO extends AsyncJobVO { + + // These steps are rather arbitrary. What's recorded depends on the + // the operation being performed. + public enum Step { + Filed(false), + Prepare(false), + Starting(true), + Started(false), + Release(false), + Done(false), + Migrating(true), + Reconfiguring(false), + Error(false); + + boolean updateState; // Should the VM State be updated after this step? + private Step(boolean updateState) { + this.updateState = updateState; + } + + boolean updateState() { + return updateState; + } + } + + @Column(name="step") + Step step; + + @Column(name="vm_type") + @Enumerated(value=EnumType.STRING) + VirtualMachine.Type vmType; + + @Column(name="vm_instance_id") + long vmInstanceId; + + protected VmWorkJobVO() { + } + + public VmWorkJobVO(String related) { + step = Step.Filed; + setRelated(related); + } + + public Step getStep() { + return step; + } + + public void setStep(Step step) { + this.step = step; + } + + public VirtualMachine.Type getVmType() { + return vmType; + } + + public void setVmType(VirtualMachine.Type vmType) { + this.vmType = vmType; + } + + public long getVmInstanceId() { + return vmInstanceId; + } + + public void setVmInstanceId(long vmInstanceId) { + this.vmInstanceId = vmInstanceId; + } +} From 3c139ea84ba274d93d12652bfd365a533c7e1991 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Wed, 6 Nov 2013 10:54:30 +0100 Subject: [PATCH 023/108] Probably accidentally committed with commit 191dc80fa49d921a7a1b7cf5a2697c5c9e348851 --- api/.gitignore | 32431 ----------------------------------------------- 1 file changed, 32431 deletions(-) delete mode 100644 api/.gitignore diff --git a/api/.gitignore b/api/.gitignore deleted file mode 100644 index 68ffd37c166..00000000000 --- a/api/.gitignore +++ /dev/null @@ -1,32431 +0,0 @@ -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target -/target From 88170f9a79de55168d49a3c9ef60770d1d032a8b Mon Sep 17 00:00:00 2001 From: Jayapal Date: Wed, 6 Nov 2013 18:35:18 +0530 Subject: [PATCH 024/108] CLOUDSTACK-4736 Monitoring service kvm vmware resource changes --- .../VirtualRoutingResource.java | 6 ++ .../resource/LibvirtComputingResource.java | 24 +++++--- .../vmware/resource/VmwareResource.java | 61 ++++++++++--------- 3 files changed, 55 insertions(+), 36 deletions(-) diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java index 4c2ee505117..b124aa68f5f 100755 --- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java +++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java @@ -818,6 +818,12 @@ public class VirtualRoutingResource implements Manager { return new ConsoleProxyLoadAnswer(cmd, proxyVmId, proxyVmName, success, result); } + public String configureMonitor(final String routerIP, final String config) { + + String args= " -c " + config; + return routerProxy("monitor_service.sh", routerIP, args); + } + public String assignGuestNetwork(final String dev, final String routerIP, final String routerGIP, final String gateway, final String cidr, final String netmask, final String dns, final String domainName) { diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 9f75fa808b2..a6593982abd 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -56,6 +56,7 @@ import javax.ejb.Local; import javax.naming.ConfigurationException; import com.cloud.agent.api.CheckOnHostCommand; +import com.cloud.agent.api.routing.*; import org.apache.commons.io.FileUtils; import org.apache.log4j.Logger; import org.libvirt.Connect; @@ -157,14 +158,6 @@ import com.cloud.agent.api.check.CheckSshCommand; import com.cloud.agent.api.proxy.CheckConsoleProxyLoadCommand; import com.cloud.agent.api.proxy.ConsoleProxyLoadAnswer; import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand; -import com.cloud.agent.api.routing.IpAssocAnswer; -import com.cloud.agent.api.routing.IpAssocCommand; -import com.cloud.agent.api.routing.IpAssocVpcCommand; -import com.cloud.agent.api.routing.NetworkElementCommand; -import com.cloud.agent.api.routing.SetNetworkACLAnswer; -import com.cloud.agent.api.routing.SetNetworkACLCommand; -import com.cloud.agent.api.routing.SetSourceNatAnswer; -import com.cloud.agent.api.routing.SetSourceNatCommand; import com.cloud.agent.api.storage.CopyVolumeAnswer; import com.cloud.agent.api.storage.CopyVolumeCommand; import com.cloud.agent.api.storage.CreateAnswer; @@ -1298,6 +1291,8 @@ ServerResource { return storageHandler.handleStorageCommands((StorageSubSystemCommand)cmd); } else if (cmd instanceof PvlanSetupCommand) { return execute((PvlanSetupCommand) cmd); + } else if (cmd instanceof SetMonitorServiceCommand) { + return execute((SetMonitorServiceCommand) cmd); } else if (cmd instanceof CheckOnHostCommand) { return execute((CheckOnHostCommand)cmd); } else { @@ -1875,6 +1870,19 @@ ServerResource { } } + private Answer execute(SetMonitorServiceCommand cmd) { + + String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + String config = cmd.getConfiguration(); + + String result = _virtRouterResource.configureMonitor(routerIp, config); + + if (result != null) { + return new Answer(cmd, false, "SetMonitorServiceCommand failed"); + } + return new Answer(cmd); + + } private SetNetworkACLAnswer execute(SetNetworkACLCommand cmd) { String[] results = new String[cmd.getRules().length]; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 317af166b17..03af0da51b1 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -45,6 +45,7 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.agent.api.routing.*; import org.apache.log4j.Logger; import org.apache.log4j.NDC; @@ -213,34 +214,6 @@ import com.cloud.agent.api.ValidateSnapshotCommand; import com.cloud.agent.api.VmStatsEntry; import com.cloud.agent.api.check.CheckSshAnswer; import com.cloud.agent.api.check.CheckSshCommand; -import com.cloud.agent.api.routing.CreateIpAliasCommand; -import com.cloud.agent.api.routing.DeleteIpAliasCommand; -import com.cloud.agent.api.routing.DhcpEntryCommand; -import com.cloud.agent.api.routing.DnsMasqConfigCommand; -import com.cloud.agent.api.routing.IpAliasTO; -import com.cloud.agent.api.routing.IpAssocAnswer; -import com.cloud.agent.api.routing.IpAssocCommand; -import com.cloud.agent.api.routing.IpAssocVpcCommand; -import com.cloud.agent.api.routing.LoadBalancerConfigCommand; -import com.cloud.agent.api.routing.NetworkElementCommand; -import com.cloud.agent.api.routing.RemoteAccessVpnCfgCommand; -import com.cloud.agent.api.routing.SavePasswordCommand; -import com.cloud.agent.api.routing.SetFirewallRulesAnswer; -import com.cloud.agent.api.routing.SetFirewallRulesCommand; -import com.cloud.agent.api.routing.SetNetworkACLAnswer; -import com.cloud.agent.api.routing.SetNetworkACLCommand; -import com.cloud.agent.api.routing.SetPortForwardingRulesAnswer; -import com.cloud.agent.api.routing.SetPortForwardingRulesCommand; -import com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand; -import com.cloud.agent.api.routing.SetSourceNatAnswer; -import com.cloud.agent.api.routing.SetSourceNatCommand; -import com.cloud.agent.api.routing.SetStaticNatRulesAnswer; -import com.cloud.agent.api.routing.SetStaticNatRulesCommand; -import com.cloud.agent.api.routing.SetStaticRouteAnswer; -import com.cloud.agent.api.routing.SetStaticRouteCommand; -import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand; -import com.cloud.agent.api.routing.VmDataCommand; -import com.cloud.agent.api.routing.VpnUsersCfgCommand; import com.cloud.agent.api.storage.CopyVolumeAnswer; import com.cloud.agent.api.storage.CopyVolumeCommand; import com.cloud.agent.api.storage.CreateAnswer; @@ -571,6 +544,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa answer = execute((SetStaticRouteCommand) cmd); } else if (clz == UnregisterNicCommand.class) { answer = execute((UnregisterNicCommand) cmd); + } else if (clz == SetMonitorServiceCommand.class) { + answer = execute((SetMonitorServiceCommand) cmd); } else { answer = Answer.createUnsupportedCommandAnswer(cmd); } @@ -791,6 +766,36 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa return new NetworkUsageAnswer(cmd, "success", 0L, 0L); } + protected Answer execute(SetMonitorServiceCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource SetMonitorServiceCommand: " + _gson.toJson(cmd)); + } + + String controlIp = getRouterSshControlIp(cmd); + String config = cmd.getConfiguration(); + + String args = ""; + + args += " -c " + config; + + try { + VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + Pair result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, "/opt/cloud/bin/monitor_service.sh " + args); + + if (!result.first()) { + String msg= "monitor_service.sh failed on domain router " + controlIp + " failed " + result.second(); + s_logger.error(msg); + return new Answer(cmd, false, msg); + } + + return new Answer(cmd); + + } catch (Throwable e) { + s_logger.error("Unexpected exception: " + e.toString(), e); + return new Answer(cmd, false, "SetMonitorServiceCommand failed due to " + VmwareHelper.getExceptionMessage(e)); + } + } + protected Answer execute(SetPortForwardingRulesCommand cmd) { if (s_logger.isInfoEnabled()) { s_logger.info("Executing resource SetPortForwardingRulesCommand: " + _gson.toJson(cmd)); From f03dcdab19afbb358467e1e42dfb3a225ef6b446 Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Wed, 6 Nov 2013 19:06:45 +0530 Subject: [PATCH 025/108] [CLOUDSTACK-5051] Revert "CLOUDSTACK-3715. Socket timeout error is observed in VMware setup if a VMware task (RelocateVM_Task, CloneVM_Task etc.) takes more than 10 minutes. Making this value configurable to allow admins to modify the timeout if required. It defaults to the current value i.e. 10 minutes." This reverts commit 3a9150017339fa9447e7e30b854ccd3351695dcc. Conflicts: plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java --- .../vmware/manager/VmwareManager.java | 2 -- .../vmware/manager/VmwareManagerImpl.java | 9 --------- .../vmware/resource/VmwareContextFactory.java | 1 - .../VmwareSecondaryStorageContextFactory.java | 17 +---------------- server/src/com/cloud/configuration/Config.java | 1 - .../hypervisor/vmware/util/VmwareClient.java | 10 ++-------- .../vmware/mo/TestVmwareContextFactory.java | 1 - 7 files changed, 3 insertions(+), 38 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java index bc0c9a48420..6c675990bb3 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java @@ -69,7 +69,5 @@ public interface VmwareManager { public String getRootDiskController(); - public int getVcenterSessionTimeout(); - boolean isLegacyZone(long dcId); } diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 183d6761a9b..9af0aa002d8 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -177,7 +177,6 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw int _additionalPortRangeStart; int _additionalPortRangeSize; int _routerExtraPublicNics = 2; - int _vCenterSessionTimeout = 600000; // Timeout in milliseconds String _reserveCpu = "false"; @@ -280,9 +279,6 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw _routerExtraPublicNics = NumbersUtil.parseInt(_configDao.getValue(Config.RouterExtraPublicNics.key()), 2); - _vCenterSessionTimeout = NumbersUtil.parseInt(_configDao.getValue(Config.VmwareVcenterSessionTimeout.key()), 600) * 1000; - s_logger.info("VmwareManagerImpl config - vmware.vcenter.session.timeout: " + _vCenterSessionTimeout); - _reserveCpu = _configDao.getValue(Config.VmwareReserveCpu.key()); if(_reserveCpu == null || _reserveCpu.isEmpty()) { _reserveCpu = "false"; @@ -989,11 +985,6 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw return _rootDiskController; } - @Override - public int getVcenterSessionTimeout() { - return _vCenterSessionTimeout; - } - @Override public List> getCommands() { List> cmdList = new ArrayList>(); diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java index f108fda078a..3079998198c 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java @@ -63,7 +63,6 @@ public class VmwareContextFactory { s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword)); VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++); - vimClient.setVcenterSessionTimeout(s_vmwareMgr.getVcenterSessionTimeout()); vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword); VmwareContext context = new VmwareContext(vimClient, vCenterAddress); diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java index 254e89b58f8..ac8b294b76e 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java @@ -16,18 +16,13 @@ // under the License. package com.cloud.storage.resource; -import javax.annotation.PostConstruct; -import javax.inject.Inject; - import org.apache.log4j.Logger; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; -import com.cloud.configuration.Config; import com.cloud.hypervisor.vmware.util.VmwareClient; import com.cloud.hypervisor.vmware.util.VmwareContext; import com.cloud.hypervisor.vmware.util.VmwareContextPool; -import com.cloud.utils.NumbersUtil; public class VmwareSecondaryStorageContextFactory { private static final Logger s_logger = Logger.getLogger(VmwareSecondaryStorageContextFactory.class); @@ -35,30 +30,20 @@ public class VmwareSecondaryStorageContextFactory { private static volatile int s_seq = 1; private static VmwareContextPool s_pool; - private static ConfigurationDao s_configDao; - - @Inject ConfigurationDao _configDao; public static void initFactoryEnvironment() { System.setProperty("axis.socketSecureFactory", "org.apache.axis.components.net.SunFakeTrustSocketFactory"); s_pool = new VmwareContextPool(); } - @PostConstruct - void init() { - s_configDao = _configDao; - } - public static VmwareContext create(String vCenterAddress, String vCenterUserName, String vCenterPassword) throws Exception { assert(vCenterAddress != null); assert(vCenterUserName != null); assert(vCenterPassword != null); String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService"; - int vCenterSessionTimeout = NumbersUtil.parseInt(s_configDao.getValue(Config.VmwareVcenterSessionTimeout.key()), 600) * 1000; VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++); - vimClient.setVcenterSessionTimeout(vCenterSessionTimeout); - vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword); + vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword); VmwareContext context = new VmwareContext(vimClient, vCenterAddress); assert(context != null); diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index e4413251400..e78757639ee 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -265,7 +265,6 @@ public enum Config { VmwareRecycleHungWorker("Advanced", ManagementServer.class, Boolean.class, "vmware.recycle.hung.wokervm", "false", "Specify whether or not to recycle hung worker VMs", null), VmwareHungWorkerTimeout("Advanced", ManagementServer.class, Long.class, "vmware.hung.wokervm.timeout", "7200", "Worker VM timeout in seconds", null), VmwareEnableNestedVirtualization("Advanced", ManagementServer.class, Boolean.class, "vmware.nested.virtualization", "false", "When set to true this will enable nested virtualization when this is supported by the hypervisor", null), - VmwareVcenterSessionTimeout("Advanced", ManagementServer.class, Long.class, "vmware.vcenter.session.timeout", "600", "VMware client timeout in seconds", null), // Midonet MidoNetAPIServerAddress("Network", ManagementServer.class, String.class, "midonet.apiserver.address", "http://localhost:8081", "Specify the address at which the Midonet API server can be contacted (if using Midonet)", null), diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java index a0122d29e22..d1adbc2dc30 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java @@ -109,7 +109,6 @@ public class VmwareClient { private VimPortType vimPort; private String serviceCookie; private final String SVC_INST_NAME = "ServiceInstance"; - private int vCenterSessionTimeout = 600000; // Timeout in milliseconds private boolean isConnected = false; @@ -133,8 +132,8 @@ public class VmwareClient { ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true); - ctxt.put("com.sun.xml.internal.ws.request.timeout", vCenterSessionTimeout); - ctxt.put("com.sun.xml.internal.ws.connect.timeout", vCenterSessionTimeout); + ctxt.put("com.sun.xml.internal.ws.request.timeout", 600000); + ctxt.put("com.sun.xml.internal.ws.connect.timeout", 600000); ServiceContent serviceContent = vimPort.retrieveServiceContent(SVC_INST_REF); @@ -617,9 +616,4 @@ public class VmwareClient { } return propmor; } - - public void setVcenterSessionTimeout(int vCenterSessionTimeout) { - this.vCenterSessionTimeout = vCenterSessionTimeout; - } - } diff --git a/vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java b/vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java index c8363d6e78d..c0bd5620d94 100644 --- a/vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java +++ b/vmware-base/test/com/cloud/hypervisor/vmware/mo/TestVmwareContextFactory.java @@ -48,7 +48,6 @@ public class TestVmwareContextFactory { s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword)); VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++); - vimClient.setVcenterSessionTimeout(600000); // Timeout in milliseconds vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword); VmwareContext context = new VmwareContext(vimClient, vCenterAddress); From 56070c644b026003b155bdb69b356a286e122a46 Mon Sep 17 00:00:00 2001 From: wilderrodrigues Date: Wed, 6 Nov 2013 14:18:31 +0100 Subject: [PATCH 026/108] Fix for 1125389 RV: Bad use of return value - make sure the replace call is done after replaceAll and the correct value is returned Signed-off-by: Hugo Trippaers --- .../network/contrail/management/ContrailManagerImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java index ae9bba9b7e5..4eaafca17cf 100644 --- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java +++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java @@ -239,8 +239,7 @@ public class ContrailManagerImpl extends ManagerBase implements ContrailManager @Override public String getPhysicalNetworkName(PhysicalNetworkVO phys_net) { String physname = phys_net.getName(); - physname = physname.replaceAll("\\s", ""); - physname.replace("_", ""); + physname = physname.replaceAll("\\s", "").replace("_", ""); return physname; } From 68ce3f56ac9048071892ce47a1da984768fbde55 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Wed, 6 Nov 2013 09:43:57 -0700 Subject: [PATCH 027/108] Missed a null check --- utils/src/com/cloud/utils/db/DbProperties.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/src/com/cloud/utils/db/DbProperties.java b/utils/src/com/cloud/utils/db/DbProperties.java index a5ad383118d..55df23da08e 100644 --- a/utils/src/com/cloud/utils/db/DbProperties.java +++ b/utils/src/com/cloud/utils/db/DbProperties.java @@ -65,12 +65,15 @@ public class DbProperties { if ( is == null ) { is = PropertiesUtil.openStreamFromURL("db.properties"); } + if ( is == null ) { System.err.println("Failed to find db.properties"); log.error("Failed to find db.properties"); } - dbProps.load(is); + if ( is != null ) { + dbProps.load(is); + } EncryptionSecretKeyChecker checker = new EncryptionSecretKeyChecker(); checker.check(dbProps); From 0ec6b9ac9947e82ced948445bf6c14c0966e731b Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Wed, 6 Nov 2013 09:50:45 -0700 Subject: [PATCH 028/108] Ignore all logs for rat, not just the ones at root Git ignores log files, so basically they shouldn't checked in. This configures rat to ignore log files also. Specifically the juniper-contrail code creates a log file during testing. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ea62c28e0f..2cee0840696 100644 --- a/pom.xml +++ b/pom.xml @@ -535,7 +535,7 @@ CHANGES INSTALL.md .idea/ - *.log + **/*.log **/*.patch **/.classpath **/.project From 40a78393235f44bb0f96b8055fc11139c8866915 Mon Sep 17 00:00:00 2001 From: Sateesh Chodapuneedi Date: Wed, 6 Nov 2013 17:37:22 +0530 Subject: [PATCH 029/108] CLOUDSTACK-5061 - Cloudstack doesn't consider storage overprovisioning factor when using thin Provisioning over VMWare VMFS datastores Fix is use the storage overprovisioning factor (global configuration parameter "storage.overprovisioning.factor") to calculate total provisioning capacity for storage space allocation over VMFS based storage pools as well. There are two level of thin provisioning provided in VMware, storage level and file-level (VMDK) thin provisioning. in CloudStack, all volumes are provisioned with thin VMDK format, so at hypervisor level, we ALWAYS do thin provisioning. If storage vendor has the ability to provide storage level thin provisioning in addition to VMDK thin provisioning, it is also allowed since it is transparent to Cloudstack. Signed-off-by: Sateesh Chodapuneedi --- .../com/cloud/storage/StorageManagerImpl.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index a3016396394..e42d87100a6 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -875,19 +875,10 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C List capacities = _capacityDao.search(capacitySC, null); long totalOverProvCapacity; - if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem) { + if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem || storagePool.getPoolType() == StoragePoolType.VMFS) { BigDecimal overProvFactor = getStorageOverProvisioningFactor(storagePool.getDataCenterId()); - totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(storagePool.getCapacityBytes())).longValue();// All - // this - // for - // the - // inaccuracy - // of - // floats - // for - // big - // number - // multiplication. + totalOverProvCapacity = overProvFactor.multiply(new BigDecimal(storagePool.getCapacityBytes())).longValue(); + // All this is for the inaccuracy of floats for big number multiplication. } else { totalOverProvCapacity = storagePool.getCapacityBytes(); } @@ -1596,7 +1587,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C } long totalOverProvCapacity; - if (pool.getPoolType() == StoragePoolType.NetworkFilesystem) { + if (pool.getPoolType() == StoragePoolType.NetworkFilesystem || pool.getPoolType() == StoragePoolType.VMFS) { totalOverProvCapacity = getStorageOverProvisioningFactor(pool.getDataCenterId()).multiply(new BigDecimal(pool.getCapacityBytes())) .longValue(); } else { From 8f8ad3f38ef3c9ee840ba5f86c92d722d2bb5393 Mon Sep 17 00:00:00 2001 From: Will Stevens Date: Tue, 5 Nov 2013 22:24:23 -0500 Subject: [PATCH 030/108] Squashed commit of the Palo Alto Networks firewall integration plugin. This patch adds a network plugin to support Palo Alto Networks firewall (their appliance and their VM series firewall). More information in the FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Palo+Alto+Firewall+Integration Features supported are: - List/Add/Delete Palo Alto service provider - List/Add/Delete Palo Alto network service offering - List/Add/Delete Palo Alto network with above service offering - Add instance to the new network (creates the public IP and private gateway/cidr on the PA as well as the source nat rule) - List/Add/Delete Ingress Firewall rule - List/Add/Delete Egress Firewall rule - List/Add/Delete Port Forwarding rule - List/Add/Delete Static Nat rule - Supports Palo Alto Networks 'Log Forwarding' profile globally per device (additional docs to come) - Supports Palo Alto Networks 'Security Profile Groups' functionality globally per device (additional docs to come) Knowns limitations: - Only supports one public IP range in CloudStack. - Currently not verifying SSL certificates when creating a connection between CloudStack and the Palo Alto Networks firewall. - Currently not tracking usage on Public IPs. Signed-off-by: Sheng Yang --- api/src/com/cloud/network/Network.java | 1 + .../admin/network/AddNetworkDeviceCmd.java | 3 +- .../admin/network/ListNetworkDeviceCmd.java | 2 +- .../network/ExternalNetworkDeviceManager.java | 1 + .../classes/resources/messages.properties | 7 + client/pom.xml | 5 + client/tomcatconf/commands.properties.in | 11 + plugins/network-elements/palo-alto/pom.xml | 29 + .../cloudstack/paloalto/module.properties | 18 + .../paloalto/spring-paloalto-context.xml | 33 + .../api/commands/AddExternalFirewallCmd.java | 112 + .../api/commands/AddPaloAltoFirewallCmd.java | 135 ++ .../ConfigurePaloAltoFirewallCmd.java | 114 + .../commands/DeleteExternalFirewallCmd.java | 88 + .../commands/DeletePaloAltoFirewallCmd.java | 105 + .../commands/ListExternalFirewallsCmd.java | 88 + .../ListPaloAltoFirewallNetworksCmd.java | 95 + .../commands/ListPaloAltoFirewallsCmd.java | 103 + .../response/PaloAltoFirewallResponse.java | 142 ++ .../PaloAltoExternalFirewallElement.java | 538 +++++ .../PaloAltoFirewallElementService.java | 88 + .../network/resource/PaloAltoResource.java | 2030 +++++++++++++++++ .../network/utils/HttpClientWrapper.java | 69 + .../resource/MockablePaloAltoResource.java | 460 ++++ .../resource/PaloAltoResourceTest.java | 507 ++++ plugins/pom.xml | 1 + .../src/com/cloud/api/ApiResponseHelper.java | 2 +- .../ConfigurationManagerImpl.java | 4 + ui/dictionary.jsp | 7 + ui/scripts/docs.js | 69 + ui/scripts/system.js | 572 +++++ 31 files changed, 5436 insertions(+), 3 deletions(-) create mode 100644 plugins/network-elements/palo-alto/pom.xml create mode 100644 plugins/network-elements/palo-alto/resources/META-INF/cloudstack/paloalto/module.properties create mode 100644 plugins/network-elements/palo-alto/resources/META-INF/cloudstack/paloalto/spring-paloalto-context.xml create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/commands/AddExternalFirewallCmd.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/commands/AddPaloAltoFirewallCmd.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/commands/ConfigurePaloAltoFirewallCmd.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/commands/DeletePaloAltoFirewallCmd.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListExternalFirewallsCmd.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListPaloAltoFirewallNetworksCmd.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListPaloAltoFirewallsCmd.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/api/response/PaloAltoFirewallResponse.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoFirewallElementService.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/network/resource/PaloAltoResource.java create mode 100644 plugins/network-elements/palo-alto/src/com/cloud/network/utils/HttpClientWrapper.java create mode 100755 plugins/network-elements/palo-alto/test/com/cloud/network/resource/MockablePaloAltoResource.java create mode 100755 plugins/network-elements/palo-alto/test/com/cloud/network/resource/PaloAltoResourceTest.java diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java index bda3326cb51..318ac192252 100644 --- a/api/src/com/cloud/network/Network.java +++ b/api/src/com/cloud/network/Network.java @@ -116,6 +116,7 @@ public interface Network extends ControlledEntity, StateObject, I public static final Provider VirtualRouter = new Provider("VirtualRouter", false); public static final Provider JuniperContrail = new Provider("JuniperContrail", false); public static final Provider JuniperSRX = new Provider("JuniperSRX", true); + public static final Provider PaloAlto = new Provider("PaloAlto", true); public static final Provider F5BigIp = new Provider("F5BigIp", true); public static final Provider Netscaler = new Provider("Netscaler", true); public static final Provider ExternalDhcpServer = new Provider("ExternalDhcpServer", true); diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java index 4983255389d..a7906f41522 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java @@ -47,8 +47,9 @@ public class AddNetworkDeviceCmd extends BaseCmd { // ////////////// API parameters ///////////////////// // /////////////////////////////////////////////////// + @Inject ExternalNetworkDeviceManager nwDeviceMgr; - @Parameter(name = ApiConstants.NETWORK_DEVICE_TYPE, type = CommandType.STRING, description = "Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall") + @Parameter(name = ApiConstants.NETWORK_DEVICE_TYPE, type = CommandType.STRING, description = "Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall, PaloAltoFirewall") private String type; @Parameter(name = ApiConstants.NETWORK_DEVICE_PARAMETER_LIST, type = CommandType.MAP, description = "parameters for network device") diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java index 0b7836de3a8..5278ba9efd7 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java @@ -51,7 +51,7 @@ public class ListNetworkDeviceCmd extends BaseListCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name = ApiConstants.NETWORK_DEVICE_TYPE, type = CommandType.STRING, description = "Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall") + @Parameter(name = ApiConstants.NETWORK_DEVICE_TYPE, type = CommandType.STRING, description = "Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall, PaloAltoFirewall") private String type; @Parameter(name = ApiConstants.NETWORK_DEVICE_PARAMETER_LIST, type = CommandType.MAP, description = "parameters for network device") diff --git a/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java b/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java index 29ce2e3971d..32f13f80f22 100644 --- a/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java +++ b/api/src/org/apache/cloudstack/network/ExternalNetworkDeviceManager.java @@ -42,6 +42,7 @@ public interface ExternalNetworkDeviceManager extends Manager { public static final NetworkDevice NetscalerSDXLoadBalancer = new NetworkDevice("NetscalerSDXLoadBalancer", Network.Provider.Netscaler.getName()); public static final NetworkDevice F5BigIpLoadBalancer = new NetworkDevice("F5BigIpLoadBalancer", Network.Provider.F5BigIp.getName()); public static final NetworkDevice JuniperSRXFirewall = new NetworkDevice("JuniperSRXFirewall", Network.Provider.JuniperSRX.getName()); + public static final NetworkDevice PaloAltoFirewall = new NetworkDevice("PaloAltoFirewall", Network.Provider.PaloAlto.getName()); public static final NetworkDevice NiciraNvp = new NetworkDevice("NiciraNvp", Network.Provider.NiciraNvp.getName()); public static final NetworkDevice CiscoVnmc = new NetworkDevice("CiscoVnmc", Network.Provider.CiscoVnmc.getName()); diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index d548527267b..e450c29a0c5 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -304,6 +304,7 @@ label.add.new.F5=Add new F5 label.add.new.gateway=Add new gateway label.add.new.NetScaler=Add new NetScaler label.add.new.SRX=Add new SRX +label.add.new.PA=Add new Palo Alto label.add.new.tier=Add new tier label.add.NiciraNvp.device=Add Nvp Controller label.add.physical.network=Add physical network @@ -318,6 +319,7 @@ label.add.secondary.storage=Add Secondary Storage label.add.security.group=Add Security Group label.add.service.offering=Add Service Offering label.add.SRX.device=Add SRX device +label.add.PA.device=Add Palo Alto device label.add.static.nat.rule=Add static NAT rule label.add.static.route=Add static route label.add.system.service.offering=Add System Service Offering @@ -479,6 +481,7 @@ label.delete.NetScaler=Delete NetScaler label.delete.NiciraNvp=Remove Nvp Controller label.delete.project=Delete project label.delete.SRX=Delete SRX +label.delete.PA=Delete Palo Alto label.delete.VPN.connection=delete VPN connection label.delete.VPN.customer.gateway=delete VPN Customer Gateway label.delete.VPN.gateway=delete VPN Gateway @@ -876,6 +879,8 @@ label.os.type=OS Type label.owned.public.ips=Owned Public IP Addresses label.owner.account=Owner Account label.owner.domain=Owner Domain +label.PA.log.profile=Palo Alto Log Profile +label.PA.threat.profile=Palo Alto Threat Profile label.parent.domain=Parent Domain label.password.enabled=Password Enabled label.password=Password @@ -1048,6 +1053,7 @@ label.specify.vlan=Specify VLAN label.specify.vxlan=Specify VXLAN label.SR.name = SR Name-Label label.srx=SRX +label.PA=Palo Alto label.start.IP=Start IP label.start.port=Start Port label.start.reserved.system.IP=Start Reserved system IP @@ -1366,6 +1372,7 @@ message.confirm.action.force.reconnect=Please confirm that you want to force rec message.confirm.delete.F5=Please confirm that you would like to delete F5 message.confirm.delete.NetScaler=Please confirm that you would like to delete NetScaler message.confirm.delete.SRX=Please confirm that you would like to delete SRX +message.confirm.delete.PA=Please confirm that you would like to delete Palo Alto message.confirm.destroy.router=Please confirm that you would like to destroy this router message.confirm.disable.provider=Please confirm that you would like to disable this provider message.confirm.enable.provider=Please confirm that you would like to enable this provider diff --git a/client/pom.xml b/client/pom.xml index 54cb667514b..a15a409a33c 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -90,6 +90,11 @@ cloud-plugin-network-contrail ${project.version} + + org.apache.cloudstack + cloud-plugin-network-palo-alto + ${project.version} + org.apache.cloudstack cloud-plugin-network-ovs diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 8cbe972cb81..087d8b9490b 100644 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -533,6 +533,17 @@ configureSrxFirewall=1 listSrxFirewalls=1 listSrxFirewallNetworks=1 +#### Palo Alto firewall commands +addExternalFirewall=1 +deleteExternalFirewall=1 +listExternalFirewalls=1 + +addPaloAltoFirewall=1 +deletePaloAltoFirewall=1 +configurePaloAltoFirewall=1 +listPaloAltoFirewalls=1 +listPaloAltoFirewallNetworks=1 + ####Netapp integration commands createVolumeOnFiler=15 destroyVolumeOnFiler=15 diff --git a/plugins/network-elements/palo-alto/pom.xml b/plugins/network-elements/palo-alto/pom.xml new file mode 100644 index 00000000000..50b4c134f60 --- /dev/null +++ b/plugins/network-elements/palo-alto/pom.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + cloud-plugin-network-palo-alto + Apache CloudStack Plugin - Palo Alto + + org.apache.cloudstack + cloudstack-plugins + 4.3.0-SNAPSHOT + ../../pom.xml + + diff --git a/plugins/network-elements/palo-alto/resources/META-INF/cloudstack/paloalto/module.properties b/plugins/network-elements/palo-alto/resources/META-INF/cloudstack/paloalto/module.properties new file mode 100644 index 00000000000..960fdba8352 --- /dev/null +++ b/plugins/network-elements/palo-alto/resources/META-INF/cloudstack/paloalto/module.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +name=paloalto +parent=network \ No newline at end of file diff --git a/plugins/network-elements/palo-alto/resources/META-INF/cloudstack/paloalto/spring-paloalto-context.xml b/plugins/network-elements/palo-alto/resources/META-INF/cloudstack/paloalto/spring-paloalto-context.xml new file mode 100644 index 00000000000..251f444b8a0 --- /dev/null +++ b/plugins/network-elements/palo-alto/resources/META-INF/cloudstack/paloalto/spring-paloalto-context.xml @@ -0,0 +1,33 @@ + + + + + + + \ No newline at end of file diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/commands/AddExternalFirewallCmd.java b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/AddExternalFirewallCmd.java new file mode 100644 index 00000000000..84ee869866a --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/AddExternalFirewallCmd.java @@ -0,0 +1,112 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.commands; + +import javax.inject.Inject; + +import org.apache.cloudstack.api.response.ZoneResponse; +import org.apache.log4j.Logger; + +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.host.Host; +import com.cloud.network.element.PaloAltoFirewallElementService; +import org.apache.cloudstack.api.response.ExternalFirewallResponse; +import com.cloud.user.Account; +import com.cloud.utils.exception.CloudRuntimeException; + +@APICommand(name = "addExternalFirewall", description="Adds an external firewall appliance", responseObject = ExternalFirewallResponse.class) +public class AddExternalFirewallCmd extends BaseCmd { + public static final Logger s_logger = Logger.getLogger(AddExternalFirewallCmd.class.getName()); + private static final String s_name = "addexternalfirewallresponse"; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class, + required = true, description="Zone in which to add the external firewall appliance.") + private Long zoneId; + + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required = true, description="URL of the external firewall appliance.") + private String url; + + @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required = true, description="Username of the external firewall appliance.") + private String username; + + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required = true, description="Password of the external firewall appliance.") + private String password; + + /////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getZoneId() { + return zoneId; + } + + public String getUrl() { + return url; + } + + public String getUsername() { + return username; + } + + public String getPassword() { + return password; + } + + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Inject PaloAltoFirewallElementService _paElementService; + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return Account.ACCOUNT_ID_SYSTEM; + } + + @SuppressWarnings("deprecation") + @Override + public void execute(){ + try { + Host externalFirewall = _paElementService.addExternalFirewall(this); + ExternalFirewallResponse response = _paElementService.createExternalFirewallResponse(externalFirewall); + response.setObjectName("externalfirewall"); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } catch (InvalidParameterValueException ipve) { + throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ipve.getMessage()); + } catch (CloudRuntimeException cre) { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, cre.getMessage()); + } + } +} + diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/commands/AddPaloAltoFirewallCmd.java b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/AddPaloAltoFirewallCmd.java new file mode 100644 index 00000000000..faf28e2cf26 --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/AddPaloAltoFirewallCmd.java @@ -0,0 +1,135 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.commands; + +import javax.inject.Inject; + +import org.apache.cloudstack.api.response.PhysicalNetworkResponse; +import org.apache.log4j.Logger; + +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncCmd; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import com.cloud.api.response.PaloAltoFirewallResponse; +import com.cloud.event.EventTypes; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.network.dao.ExternalFirewallDeviceVO; +import com.cloud.network.element.PaloAltoFirewallElementService; +import org.apache.cloudstack.context.CallContext; +import com.cloud.utils.exception.CloudRuntimeException; + +@APICommand(name = "addPaloAltoFirewall", responseObject=PaloAltoFirewallResponse.class, description="Adds a Palo Alto firewall device") +public class AddPaloAltoFirewallCmd extends BaseAsyncCmd { + public static final Logger s_logger = Logger.getLogger(AddPaloAltoFirewallCmd.class.getName()); + private static final String s_name = "addpaloaltofirewallresponse"; + @Inject PaloAltoFirewallElementService _paFwService; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class, + required=true, description="the Physical Network ID") + private Long physicalNetworkId; + + @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required = true, description="URL of the Palo Alto appliance.") + private String url; + + @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required = true, description="Credentials to reach Palo Alto firewall device") + private String username; + + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required = true, description="Credentials to reach Palo Alto firewall device") + private String password; + + @Parameter(name = ApiConstants.NETWORK_DEVICE_TYPE, type = CommandType.STRING, required = true, description = "supports only PaloAltoFirewall") + private String deviceType; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getPhysicalNetworkId() { + return physicalNetworkId; + } + + public String getUrl() { + return url; + } + + public String getUsername() { + return username; + } + + public String getPassword() { + return password; + } + + public String getDeviceType() { + return deviceType; + } + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { + try { + ExternalFirewallDeviceVO fwDeviceVO = _paFwService.addPaloAltoFirewall(this); + if (fwDeviceVO != null) { + PaloAltoFirewallResponse response = _paFwService.createPaloAltoFirewallResponse(fwDeviceVO); + response.setObjectName("pafirewall"); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add Palo Alto firewall due to internal error."); + } + } catch (InvalidParameterValueException invalidParamExcp) { + throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); + } catch (CloudRuntimeException runtimeExcp) { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); + } + } + + @Override + public String getEventDescription() { + return "Adding a Palo Alto firewall device"; + } + + @Override + public String getEventType() { + return EventTypes.EVENT_EXTERNAL_FIREWALL_DEVICE_ADD; + } + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return CallContext.current().getCallingAccount().getId(); + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ConfigurePaloAltoFirewallCmd.java b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ConfigurePaloAltoFirewallCmd.java new file mode 100644 index 00000000000..199bb832d7d --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ConfigurePaloAltoFirewallCmd.java @@ -0,0 +1,114 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.commands; + +import javax.inject.Inject; + +import org.apache.log4j.Logger; + +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncCmd; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import com.cloud.api.response.PaloAltoFirewallResponse; +import com.cloud.event.EventTypes; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.network.dao.ExternalFirewallDeviceVO; +import com.cloud.network.element.PaloAltoFirewallElementService; +import org.apache.cloudstack.context.CallContext; +import com.cloud.utils.exception.CloudRuntimeException; + +@APICommand(name = "configurePaloAltoFirewall", responseObject=PaloAltoFirewallResponse.class, description="Configures a Palo Alto firewall device") +public class ConfigurePaloAltoFirewallCmd extends BaseAsyncCmd { + + public static final Logger s_logger = Logger.getLogger(ConfigurePaloAltoFirewallCmd.class.getName()); + private static final String s_name = "configurepaloaltofirewallresponse"; + @Inject PaloAltoFirewallElementService _paFwService; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.UUID, entityType = PaloAltoFirewallResponse.class, + required=true, description="Palo Alto firewall device ID") + private Long fwDeviceId; + + @Parameter(name=ApiConstants.FIREWALL_DEVICE_CAPACITY, type=CommandType.LONG, required=false, description="capacity of the firewall device, Capacity will be interpreted as number of networks device can handle") + private Long capacity; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getFirewallDeviceId() { + return fwDeviceId; + } + + public Long getFirewallCapacity() { + return capacity; + } + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { + try { + ExternalFirewallDeviceVO fwDeviceVO = _paFwService.configurePaloAltoFirewall(this); + if (fwDeviceVO != null) { + PaloAltoFirewallResponse response = _paFwService.createPaloAltoFirewallResponse(fwDeviceVO); + response.setObjectName("pafirewall"); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to configure Palo Alto firewall device due to internal error."); + } + } catch (InvalidParameterValueException invalidParamExcp) { + throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); + } catch (CloudRuntimeException runtimeExcp) { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); + } + } + + @Override + public String getEventDescription() { + return "Configuring a Palo Alto firewall device"; + } + + @Override + public String getEventType() { + return EventTypes.EVENT_EXTERNAL_FIREWALL_DEVICE_CONFIGURE; + } + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return CallContext.current().getCallingAccount().getId(); + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java new file mode 100644 index 00000000000..93f752ac47c --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java @@ -0,0 +1,88 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.commands; + +import javax.inject.Inject; + +import org.apache.cloudstack.api.response.HostResponse; +import org.apache.log4j.Logger; + +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.SuccessResponse; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.network.element.PaloAltoFirewallElementService; +import com.cloud.user.Account; + +@APICommand(name = "deleteExternalFirewall", description="Deletes an external firewall appliance.", responseObject = SuccessResponse.class) +public class DeleteExternalFirewallCmd extends BaseCmd { + public static final Logger s_logger = Logger.getLogger(DeleteExternalFirewallCmd.class.getName()); + private static final String s_name = "deleteexternalfirewallresponse"; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = HostResponse.class, + required = true, description="Id of the external firewall appliance.") + private Long id; + + /////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getId() { + return id; + } + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Inject PaloAltoFirewallElementService _paElementService; + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return Account.ACCOUNT_ID_SYSTEM; + } + + @SuppressWarnings("deprecation") + @Override + public void execute(){ + try { + boolean result = _paElementService.deleteExternalFirewall(this); + if (result) { + SuccessResponse response = new SuccessResponse(getCommandName()); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete external firewall."); + } + } catch (InvalidParameterValueException e) { + throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Failed to delete external firewall."); + } + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/commands/DeletePaloAltoFirewallCmd.java b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/DeletePaloAltoFirewallCmd.java new file mode 100644 index 00000000000..86149816af5 --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/DeletePaloAltoFirewallCmd.java @@ -0,0 +1,105 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.commands; + +import javax.inject.Inject; + +import org.apache.log4j.Logger; + +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncCmd; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.SuccessResponse; +import com.cloud.api.response.PaloAltoFirewallResponse; +import com.cloud.event.EventTypes; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.network.element.PaloAltoFirewallElementService; +import org.apache.cloudstack.context.CallContext; +import com.cloud.utils.exception.CloudRuntimeException; + +@APICommand(name = "deletePaloAltoFirewall", responseObject=SuccessResponse.class, description=" delete a Palo Alto firewall device") +public class DeletePaloAltoFirewallCmd extends BaseAsyncCmd { + public static final Logger s_logger = Logger.getLogger(DeletePaloAltoFirewallCmd.class.getName()); + private static final String s_name = "deletepaloaltofirewallresponse"; + @Inject PaloAltoFirewallElementService _paElementService; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.UUID, entityType = PaloAltoFirewallResponse.class, + required=true, description="Palo Alto firewall device ID") + private Long fwDeviceId; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getFirewallDeviceId() { + return fwDeviceId; + } + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { + try { + boolean result = _paElementService.deletePaloAltoFirewall(this); + if (result) { + SuccessResponse response = new SuccessResponse(getCommandName()); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete Palo Alto firewall device"); + } + } catch (InvalidParameterValueException invalidParamExcp) { + throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); + } catch (CloudRuntimeException runtimeExcp) { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); + } + } + + @Override + public String getEventDescription() { + return "Deleting Palo Alto firewall device"; + } + + @Override + public String getEventType() { + return EventTypes.EVENT_EXTERNAL_FIREWALL_DEVICE_DELETE; + } + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return CallContext.current().getCallingAccount().getId(); + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListExternalFirewallsCmd.java b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListExternalFirewallsCmd.java new file mode 100644 index 00000000000..ebced7e2039 --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListExternalFirewallsCmd.java @@ -0,0 +1,88 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.commands; + +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; + +import org.apache.cloudstack.api.command.user.offering.ListServiceOfferingsCmd; +import org.apache.cloudstack.api.response.ZoneResponse; +import org.apache.log4j.Logger; + +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseListCmd; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.response.ListResponse; +import com.cloud.host.Host; +import com.cloud.network.element.PaloAltoFirewallElementService; +import org.apache.cloudstack.api.response.ExternalFirewallResponse; + +@APICommand(name = "listExternalFirewalls", description="List external firewall appliances.", responseObject = ExternalFirewallResponse.class) +public class ListExternalFirewallsCmd extends BaseListCmd { + public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName()); + private static final String s_name = "listexternalfirewallsresponse"; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class, + required = true, description="zone Id") + private long zoneId; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public long getZoneId() { + return zoneId; + } + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Inject PaloAltoFirewallElementService _paElementService; + + @Override + public String getCommandName() { + return s_name; + } + + @SuppressWarnings("deprecation") + @Override + public void execute(){ + + List externalFirewalls = _paElementService.listExternalFirewalls(this); + + ListResponse listResponse = new ListResponse(); + List responses = new ArrayList(); + for (Host externalFirewall : externalFirewalls) { + ExternalFirewallResponse response = _paElementService.createExternalFirewallResponse(externalFirewall); + response.setObjectName("externalfirewall"); + response.setResponseName(getCommandName()); + responses.add(response); + } + + listResponse.setResponses(responses); + listResponse.setResponseName(getCommandName()); + this.setResponseObject(listResponse); + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListPaloAltoFirewallNetworksCmd.java b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListPaloAltoFirewallNetworksCmd.java new file mode 100644 index 00000000000..15c5bfcdbed --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListPaloAltoFirewallNetworksCmd.java @@ -0,0 +1,95 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.commands; + +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; + +import org.apache.cloudstack.api.*; +import org.apache.log4j.Logger; + +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.response.ListResponse; +import org.apache.cloudstack.api.response.NetworkResponse; +import com.cloud.api.response.PaloAltoFirewallResponse; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.network.Network; +import com.cloud.network.element.PaloAltoFirewallElementService; +import com.cloud.utils.exception.CloudRuntimeException; + +@APICommand(name = "listPaloAltoFirewallNetworks", responseObject=NetworkResponse.class, description="lists network that are using Palo Alto firewall device") +public class ListPaloAltoFirewallNetworksCmd extends BaseListCmd { + + public static final Logger s_logger = Logger.getLogger(ListPaloAltoFirewallNetworksCmd.class.getName()); + private static final String s_name = "listpaloaltofirewallnetworksresponse"; + @Inject PaloAltoFirewallElementService _paFwService; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name=ApiConstants.LOAD_BALANCER_DEVICE_ID, type=CommandType.UUID, entityType = PaloAltoFirewallResponse.class, + required = true, description="palo alto balancer device ID") + private Long fwDeviceId; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getFirewallDeviceId() { + return fwDeviceId; + } + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { + try { + List networks = _paFwService.listNetworks(this); + ListResponse response = new ListResponse(); + List networkResponses = new ArrayList(); + + if (networks != null && !networks.isEmpty()) { + for (Network network : networks) { + NetworkResponse networkResponse = _responseGenerator.createNetworkResponse(network); + networkResponses.add(networkResponse); + } + } + + response.setResponses(networkResponses); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } catch (InvalidParameterValueException invalidParamExcp) { + throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); + } catch (CloudRuntimeException runtimeExcp) { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); + } + } + + @Override + public String getCommandName() { + return s_name; + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListPaloAltoFirewallsCmd.java b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListPaloAltoFirewallsCmd.java new file mode 100644 index 00000000000..b788aca8c35 --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/commands/ListPaloAltoFirewallsCmd.java @@ -0,0 +1,103 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.commands; + +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; + +import org.apache.cloudstack.api.*; +import org.apache.cloudstack.api.response.PhysicalNetworkResponse; +import org.apache.log4j.Logger; + +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.response.ListResponse; +import com.cloud.api.response.PaloAltoFirewallResponse; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.network.dao.ExternalFirewallDeviceVO; +import com.cloud.network.element.PaloAltoFirewallElementService; +import com.cloud.utils.exception.CloudRuntimeException; + +@APICommand(name = "listPaloAltoFirewalls", responseObject=PaloAltoFirewallResponse.class, description="lists Palo Alto firewall devices in a physical network") +public class ListPaloAltoFirewallsCmd extends BaseListCmd { + + public static final Logger s_logger = Logger.getLogger(ListPaloAltoFirewallsCmd.class.getName()); + private static final String s_name = "listpaloaltofirewallresponse"; + @Inject PaloAltoFirewallElementService _paFwService; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class, + description="the Physical Network ID") + private Long physicalNetworkId; + + @Parameter(name=ApiConstants.FIREWALL_DEVICE_ID, type=CommandType.UUID, entityType = PaloAltoFirewallResponse.class, + description="Palo Alto firewall device ID") + private Long fwDeviceId; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getFirewallDeviceId() { + return fwDeviceId; + } + + public Long getPhysicalNetworkId() { + return physicalNetworkId; + } + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException { + try { + List fwDevices = _paFwService.listPaloAltoFirewalls(this); + ListResponse response = new ListResponse(); + List fwDevicesResponse = new ArrayList(); + + if (fwDevices != null && !fwDevices.isEmpty()) { + for (ExternalFirewallDeviceVO fwDeviceVO : fwDevices) { + PaloAltoFirewallResponse deviceResponse = _paFwService.createPaloAltoFirewallResponse(fwDeviceVO); + fwDevicesResponse.add(deviceResponse); + } + } + + response.setResponses(fwDevicesResponse); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } catch (InvalidParameterValueException invalidParamExcp) { + throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage()); + } catch (CloudRuntimeException runtimeExcp) { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage()); + } + } + + @Override + public String getCommandName() { + return s_name; + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/api/response/PaloAltoFirewallResponse.java b/plugins/network-elements/palo-alto/src/com/cloud/api/response/PaloAltoFirewallResponse.java new file mode 100644 index 00000000000..cda018d7b4c --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/api/response/PaloAltoFirewallResponse.java @@ -0,0 +1,142 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.api.response; + +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.EntityReference; +import com.cloud.serializer.Param; +import com.google.gson.annotations.SerializedName; +import org.apache.cloudstack.api.BaseResponse; + +import com.cloud.network.dao.ExternalFirewallDeviceVO; + +@EntityReference(value=ExternalFirewallDeviceVO.class) +@SuppressWarnings("unused") +public class PaloAltoFirewallResponse extends BaseResponse { + + @SerializedName(ApiConstants.FIREWALL_DEVICE_ID) @Param(description="device id of the Palo Alto firewall") + private String id; + + @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) @Param(description="the physical network to which this Palo Alto firewall belongs to") + private String physicalNetworkId; + + @SerializedName(ApiConstants.PROVIDER) @Param(description="name of the provider") + private String providerName; + + @SerializedName(ApiConstants.FIREWALL_DEVICE_NAME) @Param(description="device name") + private String deviceName; + + @SerializedName(ApiConstants.FIREWALL_DEVICE_STATE) @Param(description="device state") + private String deviceState; + + @SerializedName(ApiConstants.FIREWALL_DEVICE_CAPACITY) @Param(description="device capacity") + private Long deviceCapacity; + + @SerializedName(ApiConstants.ZONE_ID) @Param(description="the zone ID of the external firewall") + private String zoneId; + + @SerializedName(ApiConstants.IP_ADDRESS) @Param(description="the management IP address of the external firewall") + private String ipAddress; + + @SerializedName(ApiConstants.USERNAME) @Param(description="the username that's used to log in to the external firewall") + private String username; + + @SerializedName(ApiConstants.PUBLIC_INTERFACE) @Param(description="the public interface of the external firewall") + private String publicInterface; + + @SerializedName(ApiConstants.USAGE_INTERFACE) @Param(description="the usage interface of the external firewall") + private String usageInterface; + + @SerializedName(ApiConstants.PRIVATE_INTERFACE) @Param(description="the private interface of the external firewall") + private String privateInterface; + + @SerializedName(ApiConstants.PUBLIC_ZONE) @Param(description="the public security zone of the external firewall") + private String publicZone; + + @SerializedName(ApiConstants.PRIVATE_ZONE) @Param(description="the private security zone of the external firewall") + private String privateZone; + + @SerializedName(ApiConstants.NUM_RETRIES) @Param(description="the number of times to retry requests to the external firewall") + private String numRetries; + + @SerializedName(ApiConstants.TIMEOUT) @Param(description="the timeout (in seconds) for requests to the external firewall") + private String timeout; + + public void setId(String lbDeviceId) { + this.id = lbDeviceId; + } + + public void setPhysicalNetworkId(String physicalNetworkId) { + this.physicalNetworkId = physicalNetworkId; + } + + public void setProvider(String provider) { + this.providerName = provider; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public void setDeviceCapacity(long deviceCapacity) { + this.deviceCapacity = deviceCapacity; + } + + public void setDeviceState(String deviceState) { + this.deviceState = deviceState; + } + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + public void setPublicInterface(String publicInterface) { + this.publicInterface = publicInterface; + } + + public void setUsageInterface(String usageInterface) { + this.usageInterface = usageInterface; + } + + public void setPrivateInterface(String privateInterface) { + this.privateInterface = privateInterface; + } + + public void setPublicZone(String publicZone) { + this.publicZone = publicZone; + } + + public void setPrivateZone(String privateZone) { + this.privateZone = privateZone; + } + + public String getNumRetries() { + return numRetries; + } + + public void setNumRetries(String numRetries) { + this.numRetries = numRetries; + } + + public String getTimeout() { + return timeout; + } + + public void setTimeout(String timeout) { + this.timeout = timeout; + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java b/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java new file mode 100644 index 00000000000..3eb802ed8f6 --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java @@ -0,0 +1,538 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.element; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.ejb.Local; +import javax.inject.Inject; + +import org.apache.cloudstack.api.response.ExternalFirewallResponse; +import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice; +import org.apache.log4j.Logger; + +import com.cloud.api.ApiDBUtils; +import com.cloud.api.commands.AddExternalFirewallCmd; +import com.cloud.api.commands.AddPaloAltoFirewallCmd; +import com.cloud.api.commands.ConfigurePaloAltoFirewallCmd; +import com.cloud.api.commands.DeleteExternalFirewallCmd; +import com.cloud.api.commands.DeletePaloAltoFirewallCmd; +import com.cloud.api.commands.ListExternalFirewallsCmd; +import com.cloud.api.commands.ListPaloAltoFirewallNetworksCmd; +import com.cloud.api.commands.ListPaloAltoFirewallsCmd; +import com.cloud.api.response.PaloAltoFirewallResponse; +import com.cloud.configuration.Config; +import com.cloud.configuration.ConfigurationManager; +import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import com.cloud.dc.DataCenter; +import com.cloud.dc.DataCenter.NetworkType; +import com.cloud.dc.DataCenterVO; +import com.cloud.dc.dao.DataCenterDao; +import com.cloud.deploy.DeployDestination; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.InsufficientNetworkCapacityException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.host.Host; +import com.cloud.host.HostVO; +import com.cloud.host.dao.HostDao; +import com.cloud.host.dao.HostDetailsDao; +import com.cloud.network.ExternalFirewallDeviceManagerImpl; +import com.cloud.network.Network; +import com.cloud.network.Network.Capability; +import com.cloud.network.Network.Provider; +import com.cloud.network.Network.Service; +import com.cloud.network.NetworkModel; +import com.cloud.network.PhysicalNetwork; +import com.cloud.network.PhysicalNetworkServiceProvider; +import com.cloud.network.PublicIpAddress; +import com.cloud.network.dao.ExternalFirewallDeviceDao; +import com.cloud.network.dao.ExternalFirewallDeviceVO; +import com.cloud.network.dao.NetworkDao; +import com.cloud.network.dao.NetworkExternalFirewallDao; +import com.cloud.network.dao.NetworkExternalFirewallVO; +import com.cloud.network.dao.NetworkServiceMapDao; +import com.cloud.network.dao.NetworkVO; +import com.cloud.network.dao.PhysicalNetworkDao; +import com.cloud.network.dao.PhysicalNetworkVO; +import com.cloud.network.dao.ExternalFirewallDeviceVO.FirewallDeviceState; +import com.cloud.network.resource.PaloAltoResource; +import com.cloud.network.rules.FirewallRule; +import com.cloud.network.rules.PortForwardingRule; +import com.cloud.network.rules.StaticNat; +import com.cloud.offering.NetworkOffering; +import com.cloud.offerings.dao.NetworkOfferingDao; +import com.cloud.utils.NumbersUtil; +import com.cloud.utils.db.EntityManager; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.vm.NicProfile; +import com.cloud.vm.ReservationContext; +import com.cloud.vm.VirtualMachine; +import com.cloud.vm.VirtualMachineProfile; + +@Local(value = {NetworkElement.class, FirewallServiceProvider.class, + PortForwardingServiceProvider.class, IpDeployer.class, + SourceNatServiceProvider.class}) +public class PaloAltoExternalFirewallElement extends ExternalFirewallDeviceManagerImpl implements SourceNatServiceProvider, FirewallServiceProvider, +PortForwardingServiceProvider, IpDeployer, PaloAltoFirewallElementService, StaticNatServiceProvider { + + private static final Logger s_logger = Logger.getLogger(PaloAltoExternalFirewallElement.class); + + private static final Map> capabilities = setCapabilities(); + + @Inject + NetworkModel _networkManager; + @Inject + HostDao _hostDao; + @Inject + ConfigurationManager _configMgr; + @Inject + NetworkOfferingDao _networkOfferingDao; + @Inject + NetworkDao _networksDao; + @Inject + DataCenterDao _dcDao; + @Inject + PhysicalNetworkDao _physicalNetworkDao; + @Inject + ExternalFirewallDeviceDao _fwDevicesDao; + @Inject + NetworkExternalFirewallDao _networkFirewallDao; + @Inject + NetworkDao _networkDao; + @Inject + NetworkServiceMapDao _ntwkSrvcDao; + @Inject + HostDetailsDao _hostDetailDao; + @Inject + ConfigurationDao _configDao; + @Inject + EntityManager _entityMgr; + + private boolean canHandle(Network network, Service service) { + DataCenter zone = _entityMgr.findById(DataCenter.class, network.getDataCenterId()); + if (zone.getNetworkType() == NetworkType.Advanced && network.getGuestType() != Network.GuestType.Isolated) { + s_logger.trace("Element " + getProvider().getName() + "is not handling network type = " + network.getGuestType()); + return false; + } + + if (service == null) { + if (!_networkManager.isProviderForNetwork(getProvider(), network.getId())) { + s_logger.trace("Element " + getProvider().getName() + " is not a provider for the network " + network); + return false; + } + } else { + if (!_networkManager.isProviderSupportServiceInNetwork(network.getId(), service, getProvider())) { + s_logger.trace("Element " + getProvider().getName() + " doesn't support service " + service.getName() + " in the network " + network); + return false; + } + } + + return true; + } + + @Override + public boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, + InsufficientNetworkCapacityException { + DataCenter zone = _entityMgr.findById(DataCenter.class, network.getDataCenterId()); + + // don't have to implement network is Basic zone + if (zone.getNetworkType() == NetworkType.Basic) { + s_logger.debug("Not handling network implement in zone of type " + NetworkType.Basic); + return false; + } + + if (!canHandle(network, null)) { + return false; + } + + try { + return manageGuestNetworkWithExternalFirewall(true, network); + } catch (InsufficientCapacityException capacityException) { + // TODO: handle out of capacity exception in more gracefule manner when multiple providers are present for + // the network + s_logger.error("Fail to implement the Palo Alto for network " + network, capacityException); + return false; + } + } + + @Override + public boolean prepare(Network config, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, + InsufficientNetworkCapacityException, ResourceUnavailableException { + return true; + } + + @Override + public boolean release(Network config, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) { + return true; + } + + @Override + public boolean shutdown(Network network, ReservationContext context, boolean cleanup) throws ResourceUnavailableException, ConcurrentOperationException { + DataCenter zone = _entityMgr.findById(DataCenter.class, network.getDataCenterId()); + + // don't have to implement network is Basic zone + if (zone.getNetworkType() == NetworkType.Basic) { + s_logger.debug("Not handling network shutdown in zone of type " + NetworkType.Basic); + return false; + } + + if (!canHandle(network, null)) { + return false; + } + try { + return manageGuestNetworkWithExternalFirewall(false, network); + } catch (InsufficientCapacityException capacityException) { + // TODO: handle out of capacity exception + return false; + } + } + + @Override + public boolean destroy(Network config, ReservationContext context) { + return true; + } + + @Override + public boolean applyFWRules(Network config, List rules) throws ResourceUnavailableException { + if (!canHandle(config, Service.Firewall)) { + return false; + } + + return applyFirewallRules(config, rules); + } + + @Override + public Provider getProvider() { + return Provider.PaloAlto; + } + + @Override + public Map> getCapabilities() { + return capabilities; + } + + private static Map> setCapabilities() { + Map> capabilities = new HashMap>(); + + // Set capabilities for Firewall service + Map firewallCapabilities = new HashMap(); + firewallCapabilities.put(Capability.SupportedProtocols, "tcp,udp,icmp"); + firewallCapabilities.put(Capability.SupportedEgressProtocols, "tcp,udp,icmp,all"); + firewallCapabilities.put(Capability.MultipleIps, "true"); + firewallCapabilities.put(Capability.TrafficStatistics, "per public ip"); + firewallCapabilities.put(Capability.SupportedTrafficDirection, "ingress, egress"); + capabilities.put(Service.Firewall, firewallCapabilities); + + capabilities.put(Service.Gateway, null); + + Map sourceNatCapabilities = new HashMap(); + // Specifies that this element supports either one source NAT rule per account; + sourceNatCapabilities.put(Capability.SupportedSourceNatTypes, "peraccount"); + capabilities.put(Service.SourceNat, sourceNatCapabilities); + + // Specifies that port forwarding rules are supported by this element + capabilities.put(Service.PortForwarding, null); + + // Specifies that static NAT rules are supported by this element + capabilities.put(Service.StaticNat, null); + + return capabilities; + } + + @Override + public boolean applyPFRules(Network network, List rules) throws ResourceUnavailableException { + if (!canHandle(network, Service.PortForwarding)) { + return false; + } + + return applyPortForwardingRules(network, rules); + } + + @Override + public boolean isReady(PhysicalNetworkServiceProvider provider) { + + List fwDevices = _fwDevicesDao.listByPhysicalNetworkAndProvider(provider.getPhysicalNetworkId(), Provider.PaloAlto.getName()); + // true if at-least one Palo Alto device is added in to physical network and is in configured (in enabled state) state + if (fwDevices != null && !fwDevices.isEmpty()) { + for (ExternalFirewallDeviceVO fwDevice : fwDevices) { + if (fwDevice.getDeviceState() == FirewallDeviceState.Enabled) { + return true; + } + } + } + return false; + } + + @Override + public boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context) throws ConcurrentOperationException, + ResourceUnavailableException { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean canEnableIndividualServices() { + return true; + } + + @Override + @Deprecated + // should use more generic addNetworkDevice command to add firewall + public Host addExternalFirewall(AddExternalFirewallCmd cmd) { + Long zoneId = cmd.getZoneId(); + DataCenterVO zone = null; + PhysicalNetworkVO pNetwork = null; + HostVO fwHost = null; + + zone = _dcDao.findById(zoneId); + if (zone == null) { + throw new InvalidParameterValueException("Could not find zone with ID: " + zoneId); + } + + List physicalNetworks = _physicalNetworkDao.listByZone(zoneId); + if ((physicalNetworks == null) || (physicalNetworks.size() > 1)) { + throw new InvalidParameterValueException("There are no physical networks or multiple physical networks configured in zone with ID: " + + zoneId + " to add this device."); + } + pNetwork = physicalNetworks.get(0); + + String deviceType = NetworkDevice.PaloAltoFirewall.getName(); + ExternalFirewallDeviceVO fwDeviceVO = addExternalFirewall(pNetwork.getId(), cmd.getUrl(), cmd.getUsername(), cmd.getPassword(), deviceType, new PaloAltoResource()); + if (fwDeviceVO != null) { + fwHost = _hostDao.findById(fwDeviceVO.getHostId()); + } + + return fwHost; + } + + @Override + public boolean deleteExternalFirewall(DeleteExternalFirewallCmd cmd) { + return deleteExternalFirewall(cmd.getId()); + } + + @Override + @Deprecated + // should use more generic listNetworkDevice command + public List listExternalFirewalls(ListExternalFirewallsCmd cmd) { + List firewallHosts = new ArrayList(); + Long zoneId = cmd.getZoneId(); + DataCenterVO zone = null; + PhysicalNetworkVO pNetwork = null; + + if (zoneId != null) { + zone = _dcDao.findById(zoneId); + if (zone == null) { + throw new InvalidParameterValueException("Could not find zone with ID: " + zoneId); + } + + List physicalNetworks = _physicalNetworkDao.listByZone(zoneId); + if ((physicalNetworks == null) || (physicalNetworks.size() > 1)) { + throw new InvalidParameterValueException("There are no physical networks or multiple physical networks configured in zone with ID: " + + zoneId + " to add this device."); + } + pNetwork = physicalNetworks.get(0); + } + + firewallHosts.addAll(listExternalFirewalls(pNetwork.getId(), NetworkDevice.PaloAltoFirewall.getName())); + return firewallHosts; + } + + @Override + public ExternalFirewallResponse createExternalFirewallResponse(Host externalFirewall) { + return super.createExternalFirewallResponse(externalFirewall); + } + + @Override + public List> getCommands() { + List> cmdList = new ArrayList>(); + cmdList.add(AddExternalFirewallCmd.class); + cmdList.add(AddPaloAltoFirewallCmd.class); + cmdList.add(ConfigurePaloAltoFirewallCmd.class); + cmdList.add(DeleteExternalFirewallCmd.class); + cmdList.add(DeletePaloAltoFirewallCmd.class); + cmdList.add(ListExternalFirewallsCmd.class); + cmdList.add(ListPaloAltoFirewallNetworksCmd.class); + cmdList.add(ListPaloAltoFirewallsCmd.class); + return cmdList; + } + + @Override + public ExternalFirewallDeviceVO addPaloAltoFirewall(AddPaloAltoFirewallCmd cmd) { + String deviceName = cmd.getDeviceType(); + if (!deviceName.equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) { + throw new InvalidParameterValueException("Invalid Palo Alto firewall device type"); + } + return addExternalFirewall(cmd.getPhysicalNetworkId(), cmd.getUrl(), cmd.getUsername(), cmd.getPassword(), deviceName, + new PaloAltoResource()); + } + + @Override + public boolean deletePaloAltoFirewall(DeletePaloAltoFirewallCmd cmd) { + Long fwDeviceId = cmd.getFirewallDeviceId(); + + ExternalFirewallDeviceVO fwDeviceVO = _fwDevicesDao.findById(fwDeviceId); + if (fwDeviceVO == null || !fwDeviceVO.getDeviceName().equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) { + throw new InvalidParameterValueException("No Palo Alto firewall device found with ID: " + fwDeviceId); + } + return deleteExternalFirewall(fwDeviceVO.getHostId()); + } + + @Override + public ExternalFirewallDeviceVO configurePaloAltoFirewall(ConfigurePaloAltoFirewallCmd cmd) { + Long fwDeviceId = cmd.getFirewallDeviceId(); + Long deviceCapacity = cmd.getFirewallCapacity(); + + ExternalFirewallDeviceVO fwDeviceVO = _fwDevicesDao.findById(fwDeviceId); + if (fwDeviceVO == null || !fwDeviceVO.getDeviceName().equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) { + throw new InvalidParameterValueException("No Palo Alto firewall device found with ID: " + fwDeviceId); + } + + if (deviceCapacity != null) { + // check if any networks are using this Palo Alto device + List networks = _networkFirewallDao.listByFirewallDeviceId(fwDeviceId); + if ((networks != null) && !networks.isEmpty()) { + if (deviceCapacity < networks.size()) { + throw new CloudRuntimeException("There are more number of networks already using this Palo Alto firewall device than configured capacity"); + } + } + if (deviceCapacity != null) { + fwDeviceVO.setCapacity(deviceCapacity); + } + } + + fwDeviceVO.setDeviceState(FirewallDeviceState.Enabled); + _fwDevicesDao.update(fwDeviceId, fwDeviceVO); + return fwDeviceVO; + } + + @Override + public List listPaloAltoFirewalls(ListPaloAltoFirewallsCmd cmd) { + Long physcialNetworkId = cmd.getPhysicalNetworkId(); + Long fwDeviceId = cmd.getFirewallDeviceId(); + PhysicalNetworkVO pNetwork = null; + List fwDevices = new ArrayList(); + + if (physcialNetworkId == null && fwDeviceId == null) { + throw new InvalidParameterValueException("Either physical network Id or load balancer device Id must be specified"); + } + + if (fwDeviceId != null) { + ExternalFirewallDeviceVO fwDeviceVo = _fwDevicesDao.findById(fwDeviceId); + if (fwDeviceVo == null || !fwDeviceVo.getDeviceName().equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) { + throw new InvalidParameterValueException("Could not find Palo Alto firewall device with ID: " + fwDeviceId); + } + fwDevices.add(fwDeviceVo); + } + + if (physcialNetworkId != null) { + pNetwork = _physicalNetworkDao.findById(physcialNetworkId); + if (pNetwork == null) { + throw new InvalidParameterValueException("Could not find phyical network with ID: " + physcialNetworkId); + } + fwDevices = _fwDevicesDao.listByPhysicalNetworkAndProvider(physcialNetworkId, Provider.PaloAlto.getName()); + } + + return fwDevices; + } + + @Override + public List listNetworks(ListPaloAltoFirewallNetworksCmd cmd) { + Long fwDeviceId = cmd.getFirewallDeviceId(); + List networks = new ArrayList(); + + ExternalFirewallDeviceVO fwDeviceVo = _fwDevicesDao.findById(fwDeviceId); + if (fwDeviceVo == null || !fwDeviceVo.getDeviceName().equalsIgnoreCase(NetworkDevice.PaloAltoFirewall.getName())) { + throw new InvalidParameterValueException("Could not find Palo Alto firewall device with ID " + fwDeviceId); + } + + List networkFirewallMaps = _networkFirewallDao.listByFirewallDeviceId(fwDeviceId); + if (networkFirewallMaps != null && !networkFirewallMaps.isEmpty()) { + for (NetworkExternalFirewallVO networkFirewallMap : networkFirewallMaps) { + NetworkVO network = _networkDao.findById(networkFirewallMap.getNetworkId()); + networks.add(network); + } + } + + return networks; + } + + @Override + public PaloAltoFirewallResponse createPaloAltoFirewallResponse(ExternalFirewallDeviceVO fwDeviceVO) { + PaloAltoFirewallResponse response = new PaloAltoFirewallResponse(); + Map fwDetails = _hostDetailDao.findDetails(fwDeviceVO.getHostId()); + Host fwHost = _hostDao.findById(fwDeviceVO.getHostId()); + + response.setId(fwDeviceVO.getUuid()); + PhysicalNetwork pnw = ApiDBUtils.findPhysicalNetworkById(fwDeviceVO.getPhysicalNetworkId()); + if (pnw != null) { + response.setPhysicalNetworkId(pnw.getUuid()); + } + response.setDeviceName(fwDeviceVO.getDeviceName()); + if (fwDeviceVO.getCapacity() == 0) { + long defaultFwCapacity = NumbersUtil.parseLong(_configDao.getValue(Config.DefaultExternalFirewallCapacity.key()), 50); + response.setDeviceCapacity(defaultFwCapacity); + } else { + response.setDeviceCapacity(fwDeviceVO.getCapacity()); + } + response.setProvider(fwDeviceVO.getProviderName()); + response.setDeviceState(fwDeviceVO.getDeviceState().name()); + response.setIpAddress(fwHost.getPrivateIpAddress()); + response.setPublicInterface(fwDetails.get("publicInterface")); + response.setUsageInterface(fwDetails.get("usageInterface")); + response.setPrivateInterface(fwDetails.get("privateInterface")); + response.setPublicZone(fwDetails.get("publicZone")); + response.setPrivateZone(fwDetails.get("privateZone")); + response.setNumRetries(fwDetails.get("numRetries")); + response.setTimeout(fwDetails.get("timeout")); + response.setObjectName("paloaltofirewall"); + return response; + } + + @Override + public boolean verifyServicesCombination(Set services) { + if (!services.contains(Service.Firewall)) { + s_logger.warn("Palo Alto must be used as Firewall Service Provider in the network"); + return false; + } + return true; + } + + @Override + public IpDeployer getIpDeployer(Network network) { + return this; + } + + @Override + public boolean applyIps(Network network, List ipAddress, Set service) throws ResourceUnavailableException { + // return true, as IP will be associated as part of static NAT/port forwarding rule configuration + return true; + } + + @Override + public boolean applyStaticNats(Network config, List rules) throws ResourceUnavailableException { + if (!canHandle(config, Service.StaticNat)) { + return false; + } + return applyStaticNatRules(config, rules); + } +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoFirewallElementService.java b/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoFirewallElementService.java new file mode 100644 index 00000000000..d2842ab101d --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoFirewallElementService.java @@ -0,0 +1,88 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.element; + +import java.util.List; + +import com.cloud.api.commands.AddExternalFirewallCmd; +import com.cloud.api.commands.AddPaloAltoFirewallCmd; +import com.cloud.api.commands.ConfigurePaloAltoFirewallCmd; +import com.cloud.api.commands.DeleteExternalFirewallCmd; +import com.cloud.api.commands.DeletePaloAltoFirewallCmd; +import com.cloud.api.commands.ListExternalFirewallsCmd; +import com.cloud.api.commands.ListPaloAltoFirewallNetworksCmd; +import com.cloud.api.commands.ListPaloAltoFirewallsCmd; +import com.cloud.api.response.PaloAltoFirewallResponse; +import com.cloud.host.Host; +import com.cloud.network.Network; +import com.cloud.network.dao.ExternalFirewallDeviceVO; + +import org.apache.cloudstack.api.response.ExternalFirewallResponse; +import com.cloud.utils.component.PluggableService; + +public interface PaloAltoFirewallElementService extends PluggableService { + + /** + * adds a Palo Alto firewall device in to a physical network + * @param AddPaloAltoFirewallCmd + * @return ExternalFirewallDeviceVO object for the firewall added + */ + public ExternalFirewallDeviceVO addPaloAltoFirewall(AddPaloAltoFirewallCmd cmd); + + /** + * removes Palo Alto firewall device from a physical network + * @param DeletePaloAltoFirewallCmd + * @return true if firewall device successfully deleted + */ + public boolean deletePaloAltoFirewall(DeletePaloAltoFirewallCmd cmd); + + /** + * configures a Palo Alto firewal device added in a physical network + * @param ConfigurePaloAltoFirewallCmd + * @return ExternalFirewallDeviceVO for the device configured + */ + public ExternalFirewallDeviceVO configurePaloAltoFirewall(ConfigurePaloAltoFirewallCmd cmd); + + /** + * lists all the Palo Alto firewall devices added in to a physical network + * @param ListPaloAltoFirewallsCmd + * @return list of ExternalFirewallDeviceVO for the devices in the physical network. + */ + public List listPaloAltoFirewalls(ListPaloAltoFirewallsCmd cmd); + + /** + * lists all the guest networks using a PaloAlto firewall device + * @param ListPaloAltoFirewallNetworksCmd + * @return list of the guest networks that are using this F5 load balancer + */ + public List listNetworks(ListPaloAltoFirewallNetworksCmd cmd); + + public PaloAltoFirewallResponse createPaloAltoFirewallResponse(ExternalFirewallDeviceVO fwDeviceVO); + + + @Deprecated // API helper function supported for backward compatibility + public Host addExternalFirewall(AddExternalFirewallCmd cmd); + + @Deprecated // API helper function supported for backward compatibility + public boolean deleteExternalFirewall(DeleteExternalFirewallCmd cmd); + + @Deprecated // API helper function supported for backward compatibility + public List listExternalFirewalls(ListExternalFirewallsCmd cmd); + + @Deprecated // API helper function supported for backward compatibility + public ExternalFirewallResponse createExternalFirewallResponse(Host externalFirewall); +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/network/resource/PaloAltoResource.java b/plugins/network-elements/palo-alto/src/com/cloud/network/resource/PaloAltoResource.java new file mode 100644 index 00000000000..2251ce06851 --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/network/resource/PaloAltoResource.java @@ -0,0 +1,2030 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.resource; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import javax.naming.ConfigurationException; +import javax.xml.parsers.DocumentBuilderFactory; + +import com.cloud.agent.IAgentControl; +import com.cloud.agent.api.Answer; +import com.cloud.agent.api.Command; +import com.cloud.agent.api.ExternalNetworkResourceUsageAnswer; +import com.cloud.agent.api.ExternalNetworkResourceUsageCommand; +import com.cloud.agent.api.MaintainAnswer; +import com.cloud.agent.api.MaintainCommand; +import com.cloud.agent.api.PingCommand; +import com.cloud.agent.api.ReadyAnswer; +import com.cloud.agent.api.ReadyCommand; +import com.cloud.agent.api.StartupCommand; +import com.cloud.agent.api.StartupExternalFirewallCommand; +import com.cloud.agent.api.routing.IpAssocAnswer; +import com.cloud.agent.api.routing.IpAssocCommand; +import com.cloud.agent.api.routing.NetworkElementCommand; +import com.cloud.agent.api.routing.SetFirewallRulesCommand; +import com.cloud.agent.api.routing.SetPortForwardingRulesCommand; +import com.cloud.agent.api.routing.SetStaticNatRulesCommand; +import com.cloud.agent.api.to.FirewallRuleTO; +import com.cloud.agent.api.to.IpAddressTO; +import com.cloud.agent.api.to.PortForwardingRuleTO; +import com.cloud.agent.api.to.StaticNatRuleTO; +import com.cloud.host.Host; +import com.cloud.network.rules.FirewallRule; +import com.cloud.network.rules.FirewallRule.TrafficType; +import com.cloud.network.rules.FirewallRule.Purpose; +import com.cloud.resource.ServerResource; +import com.cloud.utils.NumbersUtil; +import com.cloud.utils.exception.ExecutionException; +import com.cloud.utils.net.NetUtils; +import com.cloud.utils.script.Script; + +// http client handling +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.BasicResponseHandler; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.NameValuePair; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.protocol.HTTP; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.net.URLDecoder; +import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import com.cloud.network.utils.HttpClientWrapper; + +// for prettyFormat() +import javax.xml.transform.stream.StreamSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import java.io.StringWriter; + +public class PaloAltoResource implements ServerResource { + + private String _name; + private String _zoneId; + private String _ip; + private String _username; + private String _password; + private String _guid; + private String _key; + private Integer _numRetries; + private Integer _timeoutInSeconds; + private String _publicZone; + private String _privateZone; + private String _publicInterface; + private String _privateInterface; + private String _publicInterfaceType; + private String _privateInterfaceType; + private String _virtualRouter; + private String _threatProfile; + private String _logProfile; + private String _pingManagementProfile; + private final Logger s_logger = Logger.getLogger(PaloAltoResource.class); + + private static String _apiUri = "/api"; + private static HttpClient _httpclient; + + protected enum PaloAltoMethod { + GET, POST; + } + + private enum PaloAltoPrimative { + CHECK_IF_EXISTS, ADD, DELETE; + } + + private enum InterfaceType { + AGGREGATE("aggregate-ethernet"), + ETHERNET("ethernet"); + + private String type; + + private InterfaceType(String type) { + this.type = type; + } + public String toString() { + return type; + } + } + + private enum Protocol { + TCP("tcp"), + UDP("udp"), + ICMP("icmp"), + ALL("all"); + + private String protocol; + + private Protocol(String protocol) { + this.protocol = protocol; + } + public String toString() { + return protocol; + } + } + + private enum GuestNetworkType { + SOURCE_NAT, + INTERFACE_NAT; + } + + public Answer executeRequest(Command cmd) { + if (cmd instanceof ReadyCommand) { + return execute((ReadyCommand) cmd); + } else if (cmd instanceof MaintainCommand) { + return execute((MaintainCommand) cmd); + } else if (cmd instanceof IpAssocCommand) { + return execute((IpAssocCommand) cmd); + } else if (cmd instanceof SetStaticNatRulesCommand) { + return execute((SetStaticNatRulesCommand) cmd); + } else if (cmd instanceof SetPortForwardingRulesCommand) { + return execute((SetPortForwardingRulesCommand) cmd); + } else if (cmd instanceof SetFirewallRulesCommand) { + return execute((SetFirewallRulesCommand) cmd); + } else if (cmd instanceof ExternalNetworkResourceUsageCommand) { + return execute((ExternalNetworkResourceUsageCommand) cmd); + } else { + return Answer.createUnsupportedCommandAnswer(cmd); + } + } + + public boolean configure(String name, Map params) throws ConfigurationException { + try { + _name = (String) params.get("name"); + if (_name == null) { + throw new ConfigurationException("Unable to find name"); + } + + _zoneId = (String) params.get("zoneId"); + if (_zoneId == null) { + throw new ConfigurationException("Unable to find zone"); + } + + _ip = (String) params.get("ip"); + if (_ip == null) { + throw new ConfigurationException("Unable to find IP"); + } + + _username = (String) params.get("username"); + if (_username == null) { + throw new ConfigurationException("Unable to find username"); + } + + _password = (String) params.get("password"); + if (_password == null) { + throw new ConfigurationException("Unable to find password"); + } + + _publicInterface = (String) params.get("publicinterface"); + if (_publicInterface == null) { + throw new ConfigurationException("Unable to find public interface."); + } + + _privateInterface = (String) params.get("privateinterface"); + if (_privateInterface == null) { + throw new ConfigurationException("Unable to find private interface."); + } + + _publicZone = (String) params.get("publicnetwork"); + if (_publicZone == null) { + throw new ConfigurationException("Unable to find public zone"); + } + + _privateZone = (String) params.get("privatenetwork"); + if (_privateZone == null) { + throw new ConfigurationException("Unable to find private zone"); + } + + _virtualRouter = (String) params.get("pavr"); + if (_virtualRouter == null) { + throw new ConfigurationException("Unable to find virtual router"); + } + + _threatProfile = (String) params.get("patp"); + _logProfile = (String) params.get("palp"); + + _guid = (String) params.get("guid"); + if (_guid == null) { + throw new ConfigurationException("Unable to find the guid"); + } + + _numRetries = NumbersUtil.parseInt((String) params.get("numretries"), 1); + _timeoutInSeconds = NumbersUtil.parseInt((String) params.get("timeout"), 300); + + // Open a socket and login + if (!refreshPaloAltoConnection()) { + throw new ConfigurationException("Unable to open a connection to the Palo Alto."); + } + + // check that the threat profile exists if one was specified + if (_threatProfile != null) { + try { + boolean has_profile = getThreatProfile(_threatProfile); + if (!has_profile) { + throw new ConfigurationException("The specified threat profile group does not exist."); + } + } catch (ExecutionException e) { + throw new ConfigurationException(e.getMessage()); + } + } + + // check that the log profile exists if one was specified + if (_logProfile != null) { + try { + boolean has_profile = getLogProfile(_logProfile); + if (!has_profile) { + throw new ConfigurationException("The specified log profile does not exist."); + } + } catch (ExecutionException e) { + throw new ConfigurationException(e.getMessage()); + } + } + + // get public interface type + try { + _publicInterfaceType = getInterfaceType(_publicInterface); + if (_publicInterfaceType.equals("")) { + throw new ConfigurationException("The specified public interface is not configured on the Palo Alto."); + } + } catch (ExecutionException e) { + throw new ConfigurationException(e.getMessage()); + } + + // get private interface type + try { + _privateInterfaceType = getInterfaceType(_privateInterface); + if (_privateInterfaceType.equals("")) { + throw new ConfigurationException("The specified private interface is not configured on the Palo Alto."); + } + } catch (ExecutionException e) { + throw new ConfigurationException(e.getMessage()); + } + + _pingManagementProfile = "Ping"; + try { + ArrayList cmdList = new ArrayList(); + managePingProfile(cmdList, PaloAltoPrimative.ADD); + boolean status = requestWithCommit(cmdList); + } catch (ExecutionException e) { + throw new ConfigurationException(e.getMessage()); + } + + return true; + } catch (Exception e) { + throw new ConfigurationException(e.getMessage()); + } + + } + + public StartupCommand[] initialize() { + StartupExternalFirewallCommand cmd = new StartupExternalFirewallCommand(); + cmd.setName(_name); + cmd.setDataCenter(_zoneId); + cmd.setPod(""); + cmd.setPrivateIpAddress(_ip); + cmd.setStorageIpAddress(""); + cmd.setVersion(PaloAltoResource.class.getPackage().getImplementationVersion()); + cmd.setGuid(_guid); + return new StartupCommand[]{cmd}; + } + + public Host.Type getType() { + return Host.Type.ExternalFirewall; + } + + @Override + public String getName() { + return _name; + } + + @Override + public boolean start() { + return true; + } + + @Override + public boolean stop() { + return true; + } + + @Override + public PingCommand getCurrentStatus(final long id) { + return new PingCommand(Host.Type.ExternalFirewall, id); + } + + @Override + public void disconnected() { + // nothing for now... + } + + public IAgentControl getAgentControl() { + return null; + } + + public void setAgentControl(IAgentControl agentControl) { + return; + } + + /* + * Login + */ + private void openHttpConnection(){ + _httpclient = new DefaultHttpClient(); + + // Allows you to connect via SSL using unverified certs + _httpclient = HttpClientWrapper.wrapClient(_httpclient); + } + + private boolean refreshPaloAltoConnection() { + if (_httpclient == null) { + openHttpConnection(); + } + + try { + return login(_username, _password); + } catch (ExecutionException e) { + s_logger.error("Failed to login due to " + e.getMessage()); + return false; + } + } + + private boolean login(String username, String password) throws ExecutionException { + Map params = new HashMap(); + params.put("type", "keygen"); + params.put("user", username); + params.put("password", password); + + String keygenBody; + try { + keygenBody = request(PaloAltoMethod.GET, params); + } catch (ExecutionException e) { + return false; + } + Document keygen_doc = getDocument(keygenBody); + XPath xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = xpath.compile("/response[@status='success']/result/key/text()"); + _key = (String) expr.evaluate(keygen_doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (_key != null) { + return true; + } + return false; + } + + + // ENTRY POINTS... + + + private Answer execute(ReadyCommand cmd) { + return new ReadyAnswer(cmd); + } + + private Answer execute(MaintainCommand cmd) { + return new MaintainAnswer(cmd); + } + + private ExternalNetworkResourceUsageAnswer execute(ExternalNetworkResourceUsageCommand cmd) { + return new ExternalNetworkResourceUsageAnswer(cmd); + } + + + /* + * Guest networks + */ + + private synchronized Answer execute(IpAssocCommand cmd) { + refreshPaloAltoConnection(); + return execute(cmd, _numRetries); + } + + private Answer execute(IpAssocCommand cmd, int numRetries) { + String[] results = new String[cmd.getIpAddresses().length]; + int i = 0; + try { + IpAddressTO ip; + if (cmd.getIpAddresses().length != 1) { + throw new ExecutionException("Received an invalid number of guest IPs to associate."); + } else { + ip = cmd.getIpAddresses()[0]; + } + + String sourceNatIpAddress = null; + GuestNetworkType type = GuestNetworkType.INTERFACE_NAT; + + if (ip.isSourceNat()) { + type = GuestNetworkType.SOURCE_NAT; + + if (ip.getPublicIp() == null) { + throw new ExecutionException("Source NAT IP address must not be null."); + } else { + sourceNatIpAddress = ip.getPublicIp(); + } + } + + long guestVlanTag = Long.parseLong(cmd.getAccessDetail(NetworkElementCommand.GUEST_VLAN_TAG)); + String guestVlanGateway = cmd.getAccessDetail(NetworkElementCommand.GUEST_NETWORK_GATEWAY); + String cidr = cmd.getAccessDetail(NetworkElementCommand.GUEST_NETWORK_CIDR); + long cidrSize = NetUtils.cidrToLong(cidr)[1]; + String guestVlanSubnet = NetUtils.getCidrSubNet(guestVlanGateway, cidrSize); + + Long publicVlanTag = null; + if (ip.getBroadcastUri() != null && !ip.getBroadcastUri().equals("untagged")) { + try { + publicVlanTag = Long.parseLong(ip.getBroadcastUri()); + } catch (Exception e) { + throw new ExecutionException("Could not parse public VLAN tag: " + ip.getBroadcastUri()); + } + } + + ArrayList commandList = new ArrayList(); + + if (ip.isAdd()) { + // Implement the guest network for this VLAN + implementGuestNetwork(commandList, type, publicVlanTag, sourceNatIpAddress, guestVlanTag, guestVlanGateway, guestVlanSubnet, cidrSize); + } else { + // Remove the guest network: + shutdownGuestNetwork(commandList, type, publicVlanTag, sourceNatIpAddress, guestVlanTag, guestVlanGateway, guestVlanSubnet, cidrSize); + } + + boolean status = requestWithCommit(commandList); + + results[i++] = ip.getPublicIp() + " - success"; + } catch (ExecutionException e) { + s_logger.error(e); + + if (numRetries > 0 && refreshPaloAltoConnection()) { + int numRetriesRemaining = numRetries - 1; + s_logger.debug("Retrying IPAssocCommand. Number of retries remaining: " + numRetriesRemaining); + return execute(cmd, numRetriesRemaining); + } else { + results[i++] = IpAssocAnswer.errorResult; + } + } + + return new IpAssocAnswer(cmd, results); + } + + private void implementGuestNetwork(ArrayList cmdList, GuestNetworkType type, Long publicVlanTag, String publicIp, long privateVlanTag, String privateGateway, String privateSubnet, long privateCidrNumber) throws ExecutionException { + privateSubnet = privateSubnet+"/"+privateCidrNumber; + + managePrivateInterface(cmdList, PaloAltoPrimative.ADD, privateVlanTag, privateGateway+"/"+privateCidrNumber); + + if (type.equals(GuestNetworkType.SOURCE_NAT)) { + managePublicInterface(cmdList, PaloAltoPrimative.ADD, publicVlanTag, publicIp+"/32", privateVlanTag); + manageSrcNatRule(cmdList, PaloAltoPrimative.ADD, type, publicVlanTag, publicIp+"/32", privateVlanTag, privateGateway+"/"+privateCidrNumber); + manageNetworkIsolation(cmdList, PaloAltoPrimative.ADD, privateVlanTag, privateSubnet, privateGateway); + } + + String msg = "Implemented guest network with type " + type + ". Guest VLAN tag: " + privateVlanTag + ", guest gateway: " + privateGateway+"/"+privateCidrNumber; + msg += type.equals(GuestNetworkType.SOURCE_NAT) ? ", source NAT IP: " + publicIp : ""; + s_logger.debug(msg); + } + + private void shutdownGuestNetwork(ArrayList cmdList, GuestNetworkType type, Long publicVlanTag, String sourceNatIpAddress, long privateVlanTag, String privateGateway, String privateSubnet, long privateCidrSize) throws ExecutionException { + privateSubnet = privateSubnet+"/"+privateCidrSize; + + if (type.equals(GuestNetworkType.SOURCE_NAT)) { + manageNetworkIsolation(cmdList, PaloAltoPrimative.DELETE, privateVlanTag, privateSubnet, privateGateway); + manageSrcNatRule(cmdList, PaloAltoPrimative.DELETE, type, publicVlanTag, sourceNatIpAddress+"/32", privateVlanTag, privateGateway+"/"+privateCidrSize); + managePublicInterface(cmdList, PaloAltoPrimative.DELETE, publicVlanTag, sourceNatIpAddress+"/32", privateVlanTag); + } + + managePrivateInterface(cmdList, PaloAltoPrimative.DELETE, privateVlanTag, privateGateway+"/"+privateCidrSize); + + String msg = "Shut down guest network with type " + type +". Guest VLAN tag: " + privateVlanTag + ", guest gateway: " + privateGateway+"/"+privateCidrSize; + msg += type.equals(GuestNetworkType.SOURCE_NAT) ? ", source NAT IP: " + sourceNatIpAddress : ""; + s_logger.debug(msg); + } + + + + /* + * Firewall rule entry point + */ + private synchronized Answer execute(SetFirewallRulesCommand cmd) { + refreshPaloAltoConnection(); + return execute(cmd, _numRetries); + } + + private Answer execute(SetFirewallRulesCommand cmd, int numRetries) { + FirewallRuleTO[] rules = cmd.getRules(); + try { + ArrayList commandList = new ArrayList(); + + for (FirewallRuleTO rule : rules) { + if (!rule.revoked()) { + manageFirewallRule(commandList, PaloAltoPrimative.ADD, rule); + } else { + manageFirewallRule(commandList, PaloAltoPrimative.DELETE, rule); + } + } + + boolean status = requestWithCommit(commandList); + + return new Answer(cmd); + } catch (ExecutionException e) { + s_logger.error(e); + + if (numRetries > 0 && refreshPaloAltoConnection()) { + int numRetriesRemaining = numRetries - 1; + s_logger.debug("Retrying SetFirewallRulesCommand. Number of retries remaining: " + numRetriesRemaining); + return execute(cmd, numRetriesRemaining); + } else { + return new Answer(cmd, e); + } + } + } + + + /* + * Static NAT rule entry point + */ + + private synchronized Answer execute(SetStaticNatRulesCommand cmd) { + refreshPaloAltoConnection(); + return execute(cmd, _numRetries); + } + + private Answer execute(SetStaticNatRulesCommand cmd, int numRetries) { + StaticNatRuleTO[] rules = cmd.getRules(); + + try { + ArrayList commandList = new ArrayList(); + + for (StaticNatRuleTO rule : rules) { + if (!rule.revoked()) { + manageStcNatRule(commandList, PaloAltoPrimative.ADD, rule); + } else { + manageStcNatRule(commandList, PaloAltoPrimative.DELETE, rule); + } + } + + boolean status = requestWithCommit(commandList); + + return new Answer(cmd); + } catch (ExecutionException e) { + s_logger.error(e); + + if (numRetries > 0 && refreshPaloAltoConnection()) { + int numRetriesRemaining = numRetries - 1; + s_logger.debug("Retrying SetStaticNatRulesCommand. Number of retries remaining: " + numRetriesRemaining); + return execute(cmd, numRetriesRemaining); + } else { + return new Answer(cmd, e); + } + } + } + + + /* + * Destination NAT (Port Forwarding) entry point + */ + private synchronized Answer execute (SetPortForwardingRulesCommand cmd) { + refreshPaloAltoConnection(); + return execute(cmd, _numRetries); + } + + private Answer execute(SetPortForwardingRulesCommand cmd, int numRetries) { + PortForwardingRuleTO[] rules = cmd.getRules(); + + try { + ArrayList commandList = new ArrayList(); + + for (PortForwardingRuleTO rule : rules) { + if (!rule.revoked()) { + manageDstNatRule(commandList, PaloAltoPrimative.ADD, rule); + } else { + manageDstNatRule(commandList, PaloAltoPrimative.DELETE, rule); + } + } + + boolean status = requestWithCommit(commandList); + + return new Answer(cmd); + } catch (ExecutionException e) { + s_logger.error(e); + + if (numRetries > 0 && refreshPaloAltoConnection()) { + int numRetriesRemaining = numRetries - 1; + s_logger.debug("Retrying SetPortForwardingRulesCommand. Number of retries remaining: " + numRetriesRemaining); + return execute(cmd, numRetriesRemaining); + } else { + return new Answer(cmd, e); + } + } + } + + + // IMPLEMENTATIONS... + + + /* + * Private interface implementation + */ + + private String genPrivateInterfaceName(long vlanTag) { + return _privateInterface+"."+Long.toString(vlanTag); + } + + public boolean managePrivateInterface(ArrayList cmdList, PaloAltoPrimative prim, long privateVlanTag, String privateGateway) throws ExecutionException { + String interfaceName = genPrivateInterfaceName(privateVlanTag); + + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/network/interface/"+_privateInterfaceType+"/entry[@name='"+_privateInterface+"']/layer3/units/entry[@name='"+interfaceName+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Private sub-interface exists: "+interfaceName+", "+result); + return result; + + case ADD: + if (managePrivateInterface(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, privateVlanTag, privateGateway)) { + return true; + } + + // add cmds + // add sub-interface + Map a_sub_params = new HashMap(); + a_sub_params.put("type", "config"); + a_sub_params.put("action", "set"); + a_sub_params.put("xpath", "/config/devices/entry/network/interface/"+_privateInterfaceType+"/entry[@name='"+_privateInterface+"']/layer3/units/entry[@name='"+interfaceName+"']"); + a_sub_params.put("element", ""+privateVlanTag+""+_pingManagementProfile+""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_sub_params)); + + // add sub-interface to VR... + Map a_vr_params = new HashMap(); + a_vr_params.put("type", "config"); + a_vr_params.put("action", "set"); + a_vr_params.put("xpath", "/config/devices/entry/network/virtual-router/entry[@name='"+_virtualRouter+"']/interface"); + a_vr_params.put("element", ""+interfaceName+""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_vr_params)); + + // add sub-interface to vsys... + Map a_vsys_params = new HashMap(); + a_vsys_params.put("type", "config"); + a_vsys_params.put("action", "set"); + a_vsys_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/import/network/interface"); + a_vsys_params.put("element", ""+interfaceName+""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_vsys_params)); + + // add sub-interface to zone... + Map a_zone_params = new HashMap(); + a_zone_params.put("type", "config"); + a_zone_params.put("action", "set"); + a_zone_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/zone/entry[@name='"+_privateZone+"']/network/layer3"); + a_zone_params.put("element", ""+interfaceName+""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_zone_params)); + + return true; + + case DELETE: + if (!managePrivateInterface(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, privateVlanTag, privateGateway)) { + return true; + } + + // add cmds to the list + // delete sub-interface from zone... + Map d_zone_params = new HashMap(); + d_zone_params.put("type", "config"); + d_zone_params.put("action", "delete"); + d_zone_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/zone/entry[@name='"+_privateZone+"']/network/layer3/member[text()='"+interfaceName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_zone_params)); + + // delete sub-interface from vsys... + Map d_vsys_params = new HashMap(); + d_vsys_params.put("type", "config"); + d_vsys_params.put("action", "delete"); + d_vsys_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/import/network/interface/member[text()='"+interfaceName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_vsys_params)); + + // delete sub-interface from VR... + Map d_vr_params = new HashMap(); + d_vr_params.put("type", "config"); + d_vr_params.put("action", "delete"); + d_vr_params.put("xpath", "/config/devices/entry/network/virtual-router/entry[@name='"+_virtualRouter+"']/interface/member[text()='"+interfaceName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_vr_params)); + + // delete sub-interface... + Map d_sub_params = new HashMap(); + d_sub_params.put("type", "config"); + d_sub_params.put("action", "delete"); + d_sub_params.put("xpath", "/config/devices/entry/network/interface/"+_privateInterfaceType+"/entry[@name='"+_privateInterface+"']/layer3/units/entry[@name='"+interfaceName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_sub_params)); + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + + /* + * Public Interface implementation + */ + + private String genPublicInterfaceName(Long id) { + return _publicInterface+"."+Long.toString(id); + } + + public boolean managePublicInterface(ArrayList cmdList, PaloAltoPrimative prim, Long publicVlanTag, String publicIp, long privateVlanTag) throws ExecutionException { + String interfaceName; + if (publicVlanTag == null) { + interfaceName = genPublicInterfaceName(new Long("9999")); + } else { + interfaceName = genPublicInterfaceName(publicVlanTag); + } + + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/network/interface/"+_publicInterfaceType+"/entry[@name='"+_publicInterface+"']/layer3/units/entry[@name='"+interfaceName+"']/ip/entry[@name='"+publicIp+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Public sub-interface & IP exists: "+interfaceName+" : "+publicIp+", "+result); + return result; + + case ADD: + if (managePublicInterface(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, publicVlanTag, publicIp, privateVlanTag)) { + return true; + } + + // add IP to the sub-interface + Map a_sub_params = new HashMap(); + a_sub_params.put("type", "config"); + a_sub_params.put("action", "set"); + a_sub_params.put("xpath", "/config/devices/entry/network/interface/"+_publicInterfaceType+"/entry[@name='"+_publicInterface+"']/layer3/units/entry[@name='"+interfaceName+"']/ip"); + a_sub_params.put("element", ""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_sub_params)); + + // add sub-interface to VR (does nothing if already done)... + Map a_vr_params = new HashMap(); + a_vr_params.put("type", "config"); + a_vr_params.put("action", "set"); + a_vr_params.put("xpath", "/config/devices/entry/network/virtual-router/entry[@name='"+_virtualRouter+"']/interface"); + a_vr_params.put("element", ""+interfaceName+""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_vr_params)); + + // add sub-interface to vsys (does nothing if already done)... + Map a_vsys_params = new HashMap(); + a_vsys_params.put("type", "config"); + a_vsys_params.put("action", "set"); + a_vsys_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/import/network/interface"); + a_vsys_params.put("element", ""+interfaceName+""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_vsys_params)); + + // add sub-interface to zone (does nothing if already done)... + Map a_zone_params = new HashMap(); + a_zone_params.put("type", "config"); + a_zone_params.put("action", "set"); + a_zone_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/zone/entry[@name='"+_publicZone+"']/network/layer3"); + a_zone_params.put("element", ""+interfaceName+""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_zone_params)); + + return true; + + case DELETE: + if (!managePublicInterface(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, publicVlanTag, publicIp, privateVlanTag)) { + return true; + } + + // delete IP from sub-interface... + Map d_sub_params = new HashMap(); + d_sub_params.put("type", "config"); + d_sub_params.put("action", "delete"); + d_sub_params.put("xpath", "/config/devices/entry/network/interface/"+_publicInterfaceType+"/entry[@name='"+_publicInterface+"']/layer3/units/entry[@name='"+interfaceName+"']/ip/entry[@name='"+publicIp+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_sub_params)); + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + + /* + * Source NAT rule implementation + */ + + private String genSrcNatRuleName(Long privateVlanTag) { + return "src_nat."+Long.toString(privateVlanTag); + } + + public boolean manageSrcNatRule(ArrayList cmdList, PaloAltoPrimative prim, GuestNetworkType type, Long publicVlanTag, String publicIp, long privateVlanTag, String privateGateway) throws ExecutionException { + String publicInterfaceName; + if (publicVlanTag == null) { + publicInterfaceName = genPublicInterfaceName(new Long("9999")); + } else { + publicInterfaceName = genPublicInterfaceName(publicVlanTag); + } + String srcNatName = genSrcNatRuleName(privateVlanTag); + + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+srcNatName+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Source NAT exists: "+srcNatName+", "+result); + return result; + + case ADD: + if (manageSrcNatRule(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, type, publicVlanTag, publicIp, privateVlanTag, privateGateway)) { + return true; + } + + String xml = ""; + xml += ""+_privateZone+""; + xml += ""+_publicZone+""; + xml += ""+privateGateway+""; + xml += "any"; + xml += "any"; + xml += "ipv4"; + xml += ""+publicInterfaceName+""; + xml += ""; + xml += ""+publicIp+""; + xml += ""+publicInterfaceName+""; + xml += ""; + + Map a_params = new HashMap(); + a_params.put("type", "config"); + a_params.put("action", "set"); + a_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+srcNatName+"']"); + a_params.put("element", xml); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, a_params)); + + return true; + + case DELETE: + if (!manageSrcNatRule(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, type, publicVlanTag, publicIp, privateVlanTag, privateGateway)) { + return true; + } + + Map d_params = new HashMap(); + d_params.put("type", "config"); + d_params.put("action", "delete"); + d_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+srcNatName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, d_params)); + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + + /* + * Destination NAT rules (Port Forwarding) implementation + */ + private String genDstNatRuleName(String publicIp, long id) { + return "dst_nat."+genIpIdentifier(publicIp)+"_"+Long.toString(id); + } + + public boolean manageDstNatRule(ArrayList cmdList, PaloAltoPrimative prim, PortForwardingRuleTO rule) throws ExecutionException { + String publicIp = rule.getSrcIp(); + String dstNatName = genDstNatRuleName(publicIp, rule.getId()); + + String publicInterfaceName; + String publicVlanTag = rule.getSrcVlanTag(); + if (publicVlanTag == null || publicVlanTag.equals("untagged")) { + publicInterfaceName = genPublicInterfaceName(new Long("9999")); + } else { + publicInterfaceName = genPublicInterfaceName(new Long(publicVlanTag)); + } + + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+dstNatName+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Destination NAT exists: "+dstNatName+", "+result); + return result; + + case ADD: + if (manageDstNatRule(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, rule)) { + return true; + } + + // build source service xml + String srcService; + String protocol = rule.getProtocol(); + int[] srcPortRange = rule.getSrcPortRange(); + if (srcPortRange != null) { + String portRange; + if (srcPortRange.length == 1 || srcPortRange[0] == srcPortRange[1]) { + portRange = String.valueOf(srcPortRange[0]); + } else { + portRange = String.valueOf(srcPortRange[0])+"-"+String.valueOf(srcPortRange[1]); + } + manageService(cmdList, PaloAltoPrimative.ADD, protocol, portRange, null); + srcService = genServiceName(protocol, portRange, null); + } else { + // no equivalent config in PA, so allow all traffic... + srcService = "any"; + } + + // build destination port xml (single port limit in PA) + String dstPortXML = ""; + int[] dstPortRange = rule.getDstPortRange(); + if (dstPortRange != null) { + dstPortXML = ""+dstPortRange[0]+""; + } + + // add public IP to the sub-interface + Map a_sub_params = new HashMap(); + a_sub_params.put("type", "config"); + a_sub_params.put("action", "set"); + a_sub_params.put("xpath", "/config/devices/entry/network/interface/"+_publicInterfaceType+"/entry[@name='"+_publicInterface+"']/layer3/units/entry[@name='"+publicInterfaceName+"']/ip"); + a_sub_params.put("element", ""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_sub_params)); + + // add the destination nat rule for the public IP + String xml = ""; + xml += ""+_publicZone+""; + xml += ""+_publicZone+""; + xml += "any"; + xml += ""+publicIp+""; + xml += ""+srcService+""; + xml += "ipv4"; + xml += ""+publicInterfaceName+""; + xml += ""+rule.getDstIp()+""+dstPortXML+""; + + Map a_params = new HashMap(); + a_params.put("type", "config"); + a_params.put("action", "set"); + a_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+dstNatName+"']"); + a_params.put("element", xml); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, a_params)); + + return true; + + case DELETE: + if (!manageDstNatRule(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, rule)) { + return true; + } + + // determine if we need to delete the ip from the interface as well... + Map c_params = new HashMap(); + c_params.put("type", "config"); + c_params.put("action", "get"); + c_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[destination/member[text()='"+publicIp+"']]"); + String c_response = request(PaloAltoMethod.GET, c_params); + + String count = ""; + NodeList response_body; + Document doc = getDocument(c_response); + XPath xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = xpath.compile("/response[@status='success']/result"); + response_body = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (response_body.getLength() > 0 && response_body.item(0).getAttributes().getLength() > 0) { + count = response_body.item(0).getAttributes().getNamedItem("count").getTextContent(); + } + + // delete the dst nat rule + Map d_params = new HashMap(); + d_params.put("type", "config"); + d_params.put("action", "delete"); + d_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+dstNatName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, d_params)); + + if (!count.equals("") && Integer.parseInt(count) == 1) { // this dst nat rule is the last, so remove the ip... + // delete IP from sub-interface... + Map d_sub_params = new HashMap(); + d_sub_params.put("type", "config"); + d_sub_params.put("action", "delete"); + d_sub_params.put("xpath", "/config/devices/entry/network/interface/"+_publicInterfaceType+"/entry[@name='"+_publicInterface+"']/layer3/units/entry[@name='"+publicInterfaceName+"']/ip/entry[@name='"+publicIp+"/32']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_sub_params)); + } + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + + + /* + * Static NAT rule implementation + */ + private String genStcNatRuleName(String publicIp, long id) { + return "stc_nat."+genIpIdentifier(publicIp)+"_"+Long.toString(id); + } + + public boolean manageStcNatRule(ArrayList cmdList, PaloAltoPrimative prim, StaticNatRuleTO rule) throws ExecutionException { + String publicIp = rule.getSrcIp(); + String stcNatName = genStcNatRuleName(publicIp, rule.getId()); + + String publicInterfaceName; + String publicVlanTag = rule.getSrcVlanTag(); + if (publicVlanTag == null || publicVlanTag.equals("untagged")) { + publicInterfaceName = genPublicInterfaceName(new Long("9999")); + } else { + publicInterfaceName = genPublicInterfaceName(new Long(publicVlanTag)); + } + + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+stcNatName+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Static NAT exists: "+stcNatName+", "+result); + return result; + + case ADD: + if (manageStcNatRule(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, rule)) { + return true; + } + + // add public IP to the sub-interface + Map a_sub_params = new HashMap(); + a_sub_params.put("type", "config"); + a_sub_params.put("action", "set"); + a_sub_params.put("xpath", "/config/devices/entry/network/interface/"+_publicInterfaceType+"/entry[@name='"+_publicInterface+"']/layer3/units/entry[@name='"+publicInterfaceName+"']/ip"); + a_sub_params.put("element", ""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_sub_params)); + + // add the static nat rule for the public IP + String xml = ""; + xml += ""+_publicZone+""; + xml += ""+_publicZone+""; + xml += "any"; + xml += ""+publicIp+""; + xml += "any"; + xml += "ipv4"; + xml += ""+publicInterfaceName+""; + xml += ""+rule.getDstIp()+""; + + + Map a_params = new HashMap(); + a_params.put("type", "config"); + a_params.put("action", "set"); + a_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+stcNatName+"']"); + a_params.put("element", xml); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, a_params)); + + return true; + + case DELETE: + if (!manageStcNatRule(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, rule)) { + return true; + } + + // delete the static nat rule + Map d_params = new HashMap(); + d_params.put("type", "config"); + d_params.put("action", "delete"); + d_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='"+stcNatName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, d_params)); + + // delete IP from sub-interface... + Map d_sub_params = new HashMap(); + d_sub_params.put("type", "config"); + d_sub_params.put("action", "delete"); + d_sub_params.put("xpath", "/config/devices/entry/network/interface/"+_publicInterfaceType+"/entry[@name='"+_publicInterface+"']/layer3/units/entry[@name='"+publicInterfaceName+"']/ip/entry[@name='"+publicIp+"/32']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_sub_params)); + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + + /* + * Firewall rule implementation + */ + + private String genFirewallRuleName(long id) { + return "policy_"+Long.toString(id); + } + + public boolean manageFirewallRule(ArrayList cmdList, PaloAltoPrimative prim, FirewallRuleTO rule) throws ExecutionException { + String ruleName = genFirewallRuleName(rule.getId()); + + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='"+ruleName+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Firewall policy exists: "+ruleName+", "+result); + return result; + + case ADD: + if (manageFirewallRule(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, rule)) { + return true; + } + + String srcZone; + String dstZone; + String dstAddressXML; + String appXML; + String serviceXML; + + String protocol = rule.getProtocol(); + + // Only ICMP will use an Application, so others will be any. + if (protocol.equals(Protocol.ICMP.toString())) { + appXML = "icmppingtraceroute"; // use the default icmp applications... + } else { + appXML = "any"; + } + + // Only TCP and UDP will use a Service, others will use any. + if (protocol.equals(Protocol.TCP.toString()) || protocol.equals(Protocol.UDP.toString())) { + String portRange; + if (rule.getSrcPortRange() != null) { + int startPort = rule.getSrcPortRange()[0]; + int endPort = rule.getSrcPortRange()[1]; + if (startPort == endPort) { + portRange = String.valueOf(startPort); + } else { + portRange = String.valueOf(startPort)+"-"+String.valueOf(endPort); + } + manageService(cmdList, PaloAltoPrimative.ADD, protocol, portRange, null); + serviceXML = ""+genServiceName(protocol, portRange, null)+""; + } else { + // no equivalent config in PA, so allow all traffic... + serviceXML = "any"; + } + } else { + serviceXML = "any"; + } + + if (rule.getTrafficType() == FirewallRule.TrafficType.Egress) { // Network egress rule + srcZone = _privateZone; + dstZone = _publicZone; + dstAddressXML = "any"; + } else { + srcZone = _publicZone; + dstZone = _privateZone; + dstAddressXML = ""+rule.getSrcIp()+""; + } + + // build the source cidr xml + String srcCidrXML = ""; + List ruleSrcCidrList = rule.getSourceCidrList(); + if (ruleSrcCidrList.size() > 0) { // a cidr was entered, modify as needed... + for (int i = 0; i < ruleSrcCidrList.size(); i++) { + if (ruleSrcCidrList.get(i).trim().equals("0.0.0.0/0")) { // allow any + if (rule.getTrafficType() == FirewallRule.TrafficType.Egress) { + srcCidrXML += ""+getPrivateSubnet(rule.getSrcVlanTag())+""; + } else { + srcCidrXML += "any"; + } + } else { + srcCidrXML += ""+ruleSrcCidrList.get(i).trim()+""; + } + } + } else { // no cidr was entered, so allow ALL according to firewall rule type + if (rule.getTrafficType() == FirewallRule.TrafficType.Egress) { + srcCidrXML = ""+getPrivateSubnet(rule.getSrcVlanTag())+""; + } else { + srcCidrXML = "any"; + } + } + + String xml = ""; + xml += ""+srcZone+""; + xml += ""+dstZone+""; + xml += ""+srcCidrXML+""; + xml += ""+dstAddressXML+""; + xml += ""+appXML+""; + xml += ""+serviceXML+""; + xml += "allow"; + xml += "no"; + xml += "no"; + if (_threatProfile != null) { // add the threat profile if it exists + xml += ""+_threatProfile+""; + } + if (_logProfile != null) { // add the log profile if it exists + xml += ""+_logProfile+""; + } + + Map a_params = new HashMap(); + a_params.put("type", "config"); + a_params.put("action", "set"); + a_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='"+ruleName+"']"); + a_params.put("element", xml); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, a_params)); + + return true; + + case DELETE: + if (!manageFirewallRule(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, rule)) { + return true; + } + + Map d_params = new HashMap(); + d_params.put("type", "config"); + d_params.put("action", "delete"); + d_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='"+ruleName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, d_params)); + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + + + /* + * Usage + */ + + + + /* + * Helper config functions + */ + + // ensure guest network isolation + private String genNetworkIsolationName(long privateVlanTag) { + return "isolate_"+Long.toString(privateVlanTag); + } + + public boolean manageNetworkIsolation(ArrayList cmdList, PaloAltoPrimative prim, long privateVlanTag, String privateSubnet, String privateGateway) throws ExecutionException { + String ruleName = genNetworkIsolationName(privateVlanTag); + + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='"+ruleName+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Firewall policy exists: "+ruleName+", "+result); + return result; + + case ADD: + if (manageNetworkIsolation(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, privateVlanTag, privateSubnet, privateGateway)) { + return true; + } + + String xml = ""; + xml += ""+_privateZone+""; + xml += ""+_privateZone+""; + xml += ""+privateSubnet+""; + xml += ""+privateGateway+""; + xml += "any"; + xml += "any"; + xml += "deny"; + xml += "no"; + xml += "yes"; + + Map a_params = new HashMap(); + a_params.put("type", "config"); + a_params.put("action", "set"); + a_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='"+ruleName+"']"); + a_params.put("element", xml); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, a_params)); + + return true; + + case DELETE: + if (!manageNetworkIsolation(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, privateVlanTag, privateSubnet, privateGateway)) { + return true; + } + + Map d_params = new HashMap(); + d_params.put("type", "config"); + d_params.put("action", "delete"); + d_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='"+ruleName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.POST, d_params)); + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + + // make the interfaces pingable for basic network troubleshooting + public boolean managePingProfile(ArrayList cmdList, PaloAltoPrimative prim) throws ExecutionException { + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/network/profiles/interface-management-profile/entry[@name='"+_pingManagementProfile+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Management profile exists: "+_pingManagementProfile+", "+result); + return result; + + case ADD: + if (managePingProfile(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS)) { + return true; + } + + // add ping profile... + Map a_params = new HashMap(); + a_params.put("type", "config"); + a_params.put("action", "set"); + a_params.put("xpath", "/config/devices/entry/network/profiles/interface-management-profile/entry[@name='"+_pingManagementProfile+"']"); + a_params.put("element", "yes"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_params)); + + return true; + + case DELETE: + if (!managePingProfile(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS)) { + return true; + } + + // delete ping profile... + Map d_params = new HashMap(); + d_params.put("type", "config"); + d_params.put("action", "delete"); + d_params.put("xpath", "/config/devices/entry/network/profiles/interface-management-profile/entry[@name='"+_pingManagementProfile+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_params)); + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + + private String genServiceName(String protocol, String dstPorts, String srcPorts) { + String name; + if (srcPorts == null) { + name = "cs_"+protocol.toLowerCase()+"_"+dstPorts.replace(',', '.'); + } else { + name = "cs_"+protocol.toLowerCase()+"_"+dstPorts.replace(',', '.')+"_"+srcPorts.replace(',', '.'); + } + return name; + } + + public boolean manageService(ArrayList cmdList, PaloAltoPrimative prim, String protocol, String dstPorts, String srcPorts) throws ExecutionException { + String serviceName = genServiceName(protocol, dstPorts, srcPorts); + + switch (prim) { + + case CHECK_IF_EXISTS: + // check if one exists already + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/service/entry[@name='"+serviceName+"']"); + String response = request(PaloAltoMethod.GET, params); + boolean result = (validResponse(response) && responseNotEmpty(response)); + s_logger.debug("Service exists: "+serviceName+", "+result); + return result; + + case ADD: + if (manageService(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, protocol, dstPorts, srcPorts)) { + return true; + } + + String dstPortXML = ""+dstPorts+""; + String srcPortXML = ""; + if (srcPorts != null) { + srcPortXML = ""+srcPorts+""; + } + + // add ping profile... + Map a_params = new HashMap(); + a_params.put("type", "config"); + a_params.put("action", "set"); + a_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/service/entry[@name='"+serviceName+"']"); + a_params.put("element", "<"+protocol.toLowerCase()+">"+dstPortXML+srcPortXML+""); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, a_params)); + + return true; + + case DELETE: + if (!manageService(cmdList, PaloAltoPrimative.CHECK_IF_EXISTS, protocol, dstPorts, srcPorts)) { + return true; + } + + // delete ping profile... + Map d_params = new HashMap(); + d_params.put("type", "config"); + d_params.put("action", "delete"); + d_params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/service/entry[@name='"+serviceName+"']"); + cmdList.add(new DefaultPaloAltoCommand(PaloAltoMethod.GET, d_params)); + + return true; + + default: + s_logger.debug("Unrecognized command."); + return false; + } + } + + private String getPrivateSubnet(String vlan) throws ExecutionException { + String _interfaceName = genPrivateInterfaceName(Long.valueOf(vlan).longValue()); + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/network/interface/"+_privateInterfaceType+"/entry[@name='"+_privateInterface+"']/layer3/units/entry[@name='"+_interfaceName+"']/ip/entry"); + String response = request(PaloAltoMethod.GET, params); + if (validResponse(response) && responseNotEmpty(response)) { + NodeList response_body; + Document doc = getDocument(response); + XPath xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = xpath.compile("/response[@status='success']/result/entry"); + response_body = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (response_body.getLength() > 0) { + return response_body.item(0).getAttributes().getNamedItem("name").getTextContent(); + } + } + return null; + } + + + /* + * XML API commands + */ + + /* Function to make calls to the Palo Alto API. */ + /* All API calls will end up going through this function. */ + protected String request(PaloAltoMethod method, Map params) throws ExecutionException { + if (method != PaloAltoMethod.GET && method != PaloAltoMethod.POST) { + throw new ExecutionException("Invalid http method used to access the Palo Alto API."); + } + + String responseBody = ""; + String debug_msg = "Palo Alto Request\n"; + + // a GET method... + if (method == PaloAltoMethod.GET) { + String queryString = "?"; + for (String key : params.keySet()) { + if (!queryString.equals("?")) { + queryString = queryString + "&"; + } + try { + queryString = queryString + key+"="+URLEncoder.encode(params.get(key), "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new ExecutionException(e.getMessage()); + } + } + if (_key != null) { + queryString = queryString + "&key="+_key; + } + + try { + debug_msg = debug_msg + "GET request: https://" + _ip + _apiUri + URLDecoder.decode(queryString, "UTF-8") + "\n"; + } catch (UnsupportedEncodingException e) { + debug_msg = debug_msg + "GET request: https://" + _ip + _apiUri + queryString + "\n"; + } + + + HttpGet get_request = new HttpGet("https://" + _ip + _apiUri + queryString); + ResponseHandler responseHandler = new BasicResponseHandler(); + try { + responseBody = _httpclient.execute(get_request, responseHandler); + } catch (IOException e) { + throw new ExecutionException(e.getMessage()); + } + } + + // a POST method... + if (method == PaloAltoMethod.POST) { + List nvps = new ArrayList (); + for (String key : params.keySet()) { + nvps.add(new BasicNameValuePair(key, params.get(key))); + } + if (_key != null) { + nvps.add(new BasicNameValuePair("key", _key)); + } + + debug_msg = debug_msg + "POST request: https://" + _ip + _apiUri + "\n"; + for (NameValuePair nvp : nvps) { + debug_msg = debug_msg + "param: "+nvp.getName()+", "+nvp.getValue() + "\n"; + } + + HttpPost post_request = new HttpPost("https://" + _ip + _apiUri); + try { + post_request.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); + } catch (UnsupportedEncodingException e) { + throw new ExecutionException(e.getMessage()); + } + ResponseHandler responseHandler = new BasicResponseHandler(); + try { + responseBody = _httpclient.execute(post_request, responseHandler); + } catch (IOException e) { + throw new ExecutionException(e.getMessage()); + } + } + + debug_msg = debug_msg + prettyFormat(responseBody); + debug_msg = debug_msg + "\n" + responseBody.replace("\"", "\\\"") + "\n\n"; // test cases + //s_logger.debug(debug_msg); // this can be commented if we don't want to show each request in the log. + + return responseBody; + } + + /* Used for requests that require polling to get a result (eg: commit) */ + private String requestWithPolling(PaloAltoMethod method, Map params) throws ExecutionException { + String job_id; + String job_response = request(method, params); + Document doc = getDocument(job_response); + XPath xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = xpath.compile("/response[@status='success']/result/job/text()"); + job_id = (String) expr.evaluate(doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (job_id.length() > 0) { + boolean finished = false; + Map job_params = new HashMap(); + job_params.put("type", "op"); + job_params.put("cmd", ""+job_id+""); + + while (!finished) { + String job_status; + String response = request(PaloAltoMethod.GET, job_params); + Document job_doc = getDocument(response); + XPath job_xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = job_xpath.compile("/response[@status='success']/result/job/status/text()"); + job_status = (String) expr.evaluate(job_doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (job_status.equals("FIN")) { + finished = true; + String job_result; + try { + XPathExpression expr = job_xpath.compile("/response[@status='success']/result/job/result/text()"); + job_result = (String) expr.evaluate(job_doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (!job_result.equals("OK")) { + NodeList job_details; + try { + XPathExpression expr = job_xpath.compile("/response[@status='success']/result/job/details/line"); + job_details = (NodeList) expr.evaluate(job_doc, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + String error = ""; + for (int i = 0; i < job_details.getLength(); i++) { + error = error + job_details.item(i).getTextContent() + "\n"; + } + throw new ExecutionException(error); + } + return response; + } else { + try { + Thread.sleep(2000); // poll periodically for the status of the async job... + } catch (InterruptedException e) { /* do nothing */ } + } + } + } else { + return job_response; + } + return null; + } + + /* Runs a sequence of commands and attempts to commit at the end. */ + /* Uses the Command pattern to enable overriding of the response handling if needed. */ + private synchronized boolean requestWithCommit(ArrayList commandList) throws ExecutionException { + boolean result = true; + + if (commandList.size() > 0) { + // CHECK IF THERE IS PENDING CHANGES THAT HAVE NOT BEEN COMMITTED... + String pending_changes; + Map check_params = new HashMap(); + check_params.put("type", "op"); + check_params.put("cmd", ""); + String check_response = request(PaloAltoMethod.GET, check_params); + Document check_doc = getDocument(check_response); + XPath check_xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = check_xpath.compile("/response[@status='success']/result/text()"); + pending_changes = (String) expr.evaluate(check_doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (pending_changes.equals("yes")) { + throw new ExecutionException("The Palo Alto has uncommited changes, so no changes can be made. Try again later or contact your administrator."); + } else { + // ADD A CONFIG LOCK TO CAPTURE THE PALO ALTO RESOURCE + String add_lock_status; + Map add_lock_params = new HashMap(); + add_lock_params.put("type", "op"); + add_lock_params.put("cmd", ""); + String add_lock_response = request(PaloAltoMethod.GET, add_lock_params); + Document add_lock_doc = getDocument(add_lock_response); + XPath add_lock_xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = add_lock_xpath.compile("/response[@status='success']/result/text()"); + add_lock_status = (String) expr.evaluate(add_lock_doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (add_lock_status.length() == 0) { + throw new ExecutionException("The Palo Alto is locked, no changes can be made at this time."); + } + + try { + // RUN THE SEQUENCE OF COMMANDS + for (IPaloAltoCommand command : commandList) { + result = (result && command.execute()); // run commands and modify result boolean + } + + // COMMIT THE CHANGES (ALSO REMOVES CONFIG LOCK) + String commit_job_id; + Map commit_params = new HashMap(); + commit_params.put("type", "commit"); + commit_params.put("cmd", ""); + String commit_response = requestWithPolling(PaloAltoMethod.GET, commit_params); + Document commit_doc = getDocument(commit_response); + XPath commit_xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = commit_xpath.compile("/response[@status='success']/result/job/id/text()"); + commit_job_id = (String) expr.evaluate(commit_doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (commit_job_id.length() == 0) { // no commit was done, so release the lock... + // REMOVE THE CONFIG LOCK TO RELEASE THE PALO ALTO RESOURCE + String remove_lock_status; + Map remove_lock_params = new HashMap(); + remove_lock_params.put("type", "op"); + remove_lock_params.put("cmd", ""); + String remove_lock_response = request(PaloAltoMethod.GET, remove_lock_params); + Document remove_lock_doc = getDocument(remove_lock_response); + XPath remove_lock_xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = remove_lock_xpath.compile("/response[@status='success']/result/text()"); + remove_lock_status = (String) expr.evaluate(remove_lock_doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (remove_lock_status.length() == 0) { + throw new ExecutionException("Could not release the Palo Alto device. Please notify an administrator!"); + } + } + + } catch (ExecutionException ex) { + // REVERT TO RUNNING + String revert_job_id; + Map revert_params = new HashMap(); + revert_params.put("type", "op"); + revert_params.put("cmd", "running-config.xml"); + requestWithPolling(PaloAltoMethod.GET, revert_params); + + // REMOVE THE CONFIG LOCK TO RELEASE THE PALO ALTO RESOURCE + String remove_lock_status; + Map remove_lock_params = new HashMap(); + remove_lock_params.put("type", "op"); + remove_lock_params.put("cmd", ""); + String remove_lock_response = request(PaloAltoMethod.GET, remove_lock_params); + Document remove_lock_doc = getDocument(remove_lock_response); + XPath remove_lock_xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = remove_lock_xpath.compile("/response[@status='success']/result/text()"); + remove_lock_status = (String) expr.evaluate(remove_lock_doc, XPathConstants.STRING); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (remove_lock_status.length() == 0) { + throw new ExecutionException("Could not release the Palo Alto device. Please notify an administrator!"); + } + + throw ex; // Bubble up the reason we reverted... + } + + return result; + } + } else { + return true; // nothing to do + } + } + + /* A default response handler to validate that the request was successful. */ + public boolean validResponse(String response) throws ExecutionException { + NodeList response_body; + Document doc = getDocument(response); + XPath xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = xpath.compile("/response[@status='success']"); + response_body = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + + if (response_body.getLength() > 0) { + return true; + } else { + NodeList error_details; + try { + XPathExpression expr = xpath.compile("/response/msg/line/line"); + error_details = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + if (error_details.getLength() == 0) { + try { + XPathExpression expr = xpath.compile("/response/msg/line"); + error_details = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + + if (error_details.getLength() == 0) { + try { + XPathExpression expr = xpath.compile("/response/result/msg"); + error_details = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + } + } + String error = ""; + for (int i = 0; i < error_details.getLength(); i++) { + error = error + error_details.item(i).getTextContent() + "\n"; + } + throw new ExecutionException(error); + } + } + + /* Validate that the response is not empty. */ + public boolean responseNotEmpty(String response) throws ExecutionException { + NodeList response_body; + Document doc = getDocument(response); + XPath xpath = XPathFactory.newInstance().newXPath(); + try { + XPathExpression expr = xpath.compile("/response[@status='success']"); + response_body = (NodeList) expr.evaluate(doc, XPathConstants.NODESET); + } catch (XPathExpressionException e) { + throw new ExecutionException(e.getCause().getMessage()); + } + + if (response_body.getLength() > 0 && + (!response_body.item(0).getTextContent().equals("") || + (response_body.item(0).hasChildNodes() && response_body.item(0).getFirstChild().hasChildNodes()))) { + return true; + } else { + return false; + } + } + + /* Get the type of interface from the PA device. */ + private String getInterfaceType(String interface_name) throws ExecutionException { + String[] types = { InterfaceType.ETHERNET.toString(), InterfaceType.AGGREGATE.toString() }; + for (String type : types) { + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/network/interface/"+type+"/entry[@name='"+interface_name+"']"); + String ethernet_response = request(PaloAltoMethod.GET, params); + if (validResponse(ethernet_response) && responseNotEmpty(ethernet_response)) { + return type; + } + } + return ""; + } + + /* Get the threat profile from the server if it exists. */ + private boolean getThreatProfile(String profile) throws ExecutionException { + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/profile-group/entry[@name='"+profile+"']"); + String response = request(PaloAltoMethod.GET, params); + return (validResponse(response) && responseNotEmpty(response)); + } + + /* Get the log profile from the server if it exists. */ + private boolean getLogProfile(String profile) throws ExecutionException { + Map params = new HashMap(); + params.put("type", "config"); + params.put("action", "get"); + params.put("xpath", "/config/devices/entry/vsys/entry[@name='vsys1']/log-settings/profiles/entry[@name='"+profile+"']"); + String response = request(PaloAltoMethod.GET, params); + return (validResponse(response) && responseNotEmpty(response)); + } + + /* Command Interface */ + public interface IPaloAltoCommand { + public boolean execute() throws ExecutionException; + } + + /* Command Abstract */ + private abstract class AbstractPaloAltoCommand implements IPaloAltoCommand { + PaloAltoMethod method; + Map params; + + public AbstractPaloAltoCommand() {} + + public AbstractPaloAltoCommand(PaloAltoMethod method, Map params) { + this.method = method; + this.params = params; + } + + public boolean execute() throws ExecutionException { + String response = request(method, params); + return validResponse(response); + } + } + + /* Implement the default functionality */ + private class DefaultPaloAltoCommand extends AbstractPaloAltoCommand { + public DefaultPaloAltoCommand(PaloAltoMethod method, Map params) { + super(method, params); + } + } + + + /* + * Misc + */ + + private String genIpIdentifier(String ip) { + return ip.replace('.', '-').replace('/', '-'); + } + + private Protocol getProtocol(String protocolName) throws ExecutionException { + protocolName = protocolName.toLowerCase(); + + try { + return Protocol.valueOf(protocolName); + } catch (Exception e) { + throw new ExecutionException("Invalid protocol: " + protocolName); + } + } + + private Document getDocument(String xml) throws ExecutionException { + StringReader xmlReader = new StringReader(xml); + InputSource xmlSource = new InputSource(xmlReader); + Document doc = null; + + try { + doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlSource); + } catch (Exception e) { + s_logger.error(e); + throw new ExecutionException(e.getMessage()); + } + + if (doc == null) { + throw new ExecutionException("Failed to parse xml " + xml); + } else { + return doc; + } + } + + private String prettyFormat(String input) { + int indent = 4; + try { + Source xmlInput = new StreamSource(new StringReader(input)); + StringWriter stringWriter = new StringWriter(); + StreamResult xmlOutput = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + transformerFactory.setAttribute("indent-number", indent); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + transformer.transform(xmlInput, xmlOutput); + return xmlOutput.getWriter().toString(); + } catch (Throwable e) { + try { + Source xmlInput = new StreamSource(new StringReader(input)); + StringWriter stringWriter = new StringWriter(); + StreamResult xmlOutput = new StreamResult(stringWriter); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indent)); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + transformer.transform(xmlInput, xmlOutput); + return xmlOutput.getWriter().toString(); + } catch(Throwable t) { + return input; + } + } + } + + //@Override + public void setName(String name) { + // TODO Auto-generated method stub + + } + + //@Override + public void setConfigParams(Map params) { + // TODO Auto-generated method stub + + } + + //@Override + public Map getConfigParams() { + // TODO Auto-generated method stub + return null; + } + + //@Override + public int getRunLevel() { + // TODO Auto-generated method stub + return 0; + } + + //@Override + public void setRunLevel(int level) { + // TODO Auto-generated method stub + + } + +} diff --git a/plugins/network-elements/palo-alto/src/com/cloud/network/utils/HttpClientWrapper.java b/plugins/network-elements/palo-alto/src/com/cloud/network/utils/HttpClientWrapper.java new file mode 100644 index 00000000000..7e4057005cb --- /dev/null +++ b/plugins/network-elements/palo-alto/src/com/cloud/network/utils/HttpClientWrapper.java @@ -0,0 +1,69 @@ +package com.cloud.network.utils; + +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import org.apache.http.client.HttpClient; +import org.apache.http.conn.ClientConnectionManager; +import org.apache.http.conn.scheme.Scheme; +import org.apache.http.conn.scheme.SchemeRegistry; +import org.apache.http.conn.ssl.SSLSocketFactory; +import org.apache.http.conn.ssl.X509HostnameVerifier; +import org.apache.http.impl.client.DefaultHttpClient; + +import java.io.*; + +public class HttpClientWrapper { + + public static HttpClient wrapClient(HttpClient base) { + try { + SSLContext ctx = SSLContext.getInstance("TLS"); + X509TrustManager tm = new X509TrustManager() { + + public void checkClientTrusted(X509Certificate[] xcs, String string) throws CertificateException { + } + + public void checkServerTrusted(X509Certificate[] xcs, String string) throws CertificateException { + } + + public X509Certificate[] getAcceptedIssuers() { + return null; + } + }; + X509HostnameVerifier verifier = new X509HostnameVerifier() { + + @Override + public void verify(String string, SSLSocket ssls) throws IOException { + } + + @Override + public void verify(String string, X509Certificate xc) throws SSLException { + } + + @Override + public void verify(String string, String[] strings, String[] strings1) throws SSLException { + } + + @Override + public boolean verify(String string, SSLSession ssls) { + return true; + } + }; + ctx.init(null, new TrustManager[]{tm}, null); + SSLSocketFactory ssf = new SSLSocketFactory(ctx); + ssf.setHostnameVerifier(verifier); + ClientConnectionManager ccm = base.getConnectionManager(); + SchemeRegistry sr = ccm.getSchemeRegistry(); + sr.register(new Scheme("https", ssf, 443)); + return new DefaultHttpClient(ccm, base.getParams()); + } catch (Exception ex) { + ex.printStackTrace(); + return null; + } + } +} \ No newline at end of file diff --git a/plugins/network-elements/palo-alto/test/com/cloud/network/resource/MockablePaloAltoResource.java b/plugins/network-elements/palo-alto/test/com/cloud/network/resource/MockablePaloAltoResource.java new file mode 100755 index 00000000000..9a9eb6e0c2e --- /dev/null +++ b/plugins/network-elements/palo-alto/test/com/cloud/network/resource/MockablePaloAltoResource.java @@ -0,0 +1,460 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.resource; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import javax.naming.ConfigurationException; +import javax.xml.parsers.DocumentBuilderFactory; + +import com.cloud.agent.IAgentControl; +import com.cloud.agent.api.Answer; +import com.cloud.agent.api.Command; +import com.cloud.agent.api.ExternalNetworkResourceUsageAnswer; +import com.cloud.agent.api.ExternalNetworkResourceUsageCommand; +import com.cloud.agent.api.MaintainAnswer; +import com.cloud.agent.api.MaintainCommand; +import com.cloud.agent.api.PingCommand; +import com.cloud.agent.api.ReadyAnswer; +import com.cloud.agent.api.ReadyCommand; +import com.cloud.agent.api.StartupCommand; +import com.cloud.agent.api.StartupExternalFirewallCommand; +import com.cloud.agent.api.routing.IpAssocAnswer; +import com.cloud.agent.api.routing.IpAssocCommand; +import com.cloud.agent.api.routing.NetworkElementCommand; +import com.cloud.agent.api.routing.SetFirewallRulesCommand; +import com.cloud.agent.api.routing.SetPortForwardingRulesCommand; +import com.cloud.agent.api.routing.SetStaticNatRulesCommand; +import com.cloud.agent.api.to.FirewallRuleTO; +import com.cloud.agent.api.to.IpAddressTO; +import com.cloud.agent.api.to.PortForwardingRuleTO; +import com.cloud.agent.api.to.StaticNatRuleTO; +import com.cloud.host.Host; +import com.cloud.network.rules.FirewallRule; +import com.cloud.network.rules.FirewallRule.TrafficType; +import com.cloud.network.rules.FirewallRule.Purpose; +import com.cloud.resource.ServerResource; +import com.cloud.utils.NumbersUtil; +import com.cloud.utils.exception.ExecutionException; +import com.cloud.utils.net.NetUtils; +import com.cloud.utils.script.Script; + +// http client handling +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.BasicResponseHandler; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.NameValuePair; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.protocol.HTTP; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.net.URLDecoder; +import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import com.cloud.network.utils.HttpClientWrapper; + +// for prettyFormat() +import javax.xml.transform.stream.StreamSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import java.io.StringWriter; + + +public class MockablePaloAltoResource extends PaloAltoResource { + private HashMap context; + public void setMockContext(HashMap context) { + this.context = context; + } + + /* Fake the calls to the Palo Alto API */ + protected String request(PaloAltoMethod method, Map params) throws ExecutionException { + if (method != PaloAltoMethod.GET && method != PaloAltoMethod.POST) { + throw new ExecutionException("Invalid http method used to access the Palo Alto API."); + } + + String response = ""; + + // 'keygen' request + if (params.containsKey("type") && params.get("type").equals("keygen")) { + response = "LUFRPT14MW5xOEo1R09KVlBZNnpnemh0VHRBOWl6TGM9bXcwM3JHUGVhRlNiY0dCR0srNERUQT09"; + } + + // 'config' requests + if (params.containsKey("type") && params.get("type").equals("config") && params.containsKey("action")) { + // action = 'get' + if (params.get("action").equals("get")) { + // get interface for type + // | public_using_ethernet + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/1']")) { + if (context.containsKey("public_using_ethernet") && context.get("public_using_ethernet").equals("true")) { + context.put("public_interface_type", "ethernet"); + response = "no20060064unspecifiedunspecified1800nononounspecifiedno3011noEUI-64nono20060064unspecifiedunspecified1800nononounspecifiedno3011noEUI-64no3033autoautoauto"; + } else { + response = ""; + } + } // | private_using_ethernet + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/2']")) { + if (context.containsKey("private_using_ethernet") && context.get("private_using_ethernet").equals("true")) { + context.put("private_interface_type", "ethernet"); + response = "no20060064unspecifiedunspecified1800nononounspecifiedno3011noEUI-64noautoautoauto"; + } else { + response = ""; + } + } + + // get management profile | has_management_profile + if (params.get("xpath").equals("/config/devices/entry/network/profiles/interface-management-profile/entry[@name='Ping']")) { + if (context.containsKey("has_management_profile") && context.get("has_management_profile").equals("true")) { + response = "yes"; + } else { + response = ""; + } + } + + // get public interface IP | has_public_interface + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/1']/layer3/units/entry[@name='ethernet1/1.9999']/ip/entry[@name='192.168.80.102/32']")) { + if (context.containsKey("has_public_interface") && context.get("has_public_interface").equals("true")) { + response = ""; + } else { + response = ""; + } + } + + // get private interface | has_private_interface + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/2']/layer3/units/entry[@name='ethernet1/2.3954']")) { + if (context.containsKey("has_private_interface") && context.get("has_private_interface").equals("true")) { + response = "3954Ping"; + } else { + response = ""; + } + } + + // get private interface ip + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/2']/layer3/units/entry[@name='ethernet1/2.3954']/ip/entry")) { + response = ""; + } + + // get source nat | has_src_nat_rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='src_nat.3954']")) { + if (context.containsKey("has_src_nat_rule") && context.get("has_src_nat_rule").equals("true")) { + response = "untrusttrust10.5.80.1/20anyanyipv4ethernet1/1.9999192.168.80.102/32ethernet1/1.9999"; + } else { + response = ""; + } + } + + // get isolation firewall rule | has_isolation_fw_rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='isolate_3954']")) { + if (context.containsKey("has_isolation_fw_rule") && context.get("has_isolation_fw_rule").equals("true")) { + response = "trusttrust10.5.80.0/2010.5.80.1anyanydenynoyes"; + } else { + response = ""; + } + } + + // get service | has_service + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/service/entry[@name='cs_tcp_80']")) { + if (context.containsKey("has_service_tcp_80") && context.get("has_service_tcp_80").equals("true")) { + response = "80"; + } else { + response = ""; + } + } + + // get egress firewall rule | has_egress_fw_rule | policy_0 + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='policy_0']")) { + if (context.containsKey("has_egress_fw_rule") && context.get("has_egress_fw_rule").equals("true")) { + response = "trustuntrust10.3.96.1/20anyanycs_tcp_80allownono"; + } else { + response = ""; + } + } + + // get ingress firewall rule | has_ingress_fw_rule | policy_8 + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='policy_8']")) { + if (context.containsKey("has_ingress_fw_rule") && context.get("has_ingress_fw_rule").equals("true")) { + response = "untrusttrustany192.168.80.103anycs_tcp_80allownono"; + } else { + response = ""; + } + } + + // get destination nat rule (port forwarding) | has_dst_nat_rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='dst_nat.192-168-80-103_9']")) { + if (context.containsKey("has_dst_nat_rule") && context.get("has_dst_nat_rule").equals("true")) { + response = "untrustuntrustany192.168.80.103cs_tcp_80ipv4ethernet1/1.999910.3.97.1588080"; + } else { + response = ""; + } + } + + // get destination nat rules (returns all dst nat rules per ip) + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[destination/member[text()='192.168.80.103']]")) { + if (context.containsKey("has_dst_nat_rule") && context.get("has_dst_nat_rule").equals("true")) { + response = "untrustuntrustany192.168.80.103cs_tcp_80ipv4ethernet1/1.999910.3.97.1588080"; + } else { + response = ""; + } + } + + // get static nat rule | has_stc_nat_rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='stc_nat.192-168-80-103_0']")) { + if (context.containsKey("has_stc_nat_rule") && context.get("has_stc_nat_rule").equals("true")) { + response = "untrustuntrustany192.168.80.103anyipv4ethernet1/1.999910.3.97.158"; + } else { + response = ""; + } + } + + } + + // action = 'set' + if (params.get("action").equals("set")) { + // set management profile + if (params.get("xpath").equals("/config/devices/entry/network/profiles/interface-management-profile/entry[@name='Ping']")) { + response = "command succeeded"; + context.put("has_management_profile", "true"); + } + + // add private interface + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/2']/layer3/units/entry[@name='ethernet1/2.3954']")) { + response = "command succeeded"; + context.put("has_private_interface", "true"); + } + + // add public ip to public interface + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/1']/layer3/units/entry[@name='ethernet1/1.9999']/ip")) { + response = "command succeeded"; + context.put("has_public_interface", "true"); + } + + // add private interface to zone + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/zone/entry[@name='trust']/network/layer3")) { + response = "command succeeded"; + } + + // add public interface to zone + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/zone/entry[@name='untrust']/network/layer3")) { + response = "command succeeded"; + } + + // set virtual router (public | private) + if (params.get("xpath").equals("/config/devices/entry/network/virtual-router/entry[@name='default']/interface")) { + response = "command succeeded"; + } + + // add interface to network (public | private) + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/import/network/interface")) { + response = "command succeeded"; + } + + // add src nat rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='src_nat.3954']")) { + response = "command succeeded"; + context.put("has_src_nat_rule", "true"); + } + + // add isolation firewall rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='isolate_3954']")) { + response = "command succeeded"; + context.put("has_isolation_fw_rule", "true"); + } + + // add egress firewall rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='policy_0']")) { + response = "command succeeded"; + context.put("has_egress_fw_rule", "true"); + } + + // add ingress firewall rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='policy_8']")) { + response = "command succeeded"; + context.put("has_ingress_fw_rule", "true"); + } + + // add destination nat rule (port forwarding) + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='dst_nat.192-168-80-103_9']")) { + response = "command succeeded"; + context.put("has_dst_nat_rule", "true"); + } + + // add static nat rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='stc_nat.192-168-80-103_0']")) { + response = "command succeeded"; + context.put("has_stc_nat_rule", "true"); + } + + // add tcp 80 service + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/service/entry[@name='cs_tcp_80']")) { + response = "command succeeded"; + context.put("has_service_tcp_80", "true"); + } + } + + // action = 'delete' + if (params.get("action").equals("delete")) { + // remove egress firewall rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='policy_0']")) { + response = "command succeeded"; + context.remove("has_egress_fw_rule"); + } + + // remove ingress firewall rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='policy_8']")) { + response = "command succeeded"; + context.remove("has_ingress_fw_rule"); + } + + // remove destination nat rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='dst_nat.192-168-80-103_9']")) { + response = "command succeeded"; + context.remove("has_dst_nat_rule"); + } + + // remove static nat rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='stc_nat.192-168-80-103_0']")) { + response = "command succeeded"; + context.remove("has_dst_nat_rule"); + } + + // remove public ip from interface (dst_nat | stc_nat) + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/1']/layer3/units/entry[@name='ethernet1/1.9999']/ip/entry[@name='192.168.80.103/32']")) { + response = "command succeeded"; + } + + // remove isolation firewall rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/security/rules/entry[@name='isolate_3954']")) { + response = "command succeeded"; + context.remove("has_isolation_fw_rule"); + } + + // remove source nat rule + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/rulebase/nat/rules/entry[@name='src_nat.3954']")) { + response = "command succeeded"; + context.remove("has_src_nat_rule"); + } + + // remove public source nat ip + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/1']/layer3/units/entry[@name='ethernet1/1.9999']/ip/entry[@name='192.168.80.102/32']")) { + response = "command succeeded"; + context.remove("has_public_interface"); + } + + // remove private interface from the zone + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/zone/entry[@name='trust']/network/layer3/member[text()='ethernet1/2.3954']")) { + response = "command succeeded"; + } + + // remove private interface from the virtual router + if (params.get("xpath").equals("/config/devices/entry/network/virtual-router/entry[@name='default']/interface/member[text()='ethernet1/2.3954']")) { + response = "command succeeded"; + } + + // remove private interface from network + if (params.get("xpath").equals("/config/devices/entry/vsys/entry[@name='vsys1']/import/network/interface/member[text()='ethernet1/2.3954']")) { + response = "command succeeded"; + } + + // remove private interface + if (params.get("xpath").equals("/config/devices/entry/network/interface/ethernet/entry[@name='ethernet1/2']/layer3/units/entry[@name='ethernet1/2.3954']")) { + response = "command succeeded"; + context.remove("has_private_interface"); + } + + } + } // end 'config' + + // 'op' requests + if (params.containsKey("type") && params.get("type").equals("op")) { + // check if there are pending changes + if (params.get("cmd").equals("")) { + if (context.containsKey("firewall_has_pending_changes") && context.get("firewall_has_pending_changes").equals("true")) { + response = "yes"; + } else { + response = "no"; + } + } + + // add a config lock + if (params.get("cmd").equals("")) { + response = "Successfully acquired lock. Other administrators will not be able to modify configuration for scope shared until lock is released"; + } + + // check job status + if (params.get("cmd").equals("1")) { + if (context.containsKey("simulate_commit_failure") && context.get("simulate_commit_failure").equals("true")) { + response = "2013/07/10 11:11:491adminCommitFINnoFAIL11:11:5411:11:54
Bad configCommit failed
"; + } else { + response = "2013/07/02 14:49:491adminCommitFINnoOK14:50:0214:50:02
Configuration committed successfully
"; + } + } + + // load from running config + if (params.get("cmd").equals("running-config.xml")) { + response = "Config loaded from running-config.xml"; + } + + // remove config lock + if (params.get("cmd").equals("")) { + response = "Config lock released for scope shared"; + } + } // end 'op' + + // 'commit' requests + if (params.containsKey("type") && params.get("type").equals("commit")) { + // cmd = '' + if (params.get("cmd").equals("")) { + response = "Commit job enqueued with jobid 11"; + } + } // end 'commit' + + + // print out the details into the console + if (context.containsKey("enable_console_output") && context.get("enable_console_output") == "true") { + if (params.containsKey("xpath")) { + System.out.println("XPATH("+params.get("action")+"): "+params.get("xpath")); + } + if (params.containsKey("type") && params.get("type").equals("op")) { + System.out.println("OP CMD: "+params.get("cmd")); + } + System.out.println(response+"\n"); + } + + return response; + } +} \ No newline at end of file diff --git a/plugins/network-elements/palo-alto/test/com/cloud/network/resource/PaloAltoResourceTest.java b/plugins/network-elements/palo-alto/test/com/cloud/network/resource/PaloAltoResourceTest.java new file mode 100755 index 00000000000..c2704734c6c --- /dev/null +++ b/plugins/network-elements/palo-alto/test/com/cloud/network/resource/PaloAltoResourceTest.java @@ -0,0 +1,507 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.resource; + +// test imports +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; +import org.junit.Before; +import org.junit.Test; + +import java.util.Collections; + +// basic imports +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import javax.naming.ConfigurationException; +import javax.xml.parsers.DocumentBuilderFactory; + +import com.cloud.agent.IAgentControl; +import com.cloud.agent.api.Answer; +import com.cloud.agent.api.Command; +import com.cloud.agent.api.ExternalNetworkResourceUsageAnswer; +import com.cloud.agent.api.ExternalNetworkResourceUsageCommand; +import com.cloud.agent.api.MaintainAnswer; +import com.cloud.agent.api.MaintainCommand; +import com.cloud.agent.api.PingCommand; +import com.cloud.agent.api.ReadyAnswer; +import com.cloud.agent.api.ReadyCommand; +import com.cloud.agent.api.StartupCommand; +import com.cloud.agent.api.StartupExternalFirewallCommand; +import com.cloud.agent.api.routing.IpAssocAnswer; +import com.cloud.agent.api.routing.IpAssocCommand; +import com.cloud.agent.api.routing.NetworkElementCommand; +import com.cloud.agent.api.routing.SetFirewallRulesCommand; +import com.cloud.agent.api.routing.SetPortForwardingRulesCommand; +import com.cloud.agent.api.routing.SetStaticNatRulesCommand; +import com.cloud.agent.api.to.FirewallRuleTO; +import com.cloud.agent.api.to.IpAddressTO; +import com.cloud.agent.api.to.PortForwardingRuleTO; +import com.cloud.agent.api.to.StaticNatRuleTO; +import com.cloud.host.Host; +import com.cloud.network.rules.FirewallRuleVO; +import com.cloud.network.rules.FirewallRule; +import com.cloud.network.rules.FirewallRule.TrafficType; +import com.cloud.network.rules.FirewallRule.Purpose; +import com.cloud.network.rules.FirewallRule.State; +import com.cloud.resource.ServerResource; +import com.cloud.utils.NumbersUtil; +import com.cloud.utils.exception.ExecutionException; +import com.cloud.utils.net.NetUtils; +import com.cloud.utils.script.Script; + +// http client handling +import org.apache.http.client.ResponseHandler; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.BasicResponseHandler; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.NameValuePair; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.protocol.HTTP; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.net.URLDecoder; +import javax.xml.xpath.XPathFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import com.cloud.network.utils.HttpClientWrapper; + +// for prettyFormat() +import javax.xml.transform.stream.StreamSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Source; +import java.io.StringWriter; + +public class PaloAltoResourceTest { + // configuration data + private String _test_name = "PaloAltoTestDevice"; + private String _test_zoneId = "TestZone"; + private String _test_ip = "192.168.80.2"; + private String _test_username = "admin"; + private String _test_password = "admin"; + private String _test_publicInterface = "ethernet1/1"; + private String _test_privateInterface = "ethernet1/2"; + private String _test_publicZone = "untrust"; + private String _test_privateZone = "trust"; + private String _test_virtualRouter = "default"; + + MockablePaloAltoResource _resource; + Map _resource_params; + HashMap _context; + + @Before + public void setUp() { + _resource = new MockablePaloAltoResource(); + _resource_params = new HashMap(); // params to be passed to configure() + _resource_params.put("name", _test_name); + _resource_params.put("zoneId", _test_zoneId); + _resource_params.put("ip", _test_ip); + _resource_params.put("username", _test_username); + _resource_params.put("password", _test_password); + _resource_params.put("publicinterface", _test_publicInterface); + _resource_params.put("privateinterface", _test_privateInterface); + _resource_params.put("publicnetwork", _test_publicZone); + _resource_params.put("privatenetwork", _test_privateZone); + _resource_params.put("pavr", _test_virtualRouter); + _resource_params.put("guid", "aaaaa-bbbbb-ccccc"); + + _context = new HashMap(); // global context + _context.put("name", _test_name); + _context.put("zone_id", _test_zoneId); + _context.put("ip", _test_ip); + _context.put("username", _test_username); + _context.put("password", _test_password); + _context.put("public_interface", _test_publicInterface); + _context.put("private_interface", _test_privateInterface); + _context.put("public_zone", _test_publicZone); + _context.put("private_zone", _test_privateZone); + _context.put("pa_vr", _test_virtualRouter); + // -- + _context.put("public_using_ethernet", "true"); + _context.put("private_using_ethernet", "true"); + _context.put("has_management_profile", "true"); + _context.put("enable_console_output", "false"); // CHANGE TO "true" TO ENABLE CONSOLE LOGGING OF TESTS + _resource.setMockContext(_context); + } + + @Test (expected=ConfigurationException.class) + public void resourceConfigureFailure() throws ConfigurationException { + _resource.configure("PaloAltoResource", new HashMap()); + } + + @Test + public void resourceConfigureWithoutManagementProfile() throws ConfigurationException { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: resourceConfigureWithoutManagementProfile"); + System.out.println("---------------------------------------------------"); + } + _context.remove("has_management_profile"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + } + + @Test + public void resourceConfigureWithManagementProfile() throws ConfigurationException { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: resourceConfigureWithManagementProfile"); + System.out.println("---------------------------------------------------"); + } + _resource.configure("PaloAltoResource", _resource_params); + } + + @Test (expected=ConfigurationException.class) + public void simulateFirewallNotConfigurable() throws ConfigurationException { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: simulateFirewallNotConfigurable"); + System.out.println("---------------------------------------------------"); + } + _context.put("firewall_has_pending_changes", "true"); + _context.remove("has_management_profile"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + } + + @Test (expected=ConfigurationException.class) + public void simulateFirewallCommitFailure() throws ConfigurationException { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: simulateFirewallCommitFailure"); + System.out.println("---------------------------------------------------"); + } + _context.put("simulate_commit_failure", "true"); + _context.remove("has_management_profile"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + } + + @Test + public void testInitialize() throws ConfigurationException { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: testInitialization"); + System.out.println("---------------------------------------------------"); + } + _resource.configure("PaloAltoResource", _resource_params); + + StartupCommand[] sc = _resource.initialize(); + assertTrue(sc.length == 1); + assertTrue("aaaaa-bbbbb-ccccc".equals(sc[0].getGuid())); + assertTrue("PaloAltoTestDevice".equals(sc[0].getName())); + assertTrue("TestZone".equals(sc[0].getDataCenter())); + } + + @Test // implement public & private interfaces, source nat, guest network + public void implementGuestNetwork() throws ConfigurationException, ExecutionException { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: implementGuestNetwork"); + System.out.println("---------------------------------------------------"); + } + _resource.configure("PaloAltoResource", _resource_params); + + IpAddressTO ip = new IpAddressTO(Long.valueOf("1"), "192.168.80.102", true, false, true, "untagged", null, null, null, 100, false); + IpAddressTO[] ips = new IpAddressTO[1]; + ips[0] = ip; + IpAssocCommand cmd = new IpAssocCommand(ips); + cmd.setAccessDetail(NetworkElementCommand.GUEST_NETWORK_GATEWAY, "10.3.96.1"); + cmd.setAccessDetail(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + cmd.setAccessDetail(NetworkElementCommand.GUEST_VLAN_TAG, "3954"); + + IpAssocAnswer answer = (IpAssocAnswer) _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test // remove public & private interface details, source nat, guest network + public void shutdownGuestNetwork() throws ConfigurationException, ExecutionException { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: shutdownGuestNetwork"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + IpAddressTO ip = new IpAddressTO(Long.valueOf("1"), "192.168.80.102", false, false, true, "untagged", null, null, null, 100, false); + IpAddressTO[] ips = new IpAddressTO[1]; + ips[0] = ip; + IpAssocCommand cmd = new IpAssocCommand(ips); + cmd.setAccessDetail(NetworkElementCommand.GUEST_NETWORK_GATEWAY, "10.3.96.1"); + cmd.setAccessDetail(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + cmd.setAccessDetail(NetworkElementCommand.GUEST_VLAN_TAG, "3954"); + + IpAssocAnswer answer = (IpAssocAnswer) _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test + public void addIngressFirewallRule() throws ConfigurationException, Exception { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: addIngressFirewallRule"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _context.put("has_service_tcp_80", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + long vlanId = 3954; + List rules = new ArrayList(); + List cidrList = new ArrayList(); + cidrList.add("0.0.0.0/0"); + FirewallRuleTO active = new FirewallRuleTO(8, + null, "192.168.80.103", "tcp", 80, 80, false, false, + FirewallRule.Purpose.Firewall, cidrList, null, null); + rules.add(active); + + SetFirewallRulesCommand cmd = new SetFirewallRulesCommand(rules); + cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId)); + cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + + Answer answer = _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test + public void removeIngressFirewallRule() throws ConfigurationException, Exception { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: removeIngressFirewallRule"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _context.put("has_service_tcp_80", "true"); + _context.put("has_ingress_fw_rule", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + long vlanId = 3954; + List rules = new ArrayList(); + FirewallRuleTO revoked = new FirewallRuleTO(8, + null, "192.168.80.103", "tcp", 80, 80, true, false, + FirewallRule.Purpose.Firewall, null, null, null); + rules.add(revoked); + + SetFirewallRulesCommand cmd = new SetFirewallRulesCommand(rules); + cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId)); + cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + + Answer answer = _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test + public void addEgressFirewallRule() throws ConfigurationException, Exception { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: addEgressFirewallRule"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _context.put("has_service_tcp_80", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + long vlanId = 3954; + List rules = new ArrayList(); + List cidrList = new ArrayList(); + cidrList.add("0.0.0.0/0"); + FirewallRuleVO activeVO = new FirewallRuleVO(null, null, 80, 80, "tcp", + 1, 1, 1, Purpose.Firewall, cidrList, null, + null, null, FirewallRule.TrafficType.Egress); + FirewallRuleTO active = new FirewallRuleTO(activeVO, Long.toString(vlanId), null, Purpose.Firewall, FirewallRule.TrafficType.Egress); + rules.add(active); + + SetFirewallRulesCommand cmd = new SetFirewallRulesCommand(rules); + cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId)); + cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + + Answer answer = _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test + public void removeEgressFirewallRule() throws ConfigurationException, Exception { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: removeEgressFirewallRule"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _context.put("has_service_tcp_80", "true"); + _context.put("has_egress_fw_rule", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + long vlanId = 3954; + List rules = new ArrayList(); + FirewallRuleVO revokedVO = new FirewallRuleVO(null, null, 80, 80, "tcp", + 1, 1, 1, Purpose.Firewall, null, null, null, null, FirewallRule.TrafficType.Egress); + revokedVO.setState(State.Revoke); + FirewallRuleTO revoked = new FirewallRuleTO(revokedVO, Long.toString(vlanId), null, Purpose.Firewall, FirewallRule.TrafficType.Egress); + rules.add(revoked); + + SetFirewallRulesCommand cmd = new SetFirewallRulesCommand(rules); + cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId)); + cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + + Answer answer = _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test + public void addStaticNatRule() throws ConfigurationException, Exception { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: addStaticNatRule"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _context.put("has_service_tcp_80", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + long vlanId = 3954; + List rules = new ArrayList(); + StaticNatRuleTO active = new StaticNatRuleTO(0, "192.168.80.103", null, + null, "10.3.97.158", null, null, null, false, false); + rules.add(active); + + SetStaticNatRulesCommand cmd = new SetStaticNatRulesCommand(rules, null); + cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId)); + cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + + Answer answer = _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test + public void removeStaticNatRule() throws ConfigurationException, Exception { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: removeStaticNatRule"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _context.put("has_service_tcp_80", "true"); + _context.put("has_stc_nat_rule", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + long vlanId = 3954; + List rules = new ArrayList(); + StaticNatRuleTO revoked = new StaticNatRuleTO(0, "192.168.80.103", null, + null, "10.3.97.158", null, null, null, true, false); + rules.add(revoked); + + SetStaticNatRulesCommand cmd = new SetStaticNatRulesCommand(rules, null); + cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId)); + cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + + Answer answer = _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test + public void addPortForwardingRule() throws ConfigurationException, Exception { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: addPortForwardingRule"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _context.put("has_service_tcp_80", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + long vlanId = 3954; + List rules = new ArrayList(); + PortForwardingRuleTO active = new PortForwardingRuleTO(9, "192.168.80.103", 80, + 80, "10.3.97.158", 8080, 8080, "tcp", false, false); + rules.add(active); + + SetPortForwardingRulesCommand cmd = new SetPortForwardingRulesCommand(rules); + cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId)); + cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + + Answer answer = _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } + + @Test + public void removePortForwardingRule() throws ConfigurationException, Exception { + if (_context.containsKey("enable_console_output") && _context.get("enable_console_output").equals("true")) { + System.out.println("\nTEST: removePortForwardingRule"); + System.out.println("---------------------------------------------------"); + } + _context.put("has_public_interface", "true"); + _context.put("has_private_interface", "true"); + _context.put("has_src_nat_rule", "true"); + _context.put("has_isolation_fw_rule", "true"); + _context.put("has_service_tcp_80", "true"); + _context.put("has_dst_nat_rule", "true"); + _resource.setMockContext(_context); + _resource.configure("PaloAltoResource", _resource_params); + + long vlanId = 3954; + List rules = new ArrayList(); + PortForwardingRuleTO revoked = new PortForwardingRuleTO(9, "192.168.80.103", 80, + 80, "10.3.97.158", 8080, 8080, "tcp", true, false); + rules.add(revoked); + + SetPortForwardingRulesCommand cmd = new SetPortForwardingRulesCommand(rules); + cmd.setContextParam(NetworkElementCommand.GUEST_VLAN_TAG, Long.toString(vlanId)); + cmd.setContextParam(NetworkElementCommand.GUEST_NETWORK_CIDR, "10.3.96.1/20"); + + Answer answer = _resource.executeRequest(cmd); + assertTrue(answer.getResult()); + } +} + diff --git a/plugins/pom.xml b/plugins/pom.xml index 4f193bcde0c..d0817a2ddc8 100755 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -44,6 +44,7 @@ network-elements/elastic-loadbalancer network-elements/ovs network-elements/juniper-contrail + network-elements/palo-alto network-elements/nicira-nvp network-elements/bigswitch-vns network-elements/midonet diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 769d34562c3..36ef4bd9dc0 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -2631,7 +2631,7 @@ public class ApiResponseHelper implements ResponseGenerator { List serviceProvidersResponses = new ArrayList(); for (Network.Provider serviceProvider : serviceProviders) { // return only Virtual Router/JuniperSRX/CiscoVnmc as a provider for the firewall - if (service == Service.Firewall && !(serviceProvider == Provider.VirtualRouter || serviceProvider == Provider.JuniperSRX || serviceProvider == Provider.CiscoVnmc)) { + if (service == Service.Firewall && !(serviceProvider == Provider.VirtualRouter || serviceProvider == Provider.JuniperSRX || serviceProvider == Provider.CiscoVnmc || serviceProvider == Provider.PaloAlto)) { continue; } diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index e3aa4fa7617..2e9b3889dfb 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -3792,6 +3792,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati firewallProvider = provider; } + if (provider == Provider.PaloAlto) { + firewallProvider = Provider.PaloAlto; + } + if ((service == Service.PortForwarding || service == Service.StaticNat) && provider == Provider.VirtualRouter) { firewallProvider = Provider.VirtualRouter; diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index 85f24c6aa43..8bd547bf3ce 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -322,6 +322,7 @@ dictionary = { 'label.add.new.gateway': '', 'label.add.new.NetScaler': '', 'label.add.new.SRX': '', +'label.add.new.PA': '', 'label.add.new.tier': '', 'label.add.NiciraNvp.device': '', 'label.add.pod': '', @@ -334,6 +335,7 @@ dictionary = { 'label.add.security.group': '', 'label.add.service.offering': '', 'label.add.SRX.device': '', +'label.add.PA.device': '', 'label.add.static.nat.rule': '', 'label.add.static.route': '', 'label.add.system.service.offering': '', @@ -480,6 +482,7 @@ dictionary = { 'label.delete.NiciraNvp': '', 'label.delete.project': '', 'label.delete.SRX': '', +'label.delete.PA': '', 'label.delete.VPN.connection': '', 'label.delete.VPN.customer.gateway': '', 'label.delete.VPN.gateway': '', @@ -859,6 +862,8 @@ dictionary = { 'label.owned.public.ips': '', 'label.owner.account': '', 'label.owner.domain': '', +'label.PA.log.profile': '', +'label.PA.threat.profile': '', 'label.parent.domain': '', 'label.password.enabled': '', 'label.password': '', @@ -1031,6 +1036,7 @@ dictionary = { 'label.specify.vxlan': '', 'label.SR.name ': '', 'label.srx': '', +'label.PA': '', 'label.start.IP': '', 'label.start.port': '', 'label.start.reserved.system.IP': '', @@ -1332,6 +1338,7 @@ dictionary = { 'message.confirm.delete.F5': '', 'message.confirm.delete.NetScaler': '', 'message.confirm.delete.SRX': '', +'message.confirm.delete.PA': '', 'message.confirm.destroy.router': '', 'message.confirm.disable.provider': '', 'message.confirm.enable.provider': '', diff --git a/ui/scripts/docs.js b/ui/scripts/docs.js index 3a4f8ca604f..7b7edf47bc4 100755 --- a/ui/scripts/docs.js +++ b/ui/scripts/docs.js @@ -770,6 +770,75 @@ cloudStack.docs = { desc: 'Number of guest networks/accounts that will share this device', externalLink: '' }, + // Add Palo Alto + helpPaloAltoIPAddress: { + desc: 'The IP address of the device', + externalLink: '' + }, + helpPaloAltoUsername: { + desc: 'A user ID with valid authentication credentials that provide to access the device', + externalLink: '' + }, + helpPaloAltoPassword: { + desc: 'The password for the user ID provided in Username', + externalLink: '' + }, + helpPaloAltoType: { + desc: 'The type of device that is being added', + externalLink: '' + }, + helpPaloAltoPublicInterface: { + desc: 'Interface of device that is configured to be part of the public network. For example, ge-0/0/2', + externalLink: '' + }, + helpPaloAltoPrivateInterface: { + desc: 'Interface of device that is configured to be part of the private network. For example, ge-0/0/1', + externalLink: '' + }, + helpPaloAltoUsageInterface: { + desc: 'Interface used to meter traffic. If you don\'t want to use the public interface, specify a different interface name here.', + externalLink: '' + }, + helpPaloAltoRetries: { + desc: 'Number of times to attempt a command on the device before considering the operation failed. Default is 2.', + externalLink: '' + }, + helpPaloAltoTimeout: { + desc: 'The time to wait for a command on the Palo Alto before considering it failed. Default is 300 seconds.', + externalLink: '' + }, + helpPaloAltoMode: { + desc: 'Side by side mode is supported for the Palo Alto.', + externalLink: '' + }, + helpPaloAltoPublicNetwork: { + desc: 'The name of the public network on the Palo Alto. For example, trust.', + externalLink: '' + }, + helpPaloAltoPrivateNetwork: { + desc: 'The name of the private network on the Palo Alto. For example, untrust.', + externalLink: '' + }, + helpPaloAltoVirtualRouter: { + desc: 'The name of the virtual router on the Palo Alto.', + externalLink: '' + }, + helpPaloAltoThreatProfile: { + desc: 'The threat profile name/group to associate with allow firewall policies.', + externalLink: '' + }, + helpPaloAltoLogProfile: { + desc: 'The log profile name/group to associate with allow firewall policies.', + externalLink: '' + }, + helpPaloAltoDedicated: { + desc: 'Check this box to dedicate the device to a single account. The value in the Capacity field will be ignored.', + externalLink: '' + }, + helpPaloAltoCapacity: { + desc: 'Number of guest networks/accounts that will share this device', + externalLink: '' + }, // Add system service offering helpSystemOfferingName: { desc: 'Any desired name for the offering', diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 1579d16c74d..fa22811cd8b 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -4944,6 +4944,288 @@ } }, + // Palo Alto provider detailView + pa: { + type: 'detailView', + id: 'paProvider', + label: 'label.PA', + viewAll: { + label: 'label.devices', + path: '_zone.paDevices' + }, + tabs: { + details: { + title: 'label.details', + fields: [{ + name: { + label: 'label.name' + } + }, { + state: { + label: 'label.state' + } + }], + dataProvider: function (args) { + refreshNspData("PaloAlto"); + var providerObj; + $(nspHardcodingArray).each(function () { + if (this.id == "pa") { + providerObj = this; + return false; //break each loop + } + }); + args.response.success({ + data: providerObj, + actionFilter: networkProviderActionFilter('pa') + }); + } + } + }, + actions: { + add: { + label: 'label.add.PA.device', + createForm: { + title: 'label.add.PA.device', + fields: { + ip: { + label: 'label.ip.address', + docID: 'helpPaloAltoIPAddress' + }, + username: { + label: 'label.username', + docID: 'helpPaloAltoUsername' + }, + password: { + label: 'label.password', + isPassword: true, + docID: 'helpPaloAltoPassword' + }, + networkdevicetype: { + label: 'label.type', + docID: 'helpPaloAltoType', + select: function (args) { + var items = []; + items.push({ + id: "PaloAltoFirewall", + description: "Palo Alto Firewall" + }); + args.response.success({ + data: items + }); + } + }, + publicinterface: { + label: 'label.public.interface', + docID: 'helpPaloAltoPublicInterface' + }, + privateinterface: { + label: 'label.private.interface', + docID: 'helpPaloAltoPrivateInterface' + }, + //usageinterface: { + // label: 'Usage interface', + // docID: 'helpPaloAltoUsageInterface' + //}, + numretries: { + label: 'label.numretries', + defaultValue: '2', + docID: 'helpPaloAltoRetries' + }, + timeout: { + label: 'label.timeout', + defaultValue: '300', + docID: 'helpPaloAltoTimeout' + }, + // inline: { + // label: 'Mode', + // docID: 'helpPaloAltoMode', + // select: function(args) { + // var items = []; + // items.push({id: "false", description: "side by side"}); + // items.push({id: "true", description: "inline"}); + // args.response.success({data: items}); + // } + // }, + publicnetwork: { + label: 'label.public.network', + defaultValue: 'untrust', + docID: 'helpPaloAltoPublicNetwork' + }, + privatenetwork: { + label: 'label.private.network', + defaultValue: 'trust', + docID: 'helpPaloAltoPrivateNetwork' + }, + pavr: { + label: 'label.virtual.router', + docID: 'helpPaloAltoVirtualRouter' + }, + patp: { + label: 'label.PA.threat.profile', + docID: 'helpPaloAltoThreatProfile' + }, + palp: { + label: 'label.PA.log.profile', + docID: 'helpPaloAltoLogProfile' + }, + capacity: { + label: 'label.capacity', + validation: { + required: false, + number: true + }, + docID: 'helpPaloAltoCapacity' + }, + dedicated: { + label: 'label.dedicated', + isBoolean: true, + isChecked: false, + docID: 'helpPaloAltoDedicated' + } + } + }, + action: function (args) { + if (nspMap["pa"] == null) { + $.ajax({ + url: createURL("addNetworkServiceProvider&name=PaloAlto&physicalnetworkid=" + selectedPhysicalNetworkObj.id), + dataType: "json", + async: true, + success: function (json) { + var jobId = json.addnetworkserviceproviderresponse.jobid; + var addPaloAltoProviderIntervalID = setInterval(function () { + $.ajax({ + url: createURL("queryAsyncJobResult&jobId=" + jobId), + dataType: "json", + success: function (json) { + var result = json.queryasyncjobresultresponse; + if (result.jobstatus == 0) { + return; //Job has not completed + } else { + clearInterval(addPaloAltoProviderIntervalID); + if (result.jobstatus == 1) { + nspMap["pa"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider; + addExternalFirewall(args, selectedPhysicalNetworkObj, "addPaloAltoFirewall", "addpaloaltofirewallresponse", "pafirewall"); + } else if (result.jobstatus == 2) { + alert("addNetworkServiceProvider&name=Palo Alto failed. Error: " + _s(result.jobresult.errortext)); + } + } + }, + error: function (XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + alert("addNetworkServiceProvider&name=Palo Alto failed. Error: " + errorMsg); + } + }); + }, 3000); + } + }); + } else { + addExternalFirewall(args, selectedPhysicalNetworkObj, "addPaloAltoFirewall", "addpaloaltofirewallresponse", "pafirewall"); + } + }, + messages: { + notification: function (args) { + return 'label.add.PA.device'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + enable: { + label: 'label.enable.provider', + action: function (args) { + $.ajax({ + url: createURL("updateNetworkServiceProvider&id=" + nspMap["pa"].id + "&state=Enabled"), + dataType: "json", + success: function (json) { + var jid = json.updatenetworkserviceproviderresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function (json) { + $(window).trigger('cloudStack.fullRefresh'); + } + } + }); + } + }); + }, + messages: { + confirm: function (args) { + return 'message.confirm.enable.provider'; + }, + notification: function () { + return 'label.enable.provider'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + disable: { + label: 'label.disable.provider', + action: function (args) { + $.ajax({ + url: createURL("updateNetworkServiceProvider&id=" + nspMap["pa"].id + "&state=Disabled"), + dataType: "json", + success: function (json) { + var jid = json.updatenetworkserviceproviderresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function (json) { + $(window).trigger('cloudStack.fullRefresh'); + } + } + }); + } + }); + }, + messages: { + confirm: function (args) { + return 'message.confirm.disable.provider'; + }, + notification: function () { + return 'label.disable.provider'; + } + }, + notification: { + poll: pollAsyncJobResult + } + }, + destroy: { + label: 'label.shutdown.provider', + action: function (args) { + $.ajax({ + url: createURL("deleteNetworkServiceProvider&id=" + nspMap["pa"].id), + dataType: "json", + success: function (json) { + var jid = json.deletenetworkserviceproviderresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + + $(window).trigger('cloudStack.fullRefresh'); + } + }); + }, + messages: { + confirm: function (args) { + return 'message.confirm.shutdown.provider'; + }, + notification: function (args) { + return 'label.shutdown.provider'; + } + }, + notification: { + poll: pollAsyncJobResult + } + } + } + }, + // Security groups detail view securityGroups: { id: 'securityGroup-providers', @@ -9156,6 +9438,250 @@ } } }, + + //Palo Alto devices listView + paDevices: { + id: 'paDevices', + title: 'label.devices', + listView: { + id: 'paDevices', + fields: { + ipaddress: { + label: 'label.ip.address' + }, + fwdevicestate: { + label: 'label.status' + }, + fwdevicename: { + label: 'label.type' + } + }, + actions: { + add: { + label: 'label.add.PA.device', + createForm: { + title: 'label.add.PA.device', + fields: { + ip: { + label: 'label.ip.address' + }, + username: { + label: 'label.username' + }, + password: { + label: 'label.password', + isPassword: true + }, + networkdevicetype: { + label: 'label.type', + select: function (args) { + var items = []; + items.push({ + id: "PaloAltoFirewall", + description: "Palo Alto Firewall" + }); + args.response.success({ + data: items + }); + } + }, + publicinterface: { + label: 'label.public.interface' + }, + privateinterface: { + label: 'label.private.interface' + }, + //usageinterface: { + // label: 'label.usage.interface' + //}, + numretries: { + label: 'label.numretries', + defaultValue: '2' + }, + timeout: { + label: 'label.timeout', + defaultValue: '300' + }, + // inline: { + // label: 'Mode', + // select: function(args) { + // var items = []; + // items.push({id: "false", description: "side by side"}); + // items.push({id: "true", description: "inline"}); + // args.response.success({data: items}); + // } + // }, + publicnetwork: { + label: 'label.public.network', + defaultValue: 'untrust' + }, + privatenetwork: { + label: 'label.private.network', + defaultValue: 'trust' + }, + pavr: { + label: 'label.virtual.router' + }, + patp: { + label: 'label.PA.threat.profile' + }, + palp: { + label: 'label.PA.log.profile' + }, + capacity: { + label: 'label.capacity', + validation: { + required: false, + number: true + } + }, + dedicated: { + label: 'label.dedicated', + isBoolean: true, + isChecked: false + } + } + }, + action: function (args) { + if (nspMap["pa"] == null) { + $.ajax({ + url: createURL("addNetworkServiceProvider&name=PaloAlto&physicalnetworkid=" + selectedPhysicalNetworkObj.id), + dataType: "json", + async: true, + success: function (json) { + var jobId = json.addnetworkserviceproviderresponse.jobid; + var addPaloAltoProviderIntervalID = setInterval(function () { + $.ajax({ + url: createURL("queryAsyncJobResult&jobId=" + jobId), + dataType: "json", + success: function (json) { + var result = json.queryasyncjobresultresponse; + if (result.jobstatus == 0) { + return; //Job has not completed + } else { + clearInterval(addPaloAltoProviderIntervalID); + if (result.jobstatus == 1) { + nspMap["pa"] = json.queryasyncjobresultresponse.jobresult.networkserviceprovider; + addExternalFirewall(args, selectedPhysicalNetworkObj, "addPaloAltoFirewall", "addpaloaltofirewallresponse", "pafirewall"); + } else if (result.jobstatus == 2) { + alert("addNetworkServiceProvider&name=Palo Alto failed. Error: " + _s(result.jobresult.errortext)); + } + } + }, + error: function (XMLHttpResponse) { + var errorMsg = parseXMLHttpResponse(XMLHttpResponse); + alert("addNetworkServiceProvider&name=Palo Alto failed. Error: " + errorMsg); + } + }); + }, 3000); + } + }); + } else { + addExternalFirewall(args, selectedPhysicalNetworkObj, "addPaloAltoFirewall", "addpaloaltofirewallresponse", "pafirewall"); + } + }, + messages: { + notification: function (args) { + return 'label.add.PA.device'; + } + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + dataProvider: function (args) { + $.ajax({ + url: createURL("listPaloAltoFirewalls&physicalnetworkid=" + selectedPhysicalNetworkObj.id), + data: { + page: args.page, + pageSize: pageSize + }, + dataType: "json", + async: false, + success: function (json) { + var items = json.listpaloaltofirewallresponse.paloaltofirewall; + args.response.success({ + data: items + }); + } + }); + }, + detailView: { + name: 'Palo Alto details', + actions: { + 'remove': { + label: 'label.delete.PA', + messages: { + confirm: function (args) { + return 'message.confirm.delete.PA'; + }, + notification: function (args) { + return 'label.delete.PA'; + } + }, + action: function (args) { + $.ajax({ + url: createURL("deletePaloAltoFirewall&fwdeviceid=" + args.context.paDevices[0].fwdeviceid), + dataType: "json", + async: true, + success: function (json) { + var jid = json.deletepaloaltofirewallresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + details: { + title: 'label.details', + fields: [{ + fwdeviceid: { + label: 'label.id' + }, + ipaddress: { + label: 'label.ip.address' + }, + fwdevicestate: { + label: 'label.status' + }, + fwdevicename: { + label: 'label.type' + }, + fwdevicecapacity: { + label: 'label.capacity' + }, + timeout: { + label: 'label.timeout' + } + }], + dataProvider: function (args) { + $.ajax({ + url: createURL("listPaloAltoFirewalls&fwdeviceid=" + args.context.paDevices[0].fwdeviceid), + dataType: "json", + async: true, + success: function (json) { + var item = json.listpaloaltofirewallresponse.paloaltofirewall[0]; + args.response.success({ + data: item + }); + } + }); + } + } + } + } + } + }, + // FIXME convert to nicira detailview // NiciraNvp devices listView niciraNvpDevices: { @@ -15763,6 +16289,44 @@ } url.push("fwdevicededicated=" + dedicated.toString()); + // START - Palo Alto Specific Fields + var externalVirtualRouter = args.data.pavr; + if(externalVirtualRouter != null && externalVirtualRouter.length > 0) { + if(isQuestionMarkAdded == false) { + url.push("?"); + isQuestionMarkAdded = true; + } + else { + url.push("&"); + } + url.push("pavr=" + encodeURIComponent(externalVirtualRouter)); + } + + var externalThreatProfile = args.data.patp; + if(externalThreatProfile != null && externalThreatProfile.length > 0) { + if(isQuestionMarkAdded == false) { + url.push("?"); + isQuestionMarkAdded = true; + } + else { + url.push("&"); + } + url.push("patp=" + encodeURIComponent(externalThreatProfile)); + } + + var externalLogProfile = args.data.palp; + if(externalLogProfile != null && externalLogProfile.length > 0) { + if(isQuestionMarkAdded == false) { + url.push("?"); + isQuestionMarkAdded = true; + } + else { + url.push("&"); + } + url.push("palp=" + encodeURIComponent(externalLogProfile)); + } + // END - Palo Alto Specific Fields + array1.push("&url=" + todb(url.join(""))); //construct URL ends here @@ -16495,6 +17059,9 @@ case "JuniperSRX": nspMap["srx"] = items[i]; break; + case "PaloAlto": + nspMap["pa"] = items[i]; + break; case "SecurityGroupProvider": nspMap["securityGroups"] = items[i]; break; @@ -16576,6 +17143,11 @@ name: 'SRX', state: nspMap.srx ? nspMap.srx.state : 'Disabled' }); + nspHardcodingArray.push({ + id: 'pa', + name: 'Palo Alto', + state: nspMap.pa ? nspMap.pa.state : 'Disabled' + }); } }; From 8def7e9f89187f5442a93269a9780d1da97452e7 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Wed, 6 Nov 2013 10:28:26 -0800 Subject: [PATCH 031/108] Remove scrollbars from login screen --- ui/css/cloudstack3.css | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 8676737ddc8..2135e8e0dc7 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -318,6 +318,7 @@ table th div.ui-resizable-handle { body.login { background: url(../images/overlay-pattern.png) repeat center, #106CA9 url(../images/bg-login.jpg) no-repeat center; background-size: auto, cover; + overflow: hidden; } .login { From ff0bfe209c3f211d57acc2d2b5027bae134b7072 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 5 Nov 2013 15:11:05 -0800 Subject: [PATCH 032/108] CLOUDSTACK-5048: UI > Create Load Balancing rule > hide Autoscale button if LB provider is not Netscaler since Autoscale is only supported on Netscaler, but not on other provider like VirtualRouter. --- ui/scripts/network.js | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 4915691d737..c26a6a8b91d 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -3369,11 +3369,41 @@ buttonLabel: 'label.configure', action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler) }, - isHidden: function(args) { - // return 2 == hide header and form, as well as returned item column - // return 2; - - return false; + isHidden: function(args) { + var lbProviderIsNetscaler = false; + $.ajax({ + url: createURL('listNetworkOfferings'), + data: { + id: args.context.networks[0].networkofferingid + }, + async: false, + success: function(json) { + var networkOffering = json.listnetworkofferingsresponse.networkoffering[0]; + var services = networkOffering.service; + if (services != null) { + for (var i = 0; i < services.length; i++) { + if (services[i].name == 'Lb') { + var providers = services[i].provider; + if (providers != null) { + for (var k = 0; k < providers.length; k++) { + if (providers[k].name == 'Netscaler') { + lbProviderIsNetscaler = true; + break; + } + } + } + break; + } + } + } + } + }); + + if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter) + return false; //show AutoScale button + } else { + return 2; //hide Autoscale button (both header and form) + } } }, From 2018e1a5880227f76a93503b3b9db4b30e4836a8 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 6 Nov 2013 11:36:03 -0800 Subject: [PATCH 033/108] CLOUDSTACK-5048: UI > VPC section > Create Load Balancing rule > hide Autoscale button since Autoscale is not supported in VPC. --- ui/scripts/network.js | 72 +++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index c26a6a8b91d..d2b2c4da26d 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -3369,41 +3369,45 @@ buttonLabel: 'label.configure', action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler) }, - isHidden: function(args) { - var lbProviderIsNetscaler = false; - $.ajax({ - url: createURL('listNetworkOfferings'), - data: { - id: args.context.networks[0].networkofferingid - }, - async: false, - success: function(json) { - var networkOffering = json.listnetworkofferingsresponse.networkoffering[0]; - var services = networkOffering.service; - if (services != null) { - for (var i = 0; i < services.length; i++) { - if (services[i].name == 'Lb') { - var providers = services[i].provider; - if (providers != null) { - for (var k = 0; k < providers.length; k++) { - if (providers[k].name == 'Netscaler') { - lbProviderIsNetscaler = true; - break; - } - } - } - break; - } + isHidden: function(args) { + if (!('vpc' in args.context)) { //from Guest Network section + var lbProviderIsNetscaler = false; + $.ajax({ + url: createURL('listNetworkOfferings'), + data: { + id: args.context.networks[0].networkofferingid + }, + async: false, + success: function(json) { + var networkOffering = json.listnetworkofferingsresponse.networkoffering[0]; + var services = networkOffering.service; + if (services != null) { + for (var i = 0; i < services.length; i++) { + if (services[i].name == 'Lb') { + var providers = services[i].provider; + if (providers != null) { + for (var k = 0; k < providers.length; k++) { + if (providers[k].name == 'Netscaler') { + lbProviderIsNetscaler = true; + break; + } + } + } + break; + } + } } - } - } - }); - - if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter) - return false; //show AutoScale button - } else { - return 2; //hide Autoscale button (both header and form) - } + } + }); + if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter) + return false; //show AutoScale button + } else { + return 2; //hide Autoscale button (both header and form) + } + } else { //from VPC section + //VPC doesn't support autoscale + return 2; + } } }, From 7b44c97a25bdfd715d425a3f952da0fd1628a717 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 6 Nov 2013 12:21:40 -0800 Subject: [PATCH 034/108] CLOUDSTACK-5037: UI > Infrastructure > clusters > Settings tab > when "cpu.overprovisioning.factor" or "mem.overprovisioning.factor" is changed, pop up a warning message "Please note - you are changing the over provisioning factor for a cluster with vms running. Please refer to the admin guide to understand the capacity calculation." --- ui/scripts/system.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index fa22811cd8b..a315492c6a2 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -12030,6 +12030,13 @@ data: data, success: function(json) { var item = json.updateconfigurationresponse.configuration; + + if (args.data.jsonObj.name == 'cpu.overprovisioning.factor' || args.data.jsonObj.name == 'mem.overprovisioning.factor') { + cloudStack.dialog.notice({ + message: 'Please note - you are changing the over provisioning factor for a cluster with vms running. Please refer to the admin guide to understand the capacity calculation.' + }); + } + args.response.success({ data: item }); From a7201a81b2729156f78813ef39dc8fbd611ea38c Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Wed, 6 Nov 2013 22:10:40 +0100 Subject: [PATCH 035/108] The VPC offering has the option internaly to specify the compute offering (service offering), expose this via the api. Added a field to the command for serviceOfferingId and changed the internal interface to accept the service offering as parameter Applied automated code cleanup --- .../network/vpc/VpcProvisioningService.java | 13 +- .../admin/vpc/CreateVPCOfferingCmd.java | 33 +- .../com/cloud/network/vpc/VpcManagerImpl.java | 363 +++++++++--------- 3 files changed, 215 insertions(+), 194 deletions(-) diff --git a/api/src/com/cloud/network/vpc/VpcProvisioningService.java b/api/src/com/cloud/network/vpc/VpcProvisioningService.java index 70676ce07ab..e8094bca98a 100644 --- a/api/src/com/cloud/network/vpc/VpcProvisioningService.java +++ b/api/src/com/cloud/network/vpc/VpcProvisioningService.java @@ -20,20 +20,21 @@ import java.util.List; import java.util.Map; public interface VpcProvisioningService { - + public VpcOffering getVpcOffering(long vpcOfferingId); - - public VpcOffering createVpcOffering(String name, String displayText, List supportedServices, Map> serviceProviders); - + + public VpcOffering createVpcOffering(String name, String displayText, List supportedServices, + Map> serviceProviders, Long serviceOfferingId); + List listVpcOfferings(Long id, String name, String displayText, List supportedServicesStr, Boolean isDefault, String keyword, String state, Long startIndex, Long pageSizeVal); - + /** * @param offId * @return */ public boolean deleteVpcOffering(long offId); - + /** * @param vpcOffId * @param vpcOfferingName diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java index 4a3a92a211c..7a8debab6b3 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java @@ -16,7 +16,14 @@ // under the License. package org.apache.cloudstack.api.command.admin.vpc; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -24,8 +31,8 @@ import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.BaseAsyncCreateCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.ServiceOfferingResponse; import org.apache.cloudstack.api.response.VpcOfferingResponse; -import org.apache.log4j.Logger; import com.cloud.event.EventTypes; import com.cloud.exception.ResourceAllocationException; @@ -56,6 +63,9 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{ "If not specified, the provider for the service will be mapped to the default provider on the physical network") private Map serviceProviderList; + @Parameter(name = ApiConstants.SERVICE_OFFERING_ID, type = CommandType.UUID, entityType = ServiceOfferingResponse.class, description = "the ID of the service offering for the VPC router appliance") + private Long serviceOfferingId; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -96,12 +106,17 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{ return serviceProviderMap; } + public Long getServiceOfferingId() { + return serviceOfferingId; + } + @Override public void create() throws ResourceAllocationException { - VpcOffering vpcOff = _vpcProvSvc.createVpcOffering(getVpcOfferingName(), getDisplayText(), getSupportedServices(), getServiceProviders()); + VpcOffering vpcOff = _vpcProvSvc.createVpcOffering(getVpcOfferingName(), getDisplayText(), getSupportedServices(), + getServiceProviders(), getServiceOfferingId()); if (vpcOff != null) { - this.setEntityId(vpcOff.getId()); - this.setEntityUuid(vpcOff.getUuid()); + setEntityId(vpcOff.getId()); + setEntityUuid(vpcOff.getUuid()); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a VPC offering"); } @@ -109,11 +124,11 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{ @Override public void execute() { - VpcOffering vpc = _vpcProvSvc.getVpcOffering(this.getEntityId()); + VpcOffering vpc = _vpcProvSvc.getVpcOffering(getEntityId()); if (vpc != null) { VpcOfferingResponse response = _responseGenerator.createVpcOfferingResponse(vpc); response.setResponseName(getCommandName()); - this.setResponseObject(response); + setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create VPC offering"); } @@ -122,7 +137,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{ @Override public String getEventType() { - return EventTypes.EVENT_VPC_OFFERING_CREATE; + return EventTypes.EVENT_VPC_OFFERING_CREATE; } @Override @@ -137,7 +152,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd{ @Override public long getEntityOwnerId() { - return Account.ACCOUNT_ID_SYSTEM; + return Account.ACCOUNT_ID_SYSTEM; } } diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index 6e0b54d9b9a..11cbd95cbb4 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -31,6 +31,8 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; +import org.apache.log4j.Logger; + import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.api.command.user.vpc.ListPrivateGatewaysCmd; import org.apache.cloudstack.api.command.user.vpc.ListStaticRoutesCmd; @@ -39,7 +41,6 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationSe import org.apache.cloudstack.framework.config.ConfigDepot; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.managed.context.ManagedContextRunnable; -import org.apache.log4j.Logger; import com.cloud.configuration.Config; import com.cloud.configuration.ConfigurationManager; @@ -118,13 +119,13 @@ import com.cloud.utils.db.GlobalLock; import com.cloud.utils.db.JoinBuilder; import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.SearchCriteria.Op; +import com.cloud.utils.db.Transaction; import com.cloud.utils.db.TransactionCallback; import com.cloud.utils.db.TransactionCallbackNoReturn; import com.cloud.utils.db.TransactionCallbackWithException; import com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn; import com.cloud.utils.db.TransactionStatus; -import com.cloud.utils.db.SearchCriteria.Op; -import com.cloud.utils.db.Transaction; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.exception.ExceptionUtil; import com.cloud.utils.net.NetUtils; @@ -203,7 +204,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis private List vpcElements = null; private final List nonSupportedServices = Arrays.asList(Service.SecurityGroup, Service.Firewall); private final List supportedProviders = Arrays.asList(Provider.VPCVirtualRouter, Provider.NiciraNvp, Provider.InternalLbVm, Provider.Netscaler); - + int _cleanupInterval; int _maxNetworks; SearchBuilder IpAddressSearch; @@ -217,7 +218,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis public void doInTransactionWithoutResult(TransactionStatus status) { if (_vpcOffDao.findByUniqueName(VpcOffering.defaultVPCOfferingName) == null) { s_logger.debug("Creating default VPC offering " + VpcOffering.defaultVPCOfferingName); - + Map> svcProviderMap = new HashMap>(); Set defaultProviders = new HashSet(); defaultProviders.add(Provider.VPCVirtualRouter); @@ -232,9 +233,10 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } } createVpcOffering(VpcOffering.defaultVPCOfferingName, VpcOffering.defaultVPCOfferingName, svcProviderMap, - true, State.Enabled); + true, + State.Enabled, null); } - + //configure default vpc offering with Netscaler as LB Provider if (_vpcOffDao.findByUniqueName(VpcOffering.defaultVPCNSOfferingName ) == null) { s_logger.debug("Creating default VPC offering with Netscaler as LB Provider" + VpcOffering.defaultVPCNSOfferingName); @@ -252,11 +254,12 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } } createVpcOffering(VpcOffering.defaultVPCNSOfferingName, VpcOffering.defaultVPCNSOfferingName, - svcProviderMap, false, State.Enabled); + svcProviderMap, + false, State.Enabled, null); } } }); - + Map configs = _configDao.getConfiguration(params); String value = configs.get(Config.VpcCleanupInterval.key()); _cleanupInterval = NumbersUtil.parseInt(value, 60 * 60); // 1 hour @@ -273,7 +276,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis virtualNetworkVlanSB.and("vlanType", virtualNetworkVlanSB.entity().getVlanType(), Op.EQ); IpAddressSearch.join("virtualNetworkVlanSB", virtualNetworkVlanSB, IpAddressSearch.entity().getVlanId(), virtualNetworkVlanSB.entity().getId(), JoinBuilder.JoinType.INNER); IpAddressSearch.done(); - + return true; } @@ -300,7 +303,8 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis @Override @ActionEvent(eventType = EventTypes.EVENT_VPC_OFFERING_CREATE, eventDescription = "creating vpc offering", create=true) - public VpcOffering createVpcOffering(String name, String displayText, List supportedServices, Map> serviceProviders) { + public VpcOffering createVpcOffering(String name, String displayText, List supportedServices, + Map> serviceProviders, Long serviceOfferingId) { Map> svcProviderMap = new HashMap>(); Set defaultProviders = new HashSet(); defaultProviders.add(Provider.VPCVirtualRouter); @@ -328,22 +332,22 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis if (service == Service.NetworkACL) { firewallSvs = true; } - + if (service == Service.SourceNat) { sourceNatSvc = true; } } - + if (!sourceNatSvc) { s_logger.debug("Automatically adding source nat service to the list of VPC services"); svcProviderMap.put(Service.SourceNat, defaultProviders); } - + if (!firewallSvs) { s_logger.debug("Automatically adding network ACL service to the list of VPC services"); svcProviderMap.put(Service.NetworkACL, defaultProviders); } - + svcProviderMap.put(Service.Gateway, defaultProviders); if (serviceProviders != null) { @@ -373,21 +377,22 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } } - VpcOffering offering = createVpcOffering(name, displayText, svcProviderMap, false, null); + VpcOffering offering = createVpcOffering(name, displayText, svcProviderMap, false, null, serviceOfferingId); CallContext.current().setEventDetails(" Id: " + offering.getId() + " Name: " + name); - + return offering; } - + @DB protected VpcOffering createVpcOffering(final String name, final String displayText, final Map> svcProviderMap, final boolean isDefault, final State state) { + Set> svcProviderMap, final boolean isDefault, final State state, + final Long serviceOfferingId) { return Transaction.execute(new TransactionCallback() { @Override public VpcOffering doInTransaction(TransactionStatus status) { // create vpc offering object - VpcOfferingVO offering = new VpcOfferingVO(name, displayText, isDefault, null); + VpcOfferingVO offering = new VpcOfferingVO(name, displayText, isDefault, serviceOfferingId); if (state != null) { offering.setState(state); @@ -414,7 +419,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } }); } - + @Override public Vpc getActiveVpc(long vpcId) { return _vpcDao.getActiveVpcById(vpcId); @@ -438,8 +443,8 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return serviceProviderMap; } - - + + @Override public List listVpcOfferings(Long id, String name, String displayText, List supportedServicesStr, Boolean isDefault, String keyword, String state, Long startIndex, Long pageSizeVal) { @@ -479,7 +484,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis // filter by supported services boolean listBySupportedServices = (supportedServicesStr != null && !supportedServicesStr.isEmpty() && !offerings.isEmpty()); - + if (listBySupportedServices) { List supportedOfferings = new ArrayList(); Service[] supportedServices = null; @@ -514,8 +519,8 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis protected boolean areServicesSupportedByVpcOffering(long vpcOffId, Service... services) { return (_vpcOffSvcMapDao.areServicesSupportedByNetworkOffering(vpcOffId, services)); } - - + + @Override @ActionEvent(eventType = EventTypes.EVENT_VPC_OFFERING_DELETE, eventDescription = "deleting vpc offering") public boolean deleteVpcOffering(long offId) { @@ -594,10 +599,10 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis String networkDomain) throws ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.getAccount(vpcOwnerId); - + //Verify that caller can perform actions in behalf of vpc owner _accountMgr.checkAccess(caller, null, false, owner); - + //check resource limit _resourceLimitMgr.checkResourceLimit(owner, ResourceType.vpc); @@ -613,20 +618,20 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } throw ex; } - + //Validate zone DataCenter zone = _entityMgr.findById(DataCenter.class, zoneId); if (zone == null) { throw new InvalidParameterValueException("Can't find zone by id specified"); } - + if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getType())) { // See DataCenterVO.java PermissionDeniedException ex = new PermissionDeniedException("Cannot perform this operation since specified Zone is currently disabled"); ex.addProxyObject(zone.getUuid(), "zoneId"); throw ex; } - + if (networkDomain == null) { // 1) Get networkDomain from the corresponding account networkDomain = _ntwkModel.getAccountNetworkDomain(owner.getId(), zoneId); @@ -637,11 +642,11 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis networkDomain = "cs" + Long.toHexString(owner.getId()) + NetworkOrchestrationService.GuestDomainSuffix.valueIn(zoneId); } } - + return createVpc(zoneId, vpcOffId, owner, vpcName, displayText, cidr, networkDomain); } - + @DB protected Vpc createVpc(final long zoneId, final long vpcOffId, final Account vpcOwner, final String vpcName, final String displayText, final String cidr, final String networkDomain) { @@ -660,8 +665,8 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis if (!NetUtils.verifyDomainName(networkDomain)) { throw new InvalidParameterValueException( "Invalid network domain. Total length shouldn't exceed 190 chars. Each domain " + - "label must be between 1 and 63 characters long, can contain ASCII letters 'a' through 'z', " + - "the digits '0' through '9', " + "label must be between 1 and 63 characters long, can contain ASCII letters 'a' through 'z', " + + "the digits '0' through '9', " + "and the hyphen ('-'); can't start or end with \"-\""); } @@ -698,7 +703,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis throw new InvalidParameterValueException("Provider " + provider + " should be enabled in at least one physical network of the zone specified"); } - + List providers = null; if (svcProviders.get(service) == null) { providers = new ArrayList(); @@ -723,10 +728,10 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis if (vpc == null) { throw new InvalidParameterValueException("unable to find VPC id=" + vpcId); } - + //verify permissions _accountMgr.checkAccess(ctx.getCallingAccount(), null, false, vpc); - + return destroyVpc(vpc, ctx.getCallingAccount(), ctx.getCallingUserId()); } @@ -734,7 +739,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis @DB public boolean destroyVpc(final Vpc vpc, Account caller, Long callerUserId) throws ConcurrentOperationException, ResourceUnavailableException { s_logger.debug("Destroying vpc " + vpc); - + //don't allow to delete vpc if it's in use by existing non system networks (system networks are networks of a private gateway of the VPC, //and they will get removed as a part of VPC cleanup int networksCount = _ntwkDao.getNonSystemNetworkCountByVpcId(vpc.getId()); @@ -747,7 +752,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis s_logger.debug("Updating VPC " + vpc + " with state " + Vpc.State.Inactive + " as a part of vpc delete"); final VpcVO vpcVO = _vpcDao.findById(vpc.getId()); vpcVO.setState(Vpc.State.Inactive); - + Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { @@ -758,13 +763,13 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } }); } - + //shutdown VPC if (!shutdownVpc(vpc.getId())) { s_logger.warn("Failed to shutdown vpc " + vpc + " as a part of vpc destroy process"); return false; } - + //cleanup vpc resources if (!cleanupVpcResources(vpc.getId(), caller, callerUserId)) { s_logger.warn("Failed to cleanup resources for vpc " + vpc); @@ -792,7 +797,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis if (vpcToUpdate == null) { throw new InvalidParameterValueException("Unable to find vpc offering " + vpcId); } - + _accountMgr.checkAccess(caller, null, false, vpcToUpdate); VpcVO vpc = _vpcDao.createForUpdate(vpcId); @@ -820,7 +825,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis Long startIndex, Long pageSizeVal, Long zoneId, Boolean isRecursive, Boolean listAll, Boolean restartRequired, Map tags, Long projectId) { Account caller = CallContext.current().getCallingAccount(); List permittedAccounts = new ArrayList(); - + Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject, @@ -841,7 +846,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ); sb.and("restartRequired", sb.entity().isRestartRequired(), SearchCriteria.Op.EQ); sb.and("cidr", sb.entity().getCidr(), SearchCriteria.Op.EQ); - + if (tags != null && !tags.isEmpty()) { SearchBuilder tagSearch = _resourceTagDao.createSearchBuilder(); for (int count=0; count < tags.size(); count++) { @@ -853,7 +858,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis sb.groupBy(sb.entity().getId()); sb.join("tagSearch", tagSearch, sb.entity().getId(), tagSearch.entity().getResourceId(), JoinBuilder.JoinType.INNER); } - + // now set the SC criteria... SearchCriteria sc = sb.create(); _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); @@ -872,7 +877,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis if (displayText != null) { sc.addAnd("displayText", SearchCriteria.Op.LIKE, "%" + displayText + "%"); } - + if (tags != null && !tags.isEmpty()) { int count = 0; sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.Vpc.toString()); @@ -881,28 +886,28 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key)); count++; } - } + } if (id != null) { sc.addAnd("id", SearchCriteria.Op.EQ, id); } - + if (vpcOffId != null) { sc.addAnd("vpcOfferingId", SearchCriteria.Op.EQ, vpcOffId); } - + if (zoneId != null) { sc.addAnd("zoneId", SearchCriteria.Op.EQ, zoneId); } - + if (state != null) { sc.addAnd("state", SearchCriteria.Op.EQ, state); } - + if (cidr != null) { sc.addAnd("cidr", SearchCriteria.Op.EQ, cidr); } - + if (restartRequired != null) { sc.addAnd("restartRequired", SearchCriteria.Op.EQ, restartRequired); } @@ -911,7 +916,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis // filter by supported services boolean listBySupportedServices = (supportedServicesStr != null && !supportedServicesStr.isEmpty() && !vpcs.isEmpty()); - + if (listBySupportedServices) { List supportedVpcs = new ArrayList(); Service[] supportedServices = null; @@ -942,7 +947,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } } - + protected List getSupportedServices() { List services = new ArrayList(); services.add(Network.Service.Dhcp); @@ -957,14 +962,14 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis services.add(Network.Service.Vpn); return services; } - + @Override public boolean startVpc(long vpcId, boolean destroyOnFailure) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { CallContext ctx = CallContext.current(); Account caller = ctx.getCallingAccount(); User callerUser = _accountMgr.getActiveUser(ctx.getCallingUserId()); - + //check if vpc exists Vpc vpc = getActiveVpc(vpcId); if (vpc == null) { @@ -972,16 +977,16 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis ex.addProxyObject(String.valueOf(vpcId), "VPC"); throw ex; } - + //permission check _accountMgr.checkAccess(caller, null, false, vpc); - + DataCenter dc = _entityMgr.findById(DataCenter.class, vpc.getZoneId()); - + DeployDestination dest = new DeployDestination(dc, null, null, null); ReservationContext context = new ReservationContextImpl(null, null, callerUser, _accountMgr.getAccount(vpc.getAccountId())); - + boolean result = true; try { if (!startVpc(vpc, dest, context)) { @@ -1022,18 +1027,18 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } return success; } - + @Override public boolean shutdownVpc(long vpcId) throws ConcurrentOperationException, ResourceUnavailableException { CallContext ctx = CallContext.current(); Account caller = ctx.getCallingAccount(); - + //check if vpc exists Vpc vpc = _vpcDao.findById(vpcId); if (vpc == null) { throw new InvalidParameterValueException("Unable to find vpc by id " + vpcId); } - + //permission check _accountMgr.checkAccess(caller, null, false, vpc); @@ -1057,18 +1062,18 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return success; } - + @DB @Override public void validateNtwkOffForNtwkInVpc(Long networkId, long newNtwkOffId, String newCidr, String newNetworkDomain, Vpc vpc, String gateway, Account networkOwner, Long aclId) { - + NetworkOffering guestNtwkOff = _entityMgr.findById(NetworkOffering.class, newNtwkOffId); - + if (guestNtwkOff == null) { throw new InvalidParameterValueException("Can't find network offering by id specified"); } - + if (networkId == null) { //1) Validate attributes that has to be passed in when create new guest network validateNewVpcGuestNetwork(newCidr, gateway, networkOwner, vpc, newNetworkDomain); @@ -1080,7 +1085,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis //3) Check services/providers against VPC providers List networkProviders = _ntwkOffServiceDao.listByNetworkOfferingId(guestNtwkOff.getId()); - + for (NetworkOfferingServiceMapVO nSvcVO : networkProviders) { String pr = nSvcVO.getProvider(); String service = nSvcVO.getService(); @@ -1101,7 +1106,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis NetworkOffering otherOff = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); if (_ntwkModel.areServicesSupportedInNetwork(network.getId(), Service.Lb) && otherOff.getPublicLb()) { throw new InvalidParameterValueException("Public LB service is already supported " + - "by network " + network + " in VPC " + vpc); + "by network " + network + " in VPC " + vpc); } } } @@ -1124,7 +1129,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis + " is not supported for network offerings that can be used in VPC"); } } - + //2) Only Isolated networks with Source nat service enabled can be added to vpc if (!(guestNtwkOff.getGuestType() == GuestType.Isolated && supportedSvcs.contains(Service.SourceNat))) { @@ -1144,7 +1149,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis throw new InvalidParameterValueException("Only networks with conserve mode Off can belong to VPC"); } - //5) If Netscaler is LB provider make sure it is in dedicated mode + //5) If Netscaler is LB provider make sure it is in dedicated mode if ( providers.contains(Provider.Netscaler) && !guestNtwkOff.getDedicatedLB() ) { throw new InvalidParameterValueException("Netscaler only with Dedicated LB can belong to VPC"); } @@ -1153,7 +1158,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis @DB protected void validateNewVpcGuestNetwork(final String cidr, final String gateway, final Account networkOwner, final Vpc vpc, final String networkDomain) { - + Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { @@ -1161,49 +1166,49 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis if (locked == null) { throw new CloudRuntimeException("Unable to acquire lock on " + vpc); } - + try { //check number of active networks in vpc if (_ntwkDao.countVpcNetworks(vpc.getId()) >= _maxNetworks) { throw new CloudRuntimeException("Number of networks per VPC can't extend " + _maxNetworks + "; increase it using global config " + Config.VpcMaxNetworks); } - - + + //1) CIDR is required if (cidr == null) { throw new InvalidParameterValueException("Gateway/netmask are required when create network for VPC"); } - + //2) Network cidr should be within vpcCidr if (!NetUtils.isNetworkAWithinNetworkB(cidr, vpc.getCidr())) { throw new InvalidParameterValueException("Network cidr " + cidr + " is not within vpc " + vpc + " cidr"); } - + //3) Network cidr shouldn't cross the cidr of other vpc network cidrs List ntwks = _ntwkDao.listByVpc(vpc.getId()); for (Network ntwk : ntwks) { assert (cidr != null) : "Why the network cidr is null when it belongs to vpc?"; - + if (NetUtils.isNetworkAWithinNetworkB(ntwk.getCidr(), cidr) || NetUtils.isNetworkAWithinNetworkB(cidr, ntwk.getCidr())) { throw new InvalidParameterValueException("Network cidr " + cidr + " crosses other network cidr " + ntwk + " belonging to the same vpc " + vpc); } } - + //4) vpc and network should belong to the same owner if (vpc.getAccountId() != networkOwner.getId()) { throw new InvalidParameterValueException("Vpc " + vpc + " owner is different from the network owner " + networkOwner); } - + //5) network domain should be the same as VPC's if (!networkDomain.equalsIgnoreCase(vpc.getNetworkDomain())) { throw new InvalidParameterValueException("Network domain of the new network should match network" + - " domain of vpc " + vpc); + " domain of vpc " + vpc); } - + //6) gateway should never be equal to the cidr subnet if (NetUtils.getCidrSubNet(cidr).equalsIgnoreCase(gateway)) { throw new InvalidParameterValueException("Invalid gateway specified. It should never be equal to the cidr subnet value"); @@ -1229,12 +1234,12 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return vpcElements; } - + @Override public List getVpcsForAccount(long accountId) { return _vpcDao.listByAccountId(accountId); } - + public boolean cleanupVpcResources(long vpcId, Account caller, long callerUserId) throws ResourceUnavailableException, ConcurrentOperationException { s_logger.debug("Cleaning up resources for vpc id=" + vpcId); @@ -1245,7 +1250,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis _s2sVpnMgr.cleanupVpnConnectionByVpc(vpcId); s_logger.debug("Cleaning up existed site to site VPN gateways"); _s2sVpnMgr.cleanupVpnGatewayByVpc(vpcId); - + //2) release all ip addresses List ipsToRelease = _ipAddressDao.listByAssociatedVpc(vpcId, null); s_logger.debug("Releasing ips for vpc id=" + vpcId + " as a part of vpc cleanup"); @@ -1264,7 +1269,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } } } - + if (success) { s_logger.debug("Released ip addresses for vpc id=" + vpcId + " as a part of cleanup vpc process"); } else { @@ -1293,7 +1298,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } } } - + return success; } @@ -1301,7 +1306,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis @Override @ActionEvent(eventType = EventTypes.EVENT_VPC_RESTART, eventDescription = "restarting vpc") public boolean restartVpc(long vpcId) throws ConcurrentOperationException, ResourceUnavailableException, - InsufficientCapacityException { + InsufficientCapacityException { Account caller = CallContext.current().getCallingAccount(); // Verify input parameters @@ -1311,9 +1316,9 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis ex.addProxyObject(String.valueOf(vpcId), "VPC"); throw ex; } - + _accountMgr.checkAccess(caller, null, false, vpc); - + s_logger.debug("Restarting VPC " + vpc); boolean restartRequired = false; try { @@ -1323,7 +1328,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis restartRequired = true; return false; } - + s_logger.debug("Starting VPC " + vpc + " as a part of VPC restart process"); if (!startVpc(vpcId, false)) { s_logger.warn("Failed to start vpc as a part of VPC " + vpc + " restart process"); @@ -1339,7 +1344,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis _vpcDao.update(vpc.getId(), vo); } } - + @Override public List getVpcPrivateGateways(long vpcId) { @@ -1365,7 +1370,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } return getPrivateGatewayProfile(gateway); } - + protected PrivateGateway getPrivateGatewayProfile(VpcGateway gateway) { Network network = _ntwkModel.getNetwork(gateway.getNetworkId()); return new PrivateGatewayProfile(gateway, network.getPhysicalNetworkId()); @@ -1377,7 +1382,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis public PrivateGateway createVpcPrivateGateway(final long vpcId, Long physicalNetworkId, final String broadcastUri, final String ipAddress, final String gateway, final String netmask, final long gatewayOwnerId, final Long networkOfferingId, final Boolean isSourceNat, final Long aclId) throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException { - + //Validate parameters final Vpc vpc = getActiveVpc(vpcId); if (vpc == null) { @@ -1396,12 +1401,12 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis physNet = pNtwks.get(0); physicalNetworkId = physNet.getId(); } - + if (physNet == null) { physNet = _entityMgr.findById(PhysicalNetwork.class,physicalNetworkId); } final Long dcId = physNet.getDataCenterId(); - + final Long physicalNetworkIdFinal = physicalNetworkId; final PhysicalNetwork physNetFinal = physNet; VpcGatewayVO gatewayVO = null; @@ -1414,7 +1419,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis Network privateNtwk = null; if (BroadcastDomainType.getSchemeValue(BroadcastDomainType.fromString(broadcastUri)) == BroadcastDomainType.Lswitch) { String cidr = NetUtils.ipAndNetMaskToCidr(gateway, netmask); - + privateNtwk = _ntwkDao.getPrivateNetwork(broadcastUri, cidr, gatewayOwnerId, dcId, networkOfferingId); s_logger.info("found and using existing network for vpc " + vpc + ": " + broadcastUri); @@ -1422,28 +1427,28 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis if (privateNtwk == null) { s_logger.info("creating new network for vpc " + vpc + " using broadcast uri: " + broadcastUri); String networkName = "vpc-" + vpc.getName() + "-privateNetwork"; - privateNtwk = _ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, - broadcastUri, ipAddress, null, gateway, netmask, gatewayOwnerId, vpcId, isSourceNat, networkOfferingId); + privateNtwk = _ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, + broadcastUri, ipAddress, null, gateway, netmask, gatewayOwnerId, vpcId, isSourceNat, networkOfferingId); } else { // create the nic/ip as createPrivateNetwork doesn''t do that work for us now DataCenterVO dc = _dcDao.lockRow(physNetFinal.getDataCenterId(), true); - + //add entry to private_ip_address table PrivateIpVO privateIp = _privateIpDao.findByIpAndSourceNetworkId(privateNtwk.getId(), ipAddress); if (privateIp != null) { throw new InvalidParameterValueException("Private ip address " + ipAddress + " already used for private gateway" + " in zone " + _entityMgr.findById(DataCenter.class,dcId).getName()); } - + Long mac = dc.getMacAddress(); Long nextMac = mac + 1; dc.setMacAddress(nextMac); - + privateIp = new PrivateIpVO(ipAddress, privateNtwk.getId(), nextMac, vpcId, true); _privateIpDao.persist(privateIp); - + _dcDao.update(dc.getId(), dc); } - + long networkAclId = NetworkACL.DEFAULT_DENY; if (aclId != null) { NetworkACLVO aclVO = _networkAclDao.findById(aclId); @@ -1453,17 +1458,17 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis if ((aclVO.getVpcId() != vpcId) && !(aclId == NetworkACL.DEFAULT_DENY || aclId == NetworkACL.DEFAULT_ALLOW)) { throw new InvalidParameterValueException("Private gateway and network acl are not in the same vpc"); } - + networkAclId = aclId; } - + //2) create gateway entry VpcGatewayVO gatewayVO = new VpcGatewayVO(ipAddress, VpcGateway.Type.Private, vpcId, privateNtwk.getDataCenterId(), privateNtwk.getId(), broadcastUri, gateway, netmask, vpc.getAccountId(), vpc.getDomainId(), isSourceNat, networkAclId); _vpcGatewayDao.persist(gatewayVO); - + s_logger.debug("Created vpc gateway entry " + gatewayVO); - + return gatewayVO; } }); @@ -1473,7 +1478,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis ExceptionUtil.rethrow(e, ResourceAllocationException.class); throw new IllegalStateException(e); } - + return getVpcPrivateGateway(gatewayVO.getId()); } @@ -1521,7 +1526,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis @ActionEvent(eventType = EventTypes.EVENT_PRIVATE_GATEWAY_DELETE, eventDescription = "deleting private gateway") @DB public boolean deleteVpcPrivateGateway(long gatewayId) throws ConcurrentOperationException, ResourceUnavailableException { - + final VpcGatewayVO gatewayVO = _vpcGatewayDao.acquireInLockTable(gatewayId); if (gatewayVO == null || gatewayVO.getType() != VpcGateway.Type.Private) { throw new ConcurrentOperationException("Unable to lock gateway " + gatewayId); @@ -1555,29 +1560,29 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return false; } } - + //2) Delete private gateway from the DB return deletePrivateGatewayFromTheDB(gateway); - + } finally { if (gatewayVO != null) { _vpcGatewayDao.releaseFromLockTable(gatewayId); } } } - + @DB protected boolean deletePrivateGatewayFromTheDB(final PrivateGateway gateway) { //check if there are ips allocted in the network final long networkId = gateway.getNetworkId(); - + boolean deleteNetwork = true; List privateIps = _privateIpDao.listByNetworkId(networkId); if (privateIps.size() > 1 || !privateIps.get(0).getIpAddress().equalsIgnoreCase(gateway.getIp4Address())) { s_logger.debug("Not removing network id=" + gateway.getNetworkId() + " as it has private ip addresses for other gateways"); deleteNetwork = false; } - + //TODO: Clean this up, its bad. There is a DB transaction wrapping calls to NetworkElements (destroyNetwork will // call network elements). final boolean deleteNetworkFinal = deleteNetwork; @@ -1589,7 +1594,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis _privateIpDao.remove(ip.getId()); s_logger.debug("Deleted private ip " + ip); } - + if (deleteNetworkFinal) { User callerUser = _accountMgr.getActiveUser(CallContext.current().getCallingUserId()); Account owner = _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM); @@ -1597,12 +1602,12 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis _ntwkMgr.destroyNetwork(networkId, context); s_logger.debug("Deleted private network id=" + networkId); } - + _vpcGatewayDao.remove(gateway.getId()); s_logger.debug("Deleted private gateway " + gateway); } }); - + return true; } @@ -1632,45 +1637,45 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis SearchBuilder sb = _vpcGatewayDao.createSearchBuilder(); _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); - + if (vlan != null) { SearchBuilder ntwkSearch = _ntwkDao.createSearchBuilder(); ntwkSearch.and("vlan", ntwkSearch.entity().getBroadcastUri(), SearchCriteria.Op.EQ); sb.join("networkSearch", ntwkSearch, sb.entity().getNetworkId(), ntwkSearch.entity().getId(), JoinBuilder.JoinType.INNER); } - + SearchCriteria sc = sb.create(); _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); - + if (id != null) { sc.addAnd("id", Op.EQ, id); } - + if (ipAddress != null) { sc.addAnd("ip4Address", Op.EQ, ipAddress); } - + if (state != null) { sc.addAnd("state", Op.EQ, state); } - + if (vpcId != null) { sc.addAnd("vpcId", Op.EQ, vpcId); } - + if (vlan != null) { sc.setJoinParameters("networkSearch", "vlan", BroadcastDomainType.Vlan.toUri(vlan)); } - + Pair, Integer> vos = _vpcGatewayDao.searchAndCount(sc, searchFilter); List privateGtws = new ArrayList(vos.first().size()); for (VpcGateway vo : vos.first()) { privateGtws.add(getPrivateGatewayProfile(vo)); } - + return new Pair, Integer>(privateGtws, vos.second()); } - + @Override public StaticRoute getStaticRoute(long routeId) { return _staticRouteDao.findById(routeId); @@ -1716,14 +1721,14 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return success; } - + protected boolean applyStaticRoutes(List routes) throws ResourceUnavailableException{ if (routes.isEmpty()) { s_logger.debug("No static routes to apply"); return true; } Vpc vpc = _vpcDao.findById(routes.get(0).getVpcId()); - + s_logger.debug("Applying static routes for vpc " + vpc); String staticNatProvider = _vpcSrvcDao.getProviderForServiceInVpc(vpc.getId(), Service.StaticNat); @@ -1739,7 +1744,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return false; } } - + return true; } @@ -1747,19 +1752,19 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis @ActionEvent(eventType = EventTypes.EVENT_STATIC_ROUTE_DELETE, eventDescription = "deleting static route") public boolean revokeStaticRoute(long routeId) throws ResourceUnavailableException { Account caller = CallContext.current().getCallingAccount(); - + StaticRouteVO route = _staticRouteDao.findById(routeId); if (route == null) { throw new InvalidParameterValueException("Unable to find static route by id"); } - + _accountMgr.checkAccess(caller, null, false, route); markStaticRouteForRevoke(route, caller); return applyStaticRoutes(route.getVpcId()); } - + @DB protected boolean revokeStaticRoutesForVpc(long vpcId, final Account caller) throws ResourceUnavailableException { //get all static routes for the vpc @@ -1777,7 +1782,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis }); return applyStaticRoutes(vpcId); } - + return true; } @@ -1786,38 +1791,38 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis @ActionEvent(eventType = EventTypes.EVENT_STATIC_ROUTE_CREATE, eventDescription = "creating static route", create=true) public StaticRoute createStaticRoute(long gatewayId, final String cidr) throws NetworkRuleConflictException { Account caller = CallContext.current().getCallingAccount(); - + //parameters validation final VpcGateway gateway = _vpcGatewayDao.findById(gatewayId); if (gateway == null) { throw new InvalidParameterValueException("Invalid gateway id is given"); } - + if (gateway.getState() != VpcGateway.State.Ready) { throw new InvalidParameterValueException("Gateway is not in the " + VpcGateway.State.Ready + " state: " + gateway.getState()); } - + final Vpc vpc = getActiveVpc(gateway.getVpcId()); if (vpc == null) { throw new InvalidParameterValueException("Can't add static route to VPC that is being deleted"); } _accountMgr.checkAccess(caller, null, false, vpc); - + if (!NetUtils.isValidCIDR(cidr)){ throw new InvalidParameterValueException("Invalid format for cidr " + cidr); } - + //validate the cidr //1) CIDR should be outside of VPC cidr for guest networks if (NetUtils.isNetworksOverlap(vpc.getCidr(), cidr)) { throw new InvalidParameterValueException("CIDR should be outside of VPC cidr " + vpc.getCidr()); } - + //2) CIDR should be outside of link-local cidr if (NetUtils.isNetworksOverlap(vpc.getCidr(), NetUtils.getLinkLocalCIDR())) { throw new InvalidParameterValueException("CIDR should be outside of link local cidr " + NetUtils.getLinkLocalCIDR()); } - + //3) Verify against blacklisted routes if (isCidrBlacklisted(cidr, vpc.getZoneId())) { throw new InvalidParameterValueException("The static gateway cidr overlaps with one of the blacklisted routes of the zone the VPC belongs to"); @@ -1829,14 +1834,14 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis StaticRouteVO newRoute = new StaticRouteVO(gateway.getId(), cidr, vpc.getId(), vpc.getAccountId(), vpc.getDomainId()); s_logger.debug("Adding static route " + newRoute); newRoute = _staticRouteDao.persist(newRoute); - + detectRoutesConflict(newRoute); - + if (!_staticRouteDao.setStateToAdd(newRoute)) { throw new CloudRuntimeException("Unable to update the state to add for " + newRoute); } CallContext.current().setEventDetails("Static route Id: " + newRoute.getId()); - + return newRoute; } }); @@ -1846,7 +1851,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis String routesStr = NetworkOrchestrationService.GuestDomainSuffix.valueIn(zoneId); if (routesStr != null && !routesStr.isEmpty()) { String[] cidrBlackList = routesStr.split(","); - + if (cidrBlackList != null && cidrBlackList.length > 0) { for (String blackListedRoute : cidrBlackList) { if (NetUtils.isNetworksOverlap(blackListedRoute, cidr)) { @@ -1855,7 +1860,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } } } - + return false; } @@ -1888,7 +1893,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("vpcId", sb.entity().getVpcId(), SearchCriteria.Op.EQ); sb.and("vpcGatewayId", sb.entity().getVpcGatewayId(), SearchCriteria.Op.EQ); - + if (tags != null && !tags.isEmpty()) { SearchBuilder tagSearch = _resourceTagDao.createSearchBuilder(); for (int count=0; count < tags.size(); count++) { @@ -1900,22 +1905,22 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis sb.groupBy(sb.entity().getId()); sb.join("tagSearch", tagSearch, sb.entity().getId(), tagSearch.entity().getResourceId(), JoinBuilder.JoinType.INNER); } - + SearchCriteria sc = sb.create(); _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); - + if (id != null) { sc.addAnd("id", Op.EQ, id); } - + if (vpcId != null) { sc.addAnd("vpcId", Op.EQ, vpcId); } - + if (gatewayId != null) { sc.addAnd("vpcGatewayId", Op.EQ, gatewayId); } - + if (tags != null && !tags.isEmpty()) { int count = 0; sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.StaticRoute.toString()); @@ -1925,29 +1930,29 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis count++; } } - + Pair, Integer> result = _staticRouteDao.searchAndCount(sc, searchFilter); return new Pair, Integer>(result.first(), result.second()); } - + protected void detectRoutesConflict(StaticRoute newRoute) throws NetworkRuleConflictException { //Multiple private gateways can exist within Vpc. Check for conflicts for all static routes in Vpc //and not just the gateway List routes = _staticRouteDao.listByVpcIdAndNotRevoked(newRoute.getVpcId()); assert (routes.size() >= 1) : "For static routes, we now always first persist the route and then check for " + - "network conflicts so we should at least have one rule at this point."; - + "network conflicts so we should at least have one rule at this point."; + for (StaticRoute route : routes) { if (route.getId() == newRoute.getId()) { continue; // Skips my own route. } - + if (NetUtils.isNetworksOverlap(route.getCidr(), newRoute.getCidr())) { throw new NetworkRuleConflictException("New static route cidr conflicts with existing route " + route); } } } - + protected void markStaticRouteForRevoke(StaticRouteVO route, Account caller) { s_logger.debug("Revoking static route " + route); if (caller != null) { @@ -1965,7 +1970,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis s_logger.debug("Marked static route " + route + " with state " + StaticRoute.State.Revoke); } } - + protected class VpcCleanupTask extends ManagedContextRunnable { @Override protected void runInContext() { @@ -2005,7 +2010,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } } - + @DB @Override @ActionEvent(eventType = EventTypes.EVENT_NET_IP_ASSIGN, eventDescription = "associating Ip", async = true) @@ -2038,7 +2043,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis s_logger.debug("Associating ip " + ipToAssoc + " to vpc " + vpc); - final boolean isSourceNatFinal = isSourceNat; + final boolean isSourceNatFinal = isSourceNat; Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { @@ -2057,8 +2062,8 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return _ipAddressDao.findById(ipId); } - - + + @Override public void unassignIPFromVpcNetwork(long ipId, long networkId) { IPAddressVO ip = _ipAddressDao.findById(ipId); @@ -2092,18 +2097,18 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } s_logger.debug("Successfully released VPC ip address " + ip + " back to VPC pool "); } - + @Override public boolean isIpAllocatedToVpc(IpAddress ip) { return (ip != null && ip.getVpcId() != null && (ip.isOneToOneNat() || !_firewallDao.listByIp(ip.getId()).isEmpty())); } - + @DB @Override public Network createVpcGuestNetwork(long ntwkOffId, String name, String displayText, String gateway, - String cidr, String vlanId, String networkDomain, Account owner, Long domainId, - PhysicalNetwork pNtwk, long zoneId, ACLType aclType, Boolean subdomainAccess, long vpcId, Long aclId, Account caller, Boolean isDisplayNetworkEnabled) + String cidr, String vlanId, String networkDomain, Account owner, Long domainId, + PhysicalNetwork pNtwk, long zoneId, ACLType aclType, Boolean subdomainAccess, long vpcId, Long aclId, Account caller, Boolean isDisplayNetworkEnabled) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException { Vpc vpc = getActiveVpc(vpcId); @@ -2114,15 +2119,15 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis throw ex; } _accountMgr.checkAccess(caller, null, false, vpc); - + if (networkDomain == null) { networkDomain = vpc.getNetworkDomain(); } - + if (vpc.getZoneId() != zoneId) { throw new InvalidParameterValueException("New network doesn't belong to vpc zone"); } - + //1) Validate if network can be created for VPC validateNtwkOffForNtwkInVpc(null, ntwkOffId, cidr, networkDomain, vpc, gateway, owner, aclId); @@ -2136,12 +2141,12 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } return guestNetwork; } - - + + protected IPAddressVO getExistingSourceNatInVpc(long ownerId, long vpcId) { List addrs = listPublicIpsAssignedToVpc(ownerId, true, vpcId); - + IPAddressVO sourceNatIp = null; if (addrs.isEmpty()) { return null; @@ -2160,7 +2165,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return sourceNatIp; } - + protected List listPublicIpsAssignedToVpc(long accountId, Boolean sourceNat, long vpcId) { SearchCriteria sc = IpAddressSearch.create(); sc.setParameters("accountId", accountId); @@ -2173,8 +2178,8 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return _ipAddressDao.search(sc, null); } - - + + @Override public PublicIp assignSourceNatIpAddressToVpc(Account owner, Vpc vpc) throws InsufficientAddressCapacityException, ConcurrentOperationException { long dcId = vpc.getZoneId(); @@ -2191,7 +2196,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis return ipToReturn; } - + @Override public List getSupportedVpcHypervisors() { From 24c0513eea4f3b9a4de5f004bfea8527bd583c0e Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Tue, 5 Nov 2013 08:20:27 -0700 Subject: [PATCH 036/108] Add servlet filter class that is compatible with the Spring Modularization --- .../context/ResourceApplicationContext.java | 8 +++ .../factory/CloudStackSpringContext.java | 1 + .../model/impl/DefaultModuleDefinition.java | 3 +- .../web/CloudStackContextLoaderListener.java | 1 + .../spring/module/web/ModuleBasedFilter.java | 61 +++++++++++++++++++ 5 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/ModuleBasedFilter.java diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/context/ResourceApplicationContext.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/context/ResourceApplicationContext.java index 60d0262ab36..3a8cb6fca96 100644 --- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/context/ResourceApplicationContext.java +++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/context/ResourceApplicationContext.java @@ -18,6 +18,8 @@ */ package org.apache.cloudstack.spring.module.context; +import java.util.Arrays; + import org.springframework.context.support.AbstractXmlApplicationContext; import org.springframework.core.io.Resource; @@ -52,4 +54,10 @@ public class ResourceApplicationContext extends AbstractXmlApplicationContext { this.applicationName = applicationName; } + @Override + public String toString() { + return "ResourceApplicationContext [applicationName=" + applicationName + ", configResources=" + + Arrays.toString(configResources) + "]"; + } + } diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java index e624a5b04d4..09dbd6c9799 100644 --- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java +++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/factory/CloudStackSpringContext.java @@ -37,6 +37,7 @@ public class CloudStackSpringContext { private static final Logger log = LoggerFactory.getLogger(CloudStackSpringContext.class); + public static final String CLOUDSTACK_CONTEXT_SERVLET_KEY = CloudStackSpringContext.class.getSimpleName(); public static final String CLOUDSTACK_CONTEXT = "META-INF/cloudstack"; public static final String CLOUDSTACK_BASE = "bootstrap"; diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinition.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinition.java index 6c5180874b8..979d08e0eae 100644 --- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinition.java +++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinition.java @@ -114,7 +114,8 @@ public class DefaultModuleDefinition implements ModuleDefinition { if ( ! moduleUrl.equals(selfUrl) ) { throw new IOException("Resource [" + location() + "] and [" + self.getURL() + "] do not appear to be the same resource, " + - "please ensure the name property is correct"); + "please ensure the name property is correct or that the " + + "module is not defined twice"); } } diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java index e704437774b..96e686c66df 100644 --- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java +++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/CloudStackContextLoaderListener.java @@ -49,6 +49,7 @@ public class CloudStackContextLoaderListener extends ContextLoaderListener { public void contextInitialized(ServletContextEvent event) { try { cloudStackContext = new CloudStackSpringContext(); + event.getServletContext().setAttribute(CloudStackSpringContext.CLOUDSTACK_CONTEXT_SERVLET_KEY, cloudStackContext); } catch (IOException e) { log.error("Failed to start CloudStack", e); throw new RuntimeException("Failed to initialize CloudStack Spring modules", e); diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/ModuleBasedFilter.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/ModuleBasedFilter.java new file mode 100644 index 00000000000..9dd1b82e902 --- /dev/null +++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/web/ModuleBasedFilter.java @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cloudstack.spring.module.web; + +import javax.servlet.Filter; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; + +import org.apache.cloudstack.spring.module.factory.CloudStackSpringContext; +import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +import org.springframework.context.ApplicationContext; + +public abstract class ModuleBasedFilter implements Filter { + + boolean enabled = false; + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + String module = filterConfig.getInitParameter("module"); + CloudStackSpringContext context = + (CloudStackSpringContext) filterConfig.getServletContext().getAttribute(CloudStackSpringContext.CLOUDSTACK_CONTEXT_SERVLET_KEY); + + if ( context == null ) + return; + + ApplicationContext applicationContext = context.getApplicationContextForWeb(module); + if ( applicationContext != null ) { + AutowireCapableBeanFactory factory = applicationContext.getAutowireCapableBeanFactory(); + if ( factory != null ) { + factory.autowireBean(this); + enabled = true; + } + } + } + + @Override + public void destroy() { + enabled = false; + } + + public boolean isEnabled() { + return enabled; + } + +} From 27ce69fd556991f8860444c78efd1d329d57f852 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Wed, 6 Nov 2013 15:30:09 -0800 Subject: [PATCH 037/108] CLOUDSTACK-5066: Don't remove the current VPN users when updating If one VPN user and password is existed in current setup, then don't touch it, otherwise would result in this user's existing connection be dropped. --- systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh b/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh index 86148a34624..5afe0096d9a 100755 --- a/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh +++ b/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh @@ -150,8 +150,12 @@ add_l2tp_ipsec_user() { local u=$1 local passwd=$2 - remove_l2tp_ipsec_user $u - echo "$u * $passwd *" >> /etc/ppp/chap-secrets + uptodate=$(grep "^$u \* $passwd \*$" /etc/ppp/chap-secrets) + if [ "$uptodate" == "" ] + then + remove_l2tp_ipsec_user $u + echo "$u * $passwd *" >> /etc/ppp/chap-secrets + fi } rflag= From fac22936f645ee0ca2b8a7cdd0c7fa21e8c35666 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 6 Nov 2013 15:44:55 -0800 Subject: [PATCH 038/108] CLOUDSTACK-4979: if no hostName is passed to deployVm call, automatically generated hostName follows the pattern -. Example: VM-a6c6457e-e4d0-486f-a392-9239be9b36f5 --- server/src/com/cloud/vm/UserVmManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 80a40362d00..2c1343ae822 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2749,7 +2749,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } } else { if (hostName == null) { - hostName = uuidName; + //Generate name using uuid and instance.name global config + hostName = _configDao.getValue(Config.InstanceName.key()) + "-" + uuidName; } } From fc7489a2813315322766a6dda17cec2e4a7d8130 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 6 Nov 2013 15:51:53 -0800 Subject: [PATCH 039/108] CLOUDSTACK-5037: UI > Infrastructure > clusters > Settings tab > when "cpu.overprovisioning.factor" or "mem.overprovisioning.factor" is changed, pop up a warning message > change text. --- ui/scripts/system.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index a315492c6a2..fd6a13654a7 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -12033,7 +12033,7 @@ if (args.data.jsonObj.name == 'cpu.overprovisioning.factor' || args.data.jsonObj.name == 'mem.overprovisioning.factor') { cloudStack.dialog.notice({ - message: 'Please note - you are changing the over provisioning factor for a cluster with vms running. Please refer to the admin guide to understand the capacity calculation.' + message: 'Please note - if you are changing the over provisioning factor for a cluster with vms running, please refer to the admin guide to understand the capacity calculation.' }); } From 6d7674982afcd636542f5591b77f704f0b42b379 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 6 Nov 2013 15:56:04 -0800 Subject: [PATCH 040/108] CLOUDSTACK-4979: fix hostName for VmWare vms to follow the same logic --- .../src/com/cloud/vm/UserVmManagerImpl.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 2c1343ae822..9e699623307 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2732,10 +2732,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir long id = _vmDao.getNextInSequence(Long.class, "id"); - if (hostName != null) { - // Check is hostName is RFC compliant - checkNameForRFCCompliance(hostName); - } + String instanceName = null; String uuidName = UUID.randomUUID().toString(); @@ -2744,16 +2741,20 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (displayName != null) { hostName = displayName; } else { - hostName = uuidName; + hostName = generateHostName(uuidName); } } } else { if (hostName == null) { //Generate name using uuid and instance.name global config - hostName = _configDao.getValue(Config.InstanceName.key()) + "-" + uuidName; + hostName = generateHostName(uuidName); } } - + + if (hostName != null) { + // Check is hostName is RFC compliant + checkNameForRFCCompliance(hostName); + } instanceName = VirtualMachineName.getVmName(id, owner.getId(), _instance); // Check if VM with instanceName already exists. @@ -2825,6 +2826,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir return vm; } + private String generateHostName(String uuidName) { + return _instance + "-" + uuidName; + } + private UserVmVO commitUserVm(final DataCenter zone, final VirtualMachineTemplate template, final String hostName, final String displayName, final Account owner, final Long diskOfferingId, final Long diskSize, final String userData, final HypervisorType hypervisor, final Account caller, final Boolean isDisplayVmEnabled, final String keyboard, final long accountId, From 6916665623135e88f34ff1f8797cf5391911e3cd Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 6 Nov 2013 16:29:33 -0800 Subject: [PATCH 041/108] CLOUDSTACK-4793: UI > Infrastructure > Virtual Routers > detail tab > add Requires Upgrade field to reflect new parameter requiresupgrade in API response. --- ui/scripts/sharedFunctions.js | 15 ++++++++++----- ui/scripts/system.js | 13 +++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index fddbd70fafe..40440dfc807 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -924,11 +924,16 @@ cloudStack.converters = { } return localDate; }, - toBooleanText: function(booleanValue) { - if (booleanValue == true) - return "Yes"; - - return "No"; + toBooleanText: function(booleanValue) { + var text1; + if (booleanValue == true) { + text1 = "Yes"; + } else if (booleanValue == false) { + text1 = "No"; + } else { //booleanValue == undefined + text1 = ""; + } + return text1; }, convertHz: function(hz) { if (hz == null) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index fd6a13654a7..e568a6d79f1 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7973,6 +7973,10 @@ version: { label: 'label.version' }, + requiresupgrade: { + label: 'Requires Upgrade', + converter: cloudStack.converters.toBooleanText + }, guestnetworkid: { label: 'label.network.id' }, @@ -17013,14 +17017,7 @@ jsonObj["redundantRouterState"] = jsonObj.redundantstate; } else { jsonObj["redundantRouterState"] = ""; - } - - //jsonObj.version = '4.2.0-SNAPSHOT'; //for testing only - if (jsonObj.version != undefined && jsonObj.version.length > 0) { - if (jsonObj.version != g_cloudstackversion) { //if VirtualRouter version is different from management server version - jsonObj.version += " (Requires Upgrade)"; - } - } + } } var refreshNspData = function(nspName) { From 10c513a2592d2be4a06b0478672a3ea0b1ad0da3 Mon Sep 17 00:00:00 2001 From: Mike Tutkowski Date: Wed, 6 Nov 2013 20:51:33 -0700 Subject: [PATCH 042/108] CLOUDSTACK-4810: Enable hypervisor snapshots for CloudStack-managed storage (for XenServer and VMware) --- api/src/com/cloud/offering/DiskOffering.java | 3 +++ api/src/com/cloud/storage/Volume.java | 4 ++++ .../apache/cloudstack/api/ApiConstants.java | 1 + .../admin/offering/CreateDiskOfferingCmd.java | 7 ++++++ .../classes/resources/messages.properties | 1 + .../orchestration/VolumeOrchestrator.java | 24 +++++++++++++++++++ .../src/com/cloud/storage/DiskOfferingVO.java | 11 +++++++++ .../src/com/cloud/storage/VolumeVO.java | 12 +++++++++- .../storage/volume/VolumeObject.java | 10 ++++++++ .../SolidfirePrimaryDataStoreDriver.java | 21 +++++++++++----- .../ConfigurationManagerImpl.java | 13 +++++++--- setup/db/db/schema-421to430.sql | 5 +++- ui/dictionary.jsp | 1 + ui/scripts/configuration.js | 21 +++++++++++++++- ui/scripts/docs.js | 4 ++++ 15 files changed, 126 insertions(+), 12 deletions(-) diff --git a/api/src/com/cloud/offering/DiskOffering.java b/api/src/com/cloud/offering/DiskOffering.java index a4c7dc30e00..fa6d66b1ab0 100644 --- a/api/src/com/cloud/offering/DiskOffering.java +++ b/api/src/com/cloud/offering/DiskOffering.java @@ -89,4 +89,7 @@ public interface DiskOffering extends InfrastructureEntity, Identity, InternalId Long getIopsWriteRate(); + void setHypervisorSnapshotReserve(Integer hypervisorSnapshotReserve); + + Integer getHypervisorSnapshotReserve(); } diff --git a/api/src/com/cloud/storage/Volume.java b/api/src/com/cloud/storage/Volume.java index 57e04944d26..dd59f12f4d4 100755 --- a/api/src/com/cloud/storage/Volume.java +++ b/api/src/com/cloud/storage/Volume.java @@ -185,4 +185,8 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba void setReservationId(String reserv); Storage.ImageFormat getFormat(); Long getVmSnapshotChainSize(); + + void setHypervisorSnapshotReserve(Integer hypervisorSnapshotReserve); + + Integer getHypervisorSnapshotReserve(); } diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 3b2bc67534f..8ab6c5e252e 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -54,6 +54,7 @@ public class ApiConstants { public static final String CUSTOMIZED_IOPS = "customizediops"; public static final String MIN_IOPS = "miniops"; public static final String MAX_IOPS = "maxiops"; + public static final String HYPERVISOR_SNAPSHOT_RESERVE = "hypervisorsnapshotreserve"; public static final String DESCRIPTION = "description"; public static final String DESTINATION_ZONE_ID = "destzoneid"; public static final String DETAILS = "details"; diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java index 47415911e9b..77aeb542819 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java @@ -86,6 +86,9 @@ public class CreateDiskOfferingCmd extends BaseCmd { @Parameter(name=ApiConstants.MAX_IOPS, type=CommandType.LONG, required=false, description="max iops of the disk offering") private Long maxIops; + @Parameter(name=ApiConstants.HYPERVISOR_SNAPSHOT_RESERVE, type=CommandType.INTEGER, required=false, description="Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)") + private Integer hypervisorSnapshotReserve; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -150,6 +153,10 @@ public class CreateDiskOfferingCmd extends BaseCmd { return displayOffering; } + public Integer getHypervisorSnapshotReserve() { + return hypervisorSnapshotReserve; + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index e450c29a0c5..5885bd00c11 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -39,6 +39,7 @@ label.custom.disk.iops=Custom IOPS label.disk.iops.min=Min IOPS label.disk.iops.max=Max IOPS label.disk.iops.total=IOPS Total +label.hypervisor.snapshot.reserve=Hypervisor Snapshot Reserve label.view.secondary.ips=View secondary IPs message.validate.invalid.characters=Invalid characters found; please correct. message.acquire.ip.nic=Please confirm that you would like to acquire a new secondary IP for this NIC.
NOTE: You need to manually configure the newly-acquired secondary IP inside the virtual machine. diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 8d841d8fd1b..ab626c86354 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -406,6 +406,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati AsyncCallFuture future = null; boolean isNotCreatedFromTemplate = volume.getTemplateId() == null ? true : false; if (isNotCreatedFromTemplate) { + volume = updateHypervisorSnapshotReserveForVolume(diskOffering, volume, hyperType); future = volService.createVolumeAsync(volume, store); } else { TemplateInfo templ = tmplFactory.getTemplate(template.getId(), DataStoreRole.Image); @@ -435,6 +436,29 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati throw new CloudRuntimeException("create volume failed even after template re-deploy"); } + // For managed storage on Xen and VMware, we need to potentially make space for hypervisor snapshots. + // The disk offering can collect this information and pass it on to the volume that's about to be created. + // Ex. if you want a 10 GB CloudStack volume to reside on managed storage on Xen, this leads to an SR + // that is a total size of (10 GB * (hypervisorSnapshotReserveSpace / 100) + 10 GB). + private VolumeInfo updateHypervisorSnapshotReserveForVolume(DiskOffering diskOffering, VolumeInfo volumeInfo, HypervisorType hyperType) { + Integer hypervisorSnapshotReserve = diskOffering.getHypervisorSnapshotReserve(); + + if (hyperType == HypervisorType.KVM) { + hypervisorSnapshotReserve = null; + } + else if (hypervisorSnapshotReserve == null || hypervisorSnapshotReserve < 0) { + hypervisorSnapshotReserve = 0; + } + + VolumeVO volume = _volsDao.findById(volumeInfo.getId()); + + volume.setHypervisorSnapshotReserve(hypervisorSnapshotReserve); + + _volsDao.update(volume.getId(), volume); + + return volFactory.getVolume(volume.getId()); + } + public String getRandomVolumeName() { return UUID.randomUUID().toString(); } diff --git a/engine/schema/src/com/cloud/storage/DiskOfferingVO.java b/engine/schema/src/com/cloud/storage/DiskOfferingVO.java index 04064b64b56..b5b34519102 100755 --- a/engine/schema/src/com/cloud/storage/DiskOfferingVO.java +++ b/engine/schema/src/com/cloud/storage/DiskOfferingVO.java @@ -127,6 +127,9 @@ public class DiskOfferingVO implements DiskOffering { @Column(name = "state") State state; + @Column(name="hv_ss_reserve") + Integer hypervisorSnapshotReserve; + public DiskOfferingVO() { uuid = UUID.randomUUID().toString(); } @@ -440,4 +443,12 @@ public class DiskOfferingVO implements DiskOffering { public Long getIopsWriteRate() { return iopsWriteRate; } + + public void setHypervisorSnapshotReserve(Integer hypervisorSnapshotReserve) { + this.hypervisorSnapshotReserve = hypervisorSnapshotReserve; + } + + public Integer getHypervisorSnapshotReserve() { + return hypervisorSnapshotReserve; + } } diff --git a/engine/schema/src/com/cloud/storage/VolumeVO.java b/engine/schema/src/com/cloud/storage/VolumeVO.java index 86c8b3d90c6..a130d89a86d 100755 --- a/engine/schema/src/com/cloud/storage/VolumeVO.java +++ b/engine/schema/src/com/cloud/storage/VolumeVO.java @@ -35,7 +35,6 @@ import javax.persistence.Transient; import com.cloud.storage.Storage.StoragePoolType; import com.cloud.utils.NumbersUtil; import com.cloud.utils.db.GenericDao; -import com.cloud.vm.VirtualMachine.State; @Entity @Table(name = "volumes") @@ -161,6 +160,9 @@ public class VolumeVO implements Volume { // @Column(name="reservation") String reservationId; + @Column(name="hv_ss_reserve") + Integer hypervisorSnapshotReserve; + // Real Constructor public VolumeVO(Type type, String name, long dcId, long domainId, long accountId, long diskOfferingId, long size, @@ -580,4 +582,12 @@ public class VolumeVO implements Volume { public void setState(State state) { this.state = state; } + + public void setHypervisorSnapshotReserve(Integer hypervisorSnapshotReserve) { + this.hypervisorSnapshotReserve = hypervisorSnapshotReserve; + } + + public Integer getHypervisorSnapshotReserve() { + return hypervisorSnapshotReserve; + } } diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java index f5a1276cf2d..f761a0c60ba 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java @@ -141,6 +141,16 @@ public class VolumeObject implements VolumeInfo { return volumeVO.getMaxIops(); } + @Override + public void setHypervisorSnapshotReserve(Integer hypervisorSnapshotReserve) { + volumeVO.setHypervisorSnapshotReserve(hypervisorSnapshotReserve); + } + + @Override + public Integer getHypervisorSnapshotReserve() { + return volumeVO.getHypervisorSnapshotReserve(); + } + public long getVolumeId() { return volumeVO.getId(); } diff --git a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java index a02474d7371..1c726cd110b 100644 --- a/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java +++ b/plugins/storage/volume/solidfire/src/org/apache/cloudstack/storage/datastore/driver/SolidfirePrimaryDataStoreDriver.java @@ -16,6 +16,7 @@ // under the License. package org.apache.cloudstack.storage.datastore.driver; +import java.text.NumberFormat; import java.util.List; import javax.inject.Inject; @@ -278,8 +279,7 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver { Long minIops = volumeInfo.getMinIops(); Long maxIops = volumeInfo.getMaxIops(); - if (minIops == null || minIops <= 0 || - maxIops == null || maxIops <= 0) { + if (minIops == null || minIops <= 0 || maxIops == null || maxIops <= 0) { long defaultMaxIops = getDefaultMaxIops(storagePoolId); iops = new Iops(getDefaultMinIops(storagePoolId), defaultMaxIops, getDefaultBurstIops(storagePoolId, defaultMaxIops)); @@ -288,10 +288,20 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver { iops = new Iops(volumeInfo.getMinIops(), volumeInfo.getMaxIops(), getDefaultBurstIops(storagePoolId, volumeInfo.getMaxIops())); } - long volumeSize = volumeInfo.getSize() * 2; // in reality, use a multiplier that's at cluster-level scope + long volumeSize = volumeInfo.getSize(); + Integer hypervisorSnapshotReserve = volumeInfo.getHypervisorSnapshotReserve(); + + if (hypervisorSnapshotReserve != null) { + if (hypervisorSnapshotReserve < 25) { + hypervisorSnapshotReserve = 25; + } + + volumeSize += volumeSize * (hypervisorSnapshotReserve / 100f); + } long sfVolumeId = SolidFireUtil.createSolidFireVolume(mVip, mPort, clusterAdminUsername, clusterAdminPassword, - getSolidFireVolumeName(volumeInfo.getName()), sfAccountId, volumeSize, true, volumeInfo.getSize().toString(), + getSolidFireVolumeName(volumeInfo.getName()), sfAccountId, volumeSize, true, + NumberFormat.getNumberInstance().format(volumeInfo.getSize().toString()), iops.getMinIops(), iops.getMaxIops(), iops.getBurstIops()); return SolidFireUtil.getSolidFireVolume(mVip, mPort, clusterAdminUsername, clusterAdminPassword, sfVolumeId); @@ -410,8 +420,7 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver { SolidFireConnection sfConnection = getSolidFireConnection(storagePoolId); if (!sfAccountExists(sfAccountName, sfConnection)) { - SolidFireUtil.SolidFireAccount sfAccount = createSolidFireAccount(sfAccountName, - sfConnection); + SolidFireUtil.SolidFireAccount sfAccount = createSolidFireAccount(sfAccountName, sfConnection); updateCsDbWithAccountInfo(account.getId(), sfAccount); } diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 2e9b3889dfb..a31d06f4e67 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2188,7 +2188,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati protected DiskOfferingVO createDiskOffering(Long domainId, String name, String description, Long numGibibytes, String tags, boolean isCustomized, boolean localStorageRequired, boolean isDisplayOfferingEnabled, Boolean isCustomizedIops, Long minIops, Long maxIops, - Long bytesReadRate, Long bytesWriteRate, Long iopsReadRate, Long iopsWriteRate) { + Long bytesReadRate, Long bytesWriteRate, Long iopsReadRate, Long iopsWriteRate, Integer hypervisorSnapshotReserve) { long diskSize = 0;// special case for custom disk offerings if (numGibibytes != null && (numGibibytes <= 0)) { throw new InvalidParameterValueException("Please specify a disk size of at least 1 Gb."); @@ -2254,6 +2254,12 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati if (iopsWriteRate != null && (iopsWriteRate > 0)) newDiskOffering.setIopsWriteRate(iopsWriteRate); + if (hypervisorSnapshotReserve != null && hypervisorSnapshotReserve < 0) { + throw new InvalidParameterValueException("If provided, Hypervisor Snapshot Reserve must be greater than or equal to 0."); + } + + newDiskOffering.setHypervisorSnapshotReserve(hypervisorSnapshotReserve); + CallContext.current().setEventDetails("Disk offering id=" + newDiskOffering.getId()); DiskOfferingVO offering = _diskOfferingDao.persist(newDiskOffering); if (offering != null) { @@ -2303,10 +2309,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati Long bytesWriteRate = cmd.getBytesWriteRate(); Long iopsReadRate = cmd.getIopsReadRate(); Long iopsWriteRate = cmd.getIopsWriteRate(); + Integer hypervisorSnapshotReserve = cmd.getHypervisorSnapshotReserve(); return createDiskOffering(domainId, name, description, numGibibytes, tags, isCustomized, - localStorageRequired, isDisplayOfferingEnabled, isCustomizedIops, minIops, maxIops, - bytesReadRate, bytesWriteRate, iopsReadRate, iopsWriteRate); + localStorageRequired, isDisplayOfferingEnabled, isCustomizedIops, minIops, maxIops, + bytesReadRate, bytesWriteRate, iopsReadRate, iopsWriteRate, hypervisorSnapshotReserve); } @Override diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index 26e4abf2251..980650dce17 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -16,7 +16,7 @@ -- under the License. --; --- Schema upgrade from 4.2.0 to 4.3.0; +-- Schema upgrade from 4.2.1 to 4.3.0; --; -- Disable foreign key checking @@ -108,6 +108,9 @@ UPDATE `cloud`.`configuration` SET `default_value` = `value`; #Upgrade the offerings and template table to have actual remove and states ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `state` CHAR(40) NOT NULL DEFAULT 'Active' COMMENT 'state for disk offering'; +ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `hv_ss_reserve` int(32) unsigned DEFAULT NULL COMMENT 'Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)'; + +ALTER TABLE `cloud`.`volumes` ADD COLUMN `hv_ss_reserve` int(32) unsigned DEFAULT NULL COMMENT 'Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)'; UPDATE `cloud`.`disk_offering` SET `state`='Inactive' WHERE `removed` IS NOT NULL; UPDATE `cloud`.`disk_offering` SET `removed`=NULL; diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index 8bd547bf3ce..0ccfc231434 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -50,6 +50,7 @@ dictionary = { 'label.custom.disk.iops': '', 'label.disk.iops.min': '', 'label.disk.iops.max': '', +'label.hypervisor.snapshot.reserve': '', 'label.acquire.new.secondary.ip': '', 'label.view.secondary.ips': '', 'message.acquire.ip.nic': '', diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 42805973881..9c051690a41 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -1241,6 +1241,7 @@ var $isCustomizedIops = $form.find('.form-item[rel=isCustomizedIops]'); var $minIops = $form.find('.form-item[rel=minIops]'); var $maxIops = $form.find('.form-item[rel=maxIops]'); + var $hypervisorSnapshotReserve = $form.find('.form-item[rel=hypervisorSnapshotReserve]'); var $diskBytesReadRate = $form.find('.form-item[rel=diskBytesReadRate]'); var $diskBytesWriteRate = $form.find('.form-item[rel=diskBytesWriteRate]'); var $diskIopsReadRate = $form.find('.form-item[rel=diskIopsReadRate]'); @@ -1256,17 +1257,20 @@ $isCustomizedIops.css('display', 'inline-block'); - if ($isCustomizedIops == true) { + if ($isCustomizedIops.find('input[type=checkbox]').is(':checked')) { $minIops.hide(); $maxIops.hide(); } else { $minIops.css('display', 'inline-block'); $maxIops.css('display', 'inline-block'); } + + $hypervisorSnapshotReserve.css('display', 'inline-block'); } else if (qosId == 'hypervisor') { // Hypervisor Qos $isCustomizedIops.hide(); $minIops.hide(); $maxIops.hide(); + $hypervisorSnapshotReserve.hide(); $diskBytesReadRate.css('display', 'inline-block'); $diskBytesWriteRate.css('display', 'inline-block'); @@ -1280,6 +1284,7 @@ $isCustomizedIops.hide(); $minIops.hide(); $maxIops.hide(); + $hypervisorSnapshotReserve.hide(); } }); } @@ -1309,6 +1314,14 @@ number: true } }, + hypervisorSnapshotReserve: { + label: 'label.hypervisor.snapshot.reserve', + docID: 'helpDiskOfferingHypervisorSnapshotReserve', + validation: { + required: false, + number: true + } + }, diskBytesReadRate: { label: 'label.disk.bytes.read.rate', docID: 'helpDiskOfferingDiskBytesReadRate', @@ -1416,6 +1429,12 @@ }); } } + + if (args.data.hypervisorSnapshotReserve != null && args.data.hypervisorSnapshotReserve.length > 0) { + $.extend(data, { + hypervisorsnapshotreserve: args.data.hypervisorSnapshotReserve + }); + } } else if (args.data.qosType == 'hypervisor') { if (args.data.diskBytesReadRate != null && args.data.diskBytesReadRate.length > 0) { $.extend(data, { diff --git a/ui/scripts/docs.js b/ui/scripts/docs.js index 7b7edf47bc4..a3151b18297 100755 --- a/ui/scripts/docs.js +++ b/ui/scripts/docs.js @@ -326,6 +326,10 @@ cloudStack.docs = { desc: 'Appears only if Custom IOPS is not selected. Define the maximum volume IOPS.', externalLink: '' }, + helpDiskOfferingHypervisorSnapshotReserve: { + desc: 'Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware) (Ex. The value 25 means 25%.)).', + externalLink: '' + }, helpDiskOfferingStorageTags: { desc: 'Comma-separated list of attributes that should be associated with the primary storage for this disk. For example "ssd,blue".', externalLink: '' From 01b29a0caf2ebb196624e2e0eeaab00e0de5386a Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Thu, 7 Nov 2013 11:05:30 +0530 Subject: [PATCH 043/108] CLOUDSTACK-3715. Increasing VMware vCenter session timeout value to 20 minutes from 10 minutes. --- .../src/com/cloud/hypervisor/vmware/util/VmwareClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java index d1adbc2dc30..13172fbea23 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java @@ -132,8 +132,8 @@ public class VmwareClient { ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true); - ctxt.put("com.sun.xml.internal.ws.request.timeout", 600000); - ctxt.put("com.sun.xml.internal.ws.connect.timeout", 600000); + ctxt.put("com.sun.xml.internal.ws.request.timeout", 1200000); + ctxt.put("com.sun.xml.internal.ws.connect.timeout", 1200000); ServiceContent serviceContent = vimPort.retrieveServiceContent(SVC_INST_REF); From 7095ea2b5e497620c8c879517565046e3b46e493 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Wed, 6 Nov 2013 21:42:44 +0530 Subject: [PATCH 044/108] CLOUDSTACK-4738 Dynamic compute offering. Signed-off-by: Koushik Das --- .../com/cloud/offering/ServiceOffering.java | 8 +- api/src/com/cloud/vm/UserVmService.java | 33 ++-- .../apache/cloudstack/api/ApiConstants.java | 1 + .../offering/CreateServiceOfferingCmd.java | 23 ++- .../api/command/user/vm/DeployVMCmd.java | 34 +++- .../service/VolumeOrchestrationService.java | 2 +- .../service/api/OrchestrationService.java | 4 +- .../src/com/cloud/event/UsageEventUtils.java | 16 ++ .../cloud/vm/VirtualMachineManagerImpl.java | 8 +- .../orchestration/CloudOrchestrator.java | 7 +- .../orchestration/VolumeOrchestrator.java | 6 +- ...spring-engine-schema-core-daos-context.xml | 1 + .../com/cloud/event/UsageEventDetailsVO.java | 72 ++++++++ .../com/cloud/event/dao/UsageEventDao.java | 3 + .../cloud/event/dao/UsageEventDaoImpl.java | 9 +- .../cloud/event/dao/UsageEventDetailsDao.java | 33 ++++ .../event/dao/UsageEventDetailsDaoImpl.java | 104 ++++++++++++ .../com/cloud/service/ServiceOfferingVO.java | 43 +++-- .../cloud/service/dao/ServiceOfferingDao.java | 5 + .../service/dao/ServiceOfferingDaoImpl.java | 52 +++++- .../implicitplanner/ImplicitPlannerTest.java | 3 +- .../BaremetalPxeManagerImpl.java | 2 +- .../impl/UserConcentratedAllocator.java | 2 +- .../com/cloud/api/query/QueryManagerImpl.java | 2 +- .../cloud/capacity/CapacityManagerImpl.java | 25 +-- .../ConfigurationManagerImpl.java | 24 +-- .../VirtualNetworkApplianceManagerImpl.java | 2 +- .../src/com/cloud/vm/UserVmManagerImpl.java | 158 ++++++++++++------ .../cloud/capacity/CapacityManagerTest.java | 2 +- .../test/com/cloud/vm/UserVmManagerTest.java | 2 +- .../CreateNetworkOfferingTest.java | 12 ++ .../service/ServiceOfferingVOTest.java | 49 ++++++ .../test/resources/createNetworkOffering.xml | 4 +- setup/db/db/schema-421to430.sql | 10 ++ 34 files changed, 618 insertions(+), 143 deletions(-) create mode 100644 engine/schema/src/com/cloud/event/UsageEventDetailsVO.java create mode 100644 engine/schema/src/com/cloud/event/dao/UsageEventDetailsDao.java create mode 100644 engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java create mode 100644 server/test/org/apache/cloudstack/service/ServiceOfferingVOTest.java diff --git a/api/src/com/cloud/offering/ServiceOffering.java b/api/src/com/cloud/offering/ServiceOffering.java index 9f7bf8e1315..e4c65cdaf0c 100755 --- a/api/src/com/cloud/offering/ServiceOffering.java +++ b/api/src/com/cloud/offering/ServiceOffering.java @@ -61,17 +61,17 @@ public interface ServiceOffering extends DiskOffering, InfrastructureEntity, Int /** * @return # of cpu. */ - int getCpu(); + Integer getCpu(); /** * @return speed in mhz */ - int getSpeed(); + Integer getSpeed(); /** * @return ram size in megabytes */ - int getRamSize(); + Integer getRamSize(); /** * @return Does this service plan offer HA? @@ -117,4 +117,6 @@ public interface ServiceOffering extends DiskOffering, InfrastructureEntity, Int String getSystemVmType(); String getDeploymentPlanner(); + + boolean isDynamic(); } diff --git a/api/src/com/cloud/vm/UserVmService.java b/api/src/com/cloud/vm/UserVmService.java index 0b142e83b72..6fc8b54cfa1 100755 --- a/api/src/com/cloud/vm/UserVmService.java +++ b/api/src/com/cloud/vm/UserVmService.java @@ -136,6 +136,7 @@ public interface UserVmService { * Creates a Basic Zone User VM in the database and returns the VM to the * caller. * + * * @param zone * - availability zone for the virtual machine * @param serviceOffering @@ -181,13 +182,15 @@ public interface UserVmService { * @param displayVm * - Boolean flag whether to the display the vm to the end user or not * @param affinityGroupIdList - * * @param accountName * - an optional account for the virtual machine. Must be used * with domainId * @param domainId * - an optional domainId for the virtual machine. If the account * parameter is used, domainId must also be used + * @param cpuSpeed + * @param memory + * @param cpuNumber * @return UserVm object if successful. * * @throws InsufficientCapacityException @@ -201,15 +204,16 @@ public interface UserVmService { * @throws InsufficientResourcesException */ UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List securityGroupIdList, Account owner, String hostName, - String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, - HTTPMethod httpmethod, String userData, String sshKeyPair, Map requestedIps, - IpAddresses defaultIp, Boolean displayVm, String keyboard, List affinityGroupIdList) + String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, + HTTPMethod httpmethod, String userData, String sshKeyPair, Map requestedIps, + IpAddresses defaultIp, Boolean displayVm, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootdisksize) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException; /** * Creates a User VM in Advanced Zone (Security Group feature is enabled) in * the database and returns the VM to the caller. * + * * @param zone * - availability zone for the virtual machine * @param serviceOffering @@ -257,13 +261,15 @@ public interface UserVmService { * @param displayVm * - Boolean flag whether to the display the vm to the end user or not * @param affinityGroupIdList - * * @param accountName * - an optional account for the virtual machine. Must be used * with domainId * @param domainId * - an optional domainId for the virtual machine. If the account * parameter is used, domainId must also be used + * @param CpuSpeed + * @param memory + * @param cpuNumber * @return UserVm object if successful. * * @throws InsufficientCapacityException @@ -277,14 +283,15 @@ public interface UserVmService { * @throws InsufficientResourcesException */ UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List networkIdList, List securityGroupIdList, - Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, String sshKeyPair, - Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List affinityGroupIdList) + Account owner, String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, String sshKeyPair, + Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootdisksize) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException; /** * Creates a User VM in Advanced Zone (Security Group feature is disabled) * in the database and returns the VM to the caller. * + * * @param zone * - availability zone for the virtual machine * @param serviceOffering @@ -329,15 +336,17 @@ public interface UserVmService { * @param displayVm * - Boolean flag whether to the display the vm to the end user or not * @param affinityGroupIdList - * * @param accountName * - an optional account for the virtual machine. Must be used * with domainId * @param domainId * - an optional domainId for the virtual machine. If the account * parameter is used, domainId must also be used + * @param cpuSpeed + * @param memory + * @param cpuNumber * @return UserVm object if successful. - * + * * @throws InsufficientCapacityException * if there is insufficient capacity to deploy the VM. * @throws ConcurrentOperationException @@ -349,9 +358,9 @@ public interface UserVmService { * @throws InsufficientResourcesException */ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List networkIdList, Account owner, String hostName, - String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, - HTTPMethod httpmethod, String userData, String sshKeyPair, Map requestedIps, - IpAddresses defaultIps, Boolean displayVm, String keyboard, List affinityGroupIdList) + String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, + HTTPMethod httpmethod, String userData, String sshKeyPair, Map requestedIps, + IpAddresses defaultIps, Boolean displayVm, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootdkisksize) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException; diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 8ab6c5e252e..20e848db287 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -61,6 +61,7 @@ public class ApiConstants { public static final String DEVICE_ID = "deviceid"; public static final String DISK_OFFERING_ID = "diskofferingid"; public static final String DISK_SIZE = "disksize"; + public static final String ROOT_DISK_SIZE = "rootdisksize"; public static final String DISPLAY_NAME = "displayname"; public static final String DISPLAY_NETWORK = "displaynetwork"; public static final String DISPLAY_NIC = "displaynic"; diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java index decac29ae6b..63f19cc7057 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java @@ -41,17 +41,17 @@ public class CreateServiceOfferingCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name=ApiConstants.CPU_NUMBER, type=CommandType.LONG, required=true, description="the CPU number of the service offering") - private Long cpuNumber; + @Parameter(name=ApiConstants.CPU_NUMBER, type=CommandType.INTEGER, required=false, description="the CPU number of the service offering") + private Integer cpuNumber; - @Parameter(name=ApiConstants.CPU_SPEED, type=CommandType.LONG, required=true, description="the CPU speed of the service offering in MHz.") - private Long cpuSpeed; + @Parameter(name=ApiConstants.CPU_SPEED, type=CommandType.INTEGER, required=false, description="the CPU speed of the service offering in MHz.") + private Integer cpuSpeed; @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the service offering") private String displayText; - @Parameter(name=ApiConstants.MEMORY, type=CommandType.LONG, required=true, description="the total memory of the service offering in MB") - private Long memory; + @Parameter(name=ApiConstants.MEMORY, type=CommandType.INTEGER, required=false, description="the total memory of the service offering in MB") + private Integer memory; @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the service offering") private String serviceOfferingName; @@ -109,11 +109,11 @@ public class CreateServiceOfferingCmd extends BaseCmd { /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// - public Long getCpuNumber() { + public Integer getCpuNumber() { return cpuNumber; } - public Long getCpuSpeed() { + public Integer getCpuSpeed() { return cpuSpeed; } @@ -121,7 +121,7 @@ public class CreateServiceOfferingCmd extends BaseCmd { return displayText; } - public Long getMemory() { + public Integer getMemory() { return memory; } @@ -173,6 +173,11 @@ public class CreateServiceOfferingCmd extends BaseCmd { return deploymentPlanner; } + public boolean getCustomized() { + return (cpuNumber == null || memory == null || cpuSpeed == null); + } + + public Map getDetails() { if (details == null || details.isEmpty()) { return null; diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index 8a6cea79091..3643f91de6c 100755 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -188,6 +188,18 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { @Parameter(name=ApiConstants.DISPLAY_VM, type=CommandType.BOOLEAN, since="4.2", description="an optional field, whether to the display the vm to the end user or not.") private Boolean displayVm; + @Parameter(name=ApiConstants.CPU_SPEED, type = CommandType.INTEGER, since="4.3", description = "optional field to specify the cpu speed when using dynamic compute offering.") + private Integer cpuSpeed; + + @Parameter(name=ApiConstants.MEMORY, type = CommandType.INTEGER, since="4.3", description = "optional field to specify the memory when using dynamic compute offering") + private Integer memory; + + @Parameter(name=ApiConstants.CPU_NUMBER, type=CommandType.INTEGER, since="4.3", description = "optional field to specify the number of cpu cores when using dynamic offering.") + private Integer cpuNumber; + + @Parameter(name=ApiConstants.ROOT_DISK_SIZE, type=CommandType.LONG, since="4.3", description = "optional field to specify the number of cpu cores when using dynamic offering.") + private Long rootdisksize; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -227,6 +239,22 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { return displayVm; } + public Integer getMemory() { + return memory; + } + + public Integer getCpuSpeed() { + return cpuSpeed; + } + + public Integer getCpuNumber() { + return cpuNumber; + } + + public Long getRootdisksize() { + return rootdisksize; + } + public List getSecurityGroupIdList() { if (securityGroupNameList != null && securityGroupIdList != null) { throw new InvalidParameterValueException("securitygroupids parameter is mutually exclusive with securitygroupnames parameter"); @@ -495,19 +523,19 @@ public class DeployVMCmd extends BaseAsyncCreateCmd { throw new InvalidParameterValueException("Can't specify network Ids in Basic zone"); } else { vm = _userVmService.createBasicSecurityGroupVirtualMachine(zone, serviceOffering, template, getSecurityGroupIdList(), owner, name, - displayName, diskOfferingId, size, group, getHypervisor(), getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, displayVm, keyboard, getAffinityGroupIdList()); + displayName, diskOfferingId, size, group, getHypervisor(), getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, displayVm, keyboard, getAffinityGroupIdList(), cpuSpeed, memory, cpuNumber, rootdisksize); } } else { if (zone.isSecurityGroupEnabled()) { vm = _userVmService.createAdvancedSecurityGroupVirtualMachine(zone, serviceOffering, template, getNetworkIds(), getSecurityGroupIdList(), - owner, name, displayName, diskOfferingId, size, group, getHypervisor(), getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, displayVm, keyboard, getAffinityGroupIdList()); + owner, name, displayName, diskOfferingId, size, group, getHypervisor(), getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, displayVm, keyboard, getAffinityGroupIdList(), cpuSpeed, memory, cpuNumber, rootdisksize ); } else { if (getSecurityGroupIdList() != null && !getSecurityGroupIdList().isEmpty()) { throw new InvalidParameterValueException("Can't create vm with security groups; security group feature is not enabled per zone"); } vm = _userVmService.createAdvancedVirtualMachine(zone, serviceOffering, template, getNetworkIds(), owner, name, displayName, - diskOfferingId, size, group, getHypervisor(), getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, displayVm, keyboard, getAffinityGroupIdList()); + diskOfferingId, size, group, getHypervisor(), getHttpMethod(), userData, sshKeyPairName, getIpToNetworkMap(), addrs, displayVm, keyboard, getAffinityGroupIdList(), cpuSpeed, memory, cpuNumber, rootdisksize); } } diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java index a773ac42a3a..ad957d5ac8f 100644 --- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java +++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java @@ -86,7 +86,7 @@ public interface VolumeOrchestrationService { boolean canVmRestartOnAnotherServer(long vmId); - DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering offering, VirtualMachineTemplate template, VirtualMachine vm, Account owner); + DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering offering, Long rootDisksize, VirtualMachineTemplate template, VirtualMachine vm, Account owner); String getVmNameFromVolumeId(long volumeId); diff --git a/engine/api/src/org/apache/cloudstack/engine/service/api/OrchestrationService.java b/engine/api/src/org/apache/cloudstack/engine/service/api/OrchestrationService.java index 64ef063d096..8c582276ade 100755 --- a/engine/api/src/org/apache/cloudstack/engine/service/api/OrchestrationService.java +++ b/engine/api/src/org/apache/cloudstack/engine/service/api/OrchestrationService.java @@ -55,6 +55,7 @@ public interface OrchestrationService { * @param computeTags tags for the compute * @param rootDiskTags tags for the root disk * @param networks networks that this VM should join + * @param rootDiskSize size the root disk in case of templates. * @return VirtualMachineEntity */ @POST @@ -73,7 +74,8 @@ public interface OrchestrationService { @QueryParam("compute-tags") List computeTags, @QueryParam("root-disk-tags") List rootDiskTags, @QueryParam("network-nic-map") Map networkNicMap, - @QueryParam("deploymentplan") DeploymentPlan plan + @QueryParam("deploymentplan") DeploymentPlan plan, + @QueryParam("root-disk-size") Long rootDiskSize ) throws InsufficientCapacityException; @POST diff --git a/engine/components-api/src/com/cloud/event/UsageEventUtils.java b/engine/components-api/src/com/cloud/event/UsageEventUtils.java index b44ed3280db..a4be4dd58c6 100644 --- a/engine/components-api/src/com/cloud/event/UsageEventUtils.java +++ b/engine/components-api/src/com/cloud/event/UsageEventUtils.java @@ -25,6 +25,7 @@ import java.util.Map; import javax.annotation.PostConstruct; import javax.inject.Inject; +import com.cloud.event.dao.UsageEventDetailsDao; import org.apache.log4j.Logger; import org.springframework.beans.factory.NoSuchBeanDefinitionException; @@ -38,6 +39,8 @@ import com.cloud.event.dao.UsageEventDao; import com.cloud.user.Account; import com.cloud.user.dao.AccountDao; import com.cloud.utils.component.ComponentContext; +import org.springframework.beans.factory.annotation.Autowire; +import org.springframework.beans.factory.annotation.Autowired; public class UsageEventUtils { @@ -103,6 +106,19 @@ public class UsageEventUtils { publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID); } + public static void publishUsageEvent(String usageType, long accountId, long zoneId, long resourceId, + String resourceName, Long offeringId, Long templateId, String resourceType, + String entityType, String entityUUID, Map details) { + saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, resourceType, details); + publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID); + } + + private static void saveUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, String resourceType, Map details) { + UsageEventVO usageEvent = new UsageEventVO(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, resourceType); + _usageEventDao.persist(usageEvent); + _usageEventDao.saveDetails(usageEvent.getId(), details); + } + public static void saveUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, Long size) { _usageEventDao.persist( new UsageEventVO(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, size)); } diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index b74b4c55bac..555a58faaa9 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -356,7 +356,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } else if (template.getFormat() == ImageFormat.BAREMETAL) { // Do nothing } else { - volumeMgr.allocateTemplatedVolume(Type.ROOT, "ROOT-" + vmFinal.getId(), rootDiskOffering.first(), template, vmFinal, owner); + volumeMgr.allocateTemplatedVolume(Type.ROOT, "ROOT-" + vmFinal.getId(), rootDiskOffering.first(), rootDiskOffering.second(), template, vmFinal, owner); } for (Map.Entry offering : dataDiskOfferingsFinal.entrySet()) { @@ -674,7 +674,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac ItWorkVO work = start.third(); VMInstanceVO startedVm = null; - ServiceOfferingVO offering = _offeringDao.findById(vm.getServiceOfferingId()); + ServiceOfferingVO offering = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId()); VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId()); if (s_logger.isDebugEnabled()) { @@ -2771,7 +2771,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac @Override public void checkIfCanUpgrade(VirtualMachine vmInstance, long newServiceOfferingId) { - ServiceOfferingVO newServiceOffering = _offeringDao.findById(newServiceOfferingId); + ServiceOfferingVO newServiceOffering = _offeringDao.findById(vmInstance.getId(), newServiceOfferingId); if (newServiceOffering == null) { throw new InvalidParameterValueException("Unable to find a service offering with id " + newServiceOfferingId); } @@ -2793,7 +2793,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac newServiceOffering.getName() + ")"); } - ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId()); + ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId()); // Check that the service offering being upgraded to has the same Guest IP type as the VM's current service offering // NOTE: With the new network refactoring in 2.2, we shouldn't need the check for same guest IP type anymore. diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java index 2fd10b66e32..5dd15ce0bb4 100755 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java @@ -164,7 +164,7 @@ public class CloudOrchestrator implements OrchestrationService { Long diskSize, List computeTags, List rootDiskTags, - Map networkNicMap, DeploymentPlan plan) throws InsufficientCapacityException { + Map networkNicMap, DeploymentPlan plan, Long rootDiskSize) throws InsufficientCapacityException { // VirtualMachineEntityImpl vmEntity = new VirtualMachineEntityImpl(id, owner, hostName, displayName, cpu, speed, memory, computeTags, rootDiskTags, networks, vmEntityManager); @@ -191,8 +191,9 @@ public class CloudOrchestrator implements OrchestrationService { Pair rootDiskOffering = new Pair(null, null); LinkedHashMap dataDiskOfferings = new LinkedHashMap(); - ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getServiceOfferingId()); + ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); rootDiskOffering.first(offering); + rootDiskOffering.second(rootDiskSize); if(vm.getDiskOfferingId() != null){ DiskOfferingVO diskOffering = _diskOfferingDao.findById(vm.getDiskOfferingId()); @@ -238,7 +239,7 @@ public class CloudOrchestrator implements OrchestrationService { VMInstanceVO vm = _vmDao.findByUuid(id); Pair rootDiskOffering = new Pair(null, null); - ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getServiceOfferingId()); + ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); rootDiskOffering.first(offering); LinkedHashMap dataDiskOfferings = new LinkedHashMap(); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index ab626c86354..f839d6cf343 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -586,11 +586,13 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati } @Override - public DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering offering, VirtualMachineTemplate template, VirtualMachine vm, Account owner) { + public DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering offering, Long rootDisksize, VirtualMachineTemplate template, VirtualMachine vm, Account owner) { assert (template.getFormat() != ImageFormat.ISO) : "ISO is not a template really...."; Long size = _tmpltMgr.getTemplateSize(template.getId(), vm.getDataCenterId()); - + if (rootDisksize != null) { + size = (rootDisksize * 1024 * 1024 * 1024); + } VolumeVO vol = new VolumeVO(type, name, vm.getDataCenterId(), diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml index 98ef018d791..a64e5c06e7c 100644 --- a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml +++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml @@ -263,6 +263,7 @@ + diff --git a/engine/schema/src/com/cloud/event/UsageEventDetailsVO.java b/engine/schema/src/com/cloud/event/UsageEventDetailsVO.java new file mode 100644 index 00000000000..d6d118b220f --- /dev/null +++ b/engine/schema/src/com/cloud/event/UsageEventDetailsVO.java @@ -0,0 +1,72 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.event; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="usage_event_details") +public class UsageEventDetailsVO { + + @Id + @Column(name="id") + long id; + + @Column(name = "usage_event_id", nullable = false) + long usageEventId; + + @Column(name = "name", nullable = false) + String key; + + @Column(name = "value") + String value; + + public UsageEventDetailsVO() { + } + + + public UsageEventDetailsVO(long usageEventId, String key, String value) { + this.key = key; + this.value = value; + this.usageEventId = usageEventId; + } + + public long getId() { + return id; + } + + public void setUsageEventId(long usageEventId) { + this.usageEventId = usageEventId; + } + + public long getUsageEventId() { + return usageEventId; + } + + public String getKey() { + return this.key; + } + + public String getValue() { + return this.value; + } + + } diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDao.java b/engine/schema/src/com/cloud/event/dao/UsageEventDao.java index 01979e18ea3..dc6f8242de0 100644 --- a/engine/schema/src/com/cloud/event/dao/UsageEventDao.java +++ b/engine/schema/src/com/cloud/event/dao/UsageEventDao.java @@ -18,6 +18,7 @@ package com.cloud.event.dao; import java.util.Date; import java.util.List; +import java.util.Map; import com.cloud.event.UsageEventVO; import com.cloud.utils.db.GenericDao; @@ -32,4 +33,6 @@ public interface UsageEventDao extends GenericDao { List listDirectIpEvents(Date startDate, Date endDate, long zoneId); + void saveDetails(long eventId, Map details); + } \ No newline at end of file diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java b/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java index 43339038c53..370afbafa4b 100644 --- a/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java +++ b/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java @@ -20,9 +20,11 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Date; import java.util.List; +import java.util.Map; import java.util.TimeZone; import javax.ejb.Local; +import javax.inject.Inject; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -51,7 +53,7 @@ public class UsageEventDaoImpl extends GenericDaoBase implem private static final String COPY_ALL_EVENTS = "INSERT INTO cloud_usage.usage_event (id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size) " + "SELECT id, type, account_id, created, zone_id, resource_id, resource_name, offering_id, template_id, size, resource_type, virtual_size FROM cloud.usage_event vmevt WHERE vmevt.id <= ?"; private static final String MAX_EVENT = "select max(id) from cloud.usage_event where created <= ?"; - + @Inject protected UsageEventDetailsDao usageEventDetailsDao; public UsageEventDaoImpl () { latestEventsSearch = createSearchBuilder(); @@ -184,4 +186,9 @@ public class UsageEventDaoImpl extends GenericDaoBase implem return listBy(sc, filter); } + @Override + public void saveDetails(long eventId, Map details) { + usageEventDetailsDao.persist(eventId, details); + } + } diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDao.java b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDao.java new file mode 100644 index 00000000000..fb9c0e27b09 --- /dev/null +++ b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDao.java @@ -0,0 +1,33 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package com.cloud.event.dao; +import java.util.Map; + +import com.cloud.event.UsageEventDetailsVO; +import com.cloud.utils.db.GenericDao; + + +public interface UsageEventDetailsDao extends GenericDao { + Map findDetails(long eventId); + + void persist(long eventId, Map details); + + UsageEventDetailsVO findDetail(long eventId, String key); + + void deleteDetails(long eventId); +} diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java new file mode 100644 index 00000000000..a4382c47a3c --- /dev/null +++ b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java @@ -0,0 +1,104 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.event.dao; + +import com.cloud.event.UsageEventDetailsVO; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.TransactionLegacy; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; + +import javax.ejb.Local; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +@Local(value={UsageEventDetailsDao.class}) +public class UsageEventDetailsDaoImpl extends GenericDaoBase implements UsageEventDetailsDao { + public static final Logger s_logger = Logger.getLogger(UsageEventDetailsDaoImpl.class.getName()); + + protected final SearchBuilder EventDetailsSearch; + protected final SearchBuilder DetailSearch; + + public UsageEventDetailsDaoImpl() { + + EventDetailsSearch =createSearchBuilder(); + EventDetailsSearch.and("eventId", EventDetailsSearch.entity().getUsageEventId(), SearchCriteria.Op.EQ); + EventDetailsSearch.done(); + + DetailSearch = createSearchBuilder(); + DetailSearch.and("eventId", DetailSearch.entity().getUsageEventId(), SearchCriteria.Op.EQ); + DetailSearch.and("key", DetailSearch.entity().getKey(), SearchCriteria.Op.EQ); + DetailSearch.done(); + + + } + + @Override + public void deleteDetails(long eventId) { + SearchCriteria sc = EventDetailsSearch.create(); + sc.setParameters("eventId", eventId); + + List results = search(sc, null); + for (UsageEventDetailsVO result : results) { + remove(result.getId()); + } + } + + @Override + public UsageEventDetailsVO findDetail(long eventId, String key) { + SearchCriteria sc = DetailSearch.create(); + sc.setParameters("eventId", eventId); + sc.setParameters("key", key); + + return findOneBy(sc); + } + + @Override + public Map findDetails(long eventId) { + SearchCriteria sc = EventDetailsSearch.create(); + sc.setParameters("eventId", eventId); + + List results = search(sc, null); + Map details = new HashMap(results.size()); + for (UsageEventDetailsVO result : results) { + details.put(result.getKey(), result.getValue()); + } + + return details; + } + + @Override + public void persist(long eventId, Map details) { + TransactionLegacy txn = TransactionLegacy.currentTxn(); + txn.start(); + SearchCriteria sc = EventDetailsSearch.create(); + sc.setParameters("eventId", eventId); + expunge(sc); + + for (Map.Entry detail : details.entrySet()) { + UsageEventDetailsVO vo = new UsageEventDetailsVO(eventId, detail.getKey(), detail.getValue()); + persist(vo); + } + txn.commit(); + } + + +} diff --git a/engine/schema/src/com/cloud/service/ServiceOfferingVO.java b/engine/schema/src/com/cloud/service/ServiceOfferingVO.java index 9a262c540b7..1e89addb519 100755 --- a/engine/schema/src/com/cloud/service/ServiceOfferingVO.java +++ b/engine/schema/src/com/cloud/service/ServiceOfferingVO.java @@ -18,12 +18,7 @@ package com.cloud.service; import java.util.Map; -import javax.persistence.Column; -import javax.persistence.DiscriminatorValue; -import javax.persistence.Entity; -import javax.persistence.PrimaryKeyJoinColumn; -import javax.persistence.Table; -import javax.persistence.Transient; +import javax.persistence.*; import com.cloud.offering.ServiceOffering; import com.cloud.storage.DiskOfferingVO; @@ -34,14 +29,18 @@ import com.cloud.vm.VirtualMachine; @DiscriminatorValue(value="Service") @PrimaryKeyJoinColumn(name="id") public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering { + public enum DynamicParameters { + cpuSpeed, cpuNumber, memory + }; + @Column(name="cpu") - private int cpu; + private Integer cpu; @Column(name="speed") - private int speed; + private Integer speed; @Column(name="ram_size") - private int ramSize; + private Integer ramSize; @Column(name="nw_rate") private Integer rateMbps; @@ -83,7 +82,8 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering super(); } - public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, boolean defaultUse) { + public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, String displayText, + boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, boolean defaultUse) { super(name, displayText, false, tags, recreatable, useLocalStorage, systemUse, true); this.cpu = cpu; this.ramSize = ramSize; @@ -97,7 +97,8 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase(); } - public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId) { + public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse, + boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId) { super(name, displayText, false, tags, recreatable, useLocalStorage, systemUse, true, domainId); this.cpu = cpu; this.ramSize = ramSize; @@ -110,12 +111,14 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase(); } - public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, String hostTag) { - this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId); + public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse, + boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, String hostTag) { + this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, systemUse, + vm_type, domainId); this.hostTag = hostTag; } - public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, + public ServiceOfferingVO(String name, Integer cpu, Integer ramSize, Integer speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, String hostTag, String deploymentPlanner) { @@ -159,7 +162,7 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering } @Override - public int getCpu() { + public Integer getCpu() { return cpu; } @@ -176,12 +179,12 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering } @Override - public int getSpeed() { + public Integer getSpeed() { return speed; } @Override - public int getRamSize() { + public Integer getRamSize() { return ramSize; } @@ -252,4 +255,10 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering public void setDetails(Map details) { this.details = details; } + + public boolean isDynamic() { + return cpu == null || speed == null || ramSize == null; + } + + } diff --git a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDao.java b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDao.java index 7da72088431..c5c4cff62c0 100644 --- a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDao.java +++ b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDao.java @@ -17,6 +17,7 @@ package com.cloud.service.dao; import java.util.List; +import java.util.Map; import com.cloud.service.ServiceOfferingVO; import com.cloud.utils.db.GenericDao; @@ -33,4 +34,8 @@ public interface ServiceOfferingDao extends GenericDao ServiceOfferingVO persistDeafultServiceOffering(ServiceOfferingVO offering); void loadDetails(ServiceOfferingVO serviceOffering); void saveDetails(ServiceOfferingVO serviceOffering); + ServiceOfferingVO findById(Long vmId, long serviceOfferingId); + ServiceOfferingVO findByIdIncludingRemoved(Long vmId, long serviceOfferingId); + boolean isDynamic(long serviceOfferingId); + ServiceOfferingVO getcomputeOffering(long serviceOfferingId, Integer cpuCores, Integer cpuSpeed, Integer memory); } diff --git a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java index f807f0df565..917eaefb445 100644 --- a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java +++ b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java @@ -25,6 +25,9 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.persistence.EntityExistsException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.vm.dao.UserVmDetailsDao; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -41,13 +44,14 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase UniqueNameSearch; protected final SearchBuilder ServiceOfferingsByDomainIdSearch; protected final SearchBuilder SystemServiceOffering; protected final SearchBuilder ServiceOfferingsByKeywordSearch; protected final SearchBuilder PublicServiceOfferingSearch; - + public ServiceOfferingDaoImpl() { super(); @@ -134,7 +138,7 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase findPublicServiceOfferings(){ SearchCriteria sc = PublicServiceOfferingSearch.create(); sc.setParameters("system", false); - return listBy(sc); + return listBy(sc); } @Override @DB @@ -180,4 +184,48 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase dynamicOffering = userVmDetailsDao.listDetailsKeyPairs(vmId); + offering.setCpu(Integer.parseInt(dynamicOffering.get(ServiceOfferingVO.DynamicParameters.cpuNumber.name()))); + offering.setSpeed(Integer.parseInt(dynamicOffering.get(ServiceOfferingVO.DynamicParameters.cpuSpeed.name()))); + offering.setRamSize(Integer.parseInt(dynamicOffering.get(ServiceOfferingVO.DynamicParameters.memory.name()))); + return offering; + } + return offering; + } + + public ServiceOfferingVO findByIdIncludingRemoved(Long vmId, long serviceOfferingId) { + ServiceOfferingVO offering = super.findByIdIncludingRemoved(serviceOfferingId); + if (offering.isDynamic()) { + if (vmId == null) { + throw new CloudRuntimeException("missing argument vmId"); + } + Map dynamicOffering = userVmDetailsDao.listDetailsKeyPairs(vmId); + offering.setCpu(Integer.parseInt(dynamicOffering.get(ServiceOfferingVO.DynamicParameters.cpuNumber.name()))); + offering.setSpeed(Integer.parseInt(dynamicOffering.get(ServiceOfferingVO.DynamicParameters.cpuSpeed.name()))); + offering.setRamSize(Integer.parseInt(dynamicOffering.get(ServiceOfferingVO.DynamicParameters.memory.name()))); + return offering; + + } + return offering; + } + + public boolean isDynamic(long serviceOfferingId) { + ServiceOfferingVO offering = super.findById(serviceOfferingId); + return offering.getCpu() == null || offering.getSpeed() == null || offering.getRamSize() == null; + } + + public ServiceOfferingVO getcomputeOffering(long serviceOfferingId, Integer cpuCores, Integer cpuSpeed, Integer memory) { + ServiceOfferingVO offering = super.findById(serviceOfferingId); + offering.setCpu(cpuCores); + offering.setSpeed(cpuSpeed); + offering.setRamSize(memory); + return offering; + } } diff --git a/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java b/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java index f1fa71c3c56..24368ee3d9c 100644 --- a/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java +++ b/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java @@ -19,6 +19,7 @@ package org.apache.cloudstack.implicitplanner; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.mockito.Matchers.anyLong; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -34,6 +35,7 @@ import java.util.UUID; import javax.inject.Inject; +import com.cloud.hypervisor.Hypervisor; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -163,7 +165,6 @@ public class ImplicitPlannerTest { acct.setId(accountId); UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString()); - CallContext.register(user, acct); } diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java index ef6ec312d13..9618e6bb47f 100755 --- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java +++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java @@ -187,7 +187,7 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe UserVmVO vm = (UserVmVO) profile.getVirtualMachine(); _vmDao.loadDetails(vm); - String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getServiceOfferingId()).getDisplayText(); + String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()).getDisplayText(); String zoneName = _dcDao.findById(vm.getDataCenterId()).getName(); NicVO nvo = _nicDao.findById(nic.getId()); VmDataCommand cmd = new VmDataCommand(nvo.getIp4Address(), vm.getInstanceName(), _ntwkModel.getExecuteInSeqNtwkElmtCmd()); diff --git a/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java b/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java index 0da2c925d3b..3f1994e0d8e 100755 --- a/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java +++ b/server/src/com/cloud/agent/manager/allocator/impl/UserConcentratedAllocator.java @@ -260,7 +260,7 @@ public class UserConcentratedAllocator extends AdapterBase implements PodAllocat } } - so = _offeringDao.findById(vm.getServiceOfferingId()); + so = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId()); if (capacityType == CapacityVO.CAPACITY_TYPE_MEMORY) { usedCapacity += so.getRamSize() * 1024L * 1024L; diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index f34e60efc96..29346419eac 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -2431,7 +2431,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { _accountMgr.checkAccess(caller, null, true, vmInstance); - ServiceOfferingVO offering = _srvOfferingDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId()); + ServiceOfferingVO offering = _srvOfferingDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId()); sc.addAnd("id", SearchCriteria.Op.NEQ, offering.getId()); // Only return offerings with the same Guest IP type and storage diff --git a/server/src/com/cloud/capacity/CapacityManagerImpl.java b/server/src/com/cloud/capacity/CapacityManagerImpl.java index 1c5f189237f..a9b9ae410d6 100755 --- a/server/src/com/cloud/capacity/CapacityManagerImpl.java +++ b/server/src/com/cloud/capacity/CapacityManagerImpl.java @@ -60,7 +60,6 @@ import com.cloud.host.dao.HostDao; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.dao.HypervisorCapabilitiesDao; import com.cloud.offering.ServiceOffering; -import com.cloud.org.Cluster; import com.cloud.org.Grouping.AllocationState; import com.cloud.resource.ResourceListener; import com.cloud.resource.ResourceManager; @@ -81,7 +80,6 @@ import com.cloud.utils.concurrency.NamedThreadFactory; import com.cloud.utils.db.DB; import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.db.Transaction; -import com.cloud.utils.db.TransactionCallback; import com.cloud.utils.db.TransactionCallbackNoReturn; import com.cloud.utils.db.TransactionStatus; import com.cloud.utils.fsm.StateListener; @@ -174,7 +172,7 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager, @DB @Override public boolean releaseVmCapacity(VirtualMachine vm, final boolean moveFromReserved, final boolean moveToReservered, final Long hostId) { - final ServiceOfferingVO svo = _offeringsDao.findById(vm.getServiceOfferingId()); + final ServiceOfferingVO svo = _offeringsDao.findById(vm.getId(), vm.getServiceOfferingId()); CapacityVO capacityCpu = _capacityDao.findByHostIdType(hostId, CapacityVO.CAPACITY_TYPE_CPU); CapacityVO capacityMemory = _capacityDao.findByHostIdType(hostId, CapacityVO.CAPACITY_TYPE_MEMORY); Long clusterId = null; @@ -270,7 +268,7 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager, final float cpuOvercommitRatio = Float.parseFloat(_clusterDetailsDao.findDetail(clusterId, "cpuOvercommitRatio").getValue()); final float memoryOvercommitRatio = Float.parseFloat(_clusterDetailsDao.findDetail(clusterId, "memoryOvercommitRatio").getValue()); - final ServiceOfferingVO svo = _offeringsDao.findById(vm.getServiceOfferingId()); + final ServiceOfferingVO svo = _offeringsDao.findById(vm.getId(), vm.getServiceOfferingId()); CapacityVO capacityCpu = _capacityDao.findByHostIdType(hostId, CapacityVO.CAPACITY_TYPE_CPU); CapacityVO capacityMem = _capacityDao.findByHostIdType(hostId, CapacityVO.CAPACITY_TYPE_MEMORY); @@ -549,16 +547,23 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager, Float cpuOvercommitRatio = 1f; Float ramOvercommitRatio = 1f; for (VMInstanceVO vm : vms) { - UserVmDetailVO vmDetailCpu = _userVmDetailsDao.findDetail(vm.getId(), "cpuOvercommitRatio"); - UserVmDetailVO vmDetailRam = _userVmDetailsDao.findDetail(vm.getId(),"memoryOvercommitRatio"); + Map vmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId()); + String vmDetailCpu = vmDetails.get("cpuOvercommitRatio"); + String vmDetailRam = vmDetails.get("memoryOvercommitRatio"); if (vmDetailCpu != null ) { //if vmDetail_cpu is not null it means it is running in a overcommited cluster. - cpuOvercommitRatio = Float.parseFloat(vmDetailCpu.getValue()); - ramOvercommitRatio = Float.parseFloat(vmDetailRam.getValue()); + cpuOvercommitRatio = Float.parseFloat(vmDetailCpu); + ramOvercommitRatio = Float.parseFloat(vmDetailRam); } ServiceOffering so = offeringsMap.get(vm.getServiceOfferingId()); - usedMemory += ((so.getRamSize() * 1024L * 1024L)/ramOvercommitRatio)*clusterRamOvercommitRatio; - usedCpu += ((so.getCpu() * so.getSpeed())/cpuOvercommitRatio)*clusterCpuOvercommitRatio; + if (so.isDynamic()) { + usedMemory += ((Integer.parseInt(vmDetails.get(ServiceOfferingVO.DynamicParameters.memory.name())) * 1024L * 1024L)/ramOvercommitRatio)*clusterRamOvercommitRatio; + usedCpu += ((Integer.parseInt(vmDetails.get(ServiceOfferingVO.DynamicParameters.cpuNumber.name())) * Integer.parseInt(vmDetails.get(ServiceOfferingVO.DynamicParameters.cpuSpeed.name())))/cpuOvercommitRatio)*clusterCpuOvercommitRatio; + } + else { + usedMemory += ((so.getRamSize() * 1024L * 1024L)/ramOvercommitRatio)*clusterRamOvercommitRatio; + usedCpu += ((so.getCpu() * so.getSpeed())/cpuOvercommitRatio)*clusterCpuOvercommitRatio; + } } List vmsByLastHostId = _vmDao.listByLastHostId(host.getId()); diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index a31d06f4e67..e4bbe8e5bf7 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -206,7 +206,8 @@ import com.cloud.vm.dao.NicIpAliasVO; import com.cloud.vm.dao.NicSecondaryIpDao; @Local(value = { ConfigurationManager.class, ConfigurationService.class }) -public class ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, ConfigurationService { +public class + ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, ConfigurationService { public static final Logger s_logger = Logger.getLogger(ConfigurationManagerImpl.class); @Inject @@ -1995,20 +1996,20 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati + ": specify the display text that has non-zero length"); } - Long cpuNumber = cmd.getCpuNumber(); - if ((cpuNumber == null) || (cpuNumber.intValue() <= 0) || (cpuNumber.intValue() > 2147483647)) { + Integer cpuNumber = cmd.getCpuNumber(); + Integer cpuSpeed = cmd.getCpuSpeed(); + Integer memory = cmd.getMemory(); + boolean customized = cmd.getCustomized(); + + if ((cpuNumber != null) && ((cpuNumber.intValue() <=0) || (cpuNumber.intValue() > 2147483647))) { throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the cpu number value between 1 and 2147483647"); } - - Long cpuSpeed = cmd.getCpuSpeed(); - if ((cpuSpeed == null) || (cpuSpeed.intValue() <= 0) || (cpuSpeed.intValue() > 2147483647)) { + if ((cpuSpeed != null) && ((cpuSpeed.intValue() < 0) || (cpuSpeed.intValue() > 2147483647))) { throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the cpu speed value between 1 and 2147483647"); } - - Long memory = cmd.getMemory(); - if ((memory == null) || (memory.intValue() < 32) || (memory.intValue() > 2147483647)) { + if (( memory != null ) && ((memory.intValue() < 32) || (memory.intValue() > 2147483647))) { throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the memory value between 32 and 2147483647 MB"); } @@ -2074,21 +2075,20 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati } return createServiceOffering(userId, cmd.getIsSystem(), vmType, cmd.getServiceOfferingName(), - cpuNumber.intValue(), memory.intValue(), cpuSpeed.intValue(), cmd.getDisplayText(), + cpuNumber, memory, cpuSpeed, cmd.getDisplayText(), localStorageRequired, offerHA, limitCpuUse, volatileVm, cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(), cmd.getNetworkRate(), cmd.getDeploymentPlanner(), cmd.getDetails(), cmd.getBytesReadRate(), cmd.getBytesWriteRate(), cmd.getIopsReadRate(), cmd.getIopsWriteRate()); } protected ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, VirtualMachine.Type vm_type, - String name, int cpu, int ramSize, int speed, String displayText, boolean localStorageRequired, + String name, Integer cpu, Integer ramSize, Integer speed, String displayText, boolean localStorageRequired, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate, String deploymentPlanner, Map details, Long bytesReadRate, Long bytesWriteRate, Long iopsReadRate, Long iopsWriteRate) { tags = StringUtils.cleanupTags(tags); ServiceOfferingVO offering = new ServiceOfferingVO(name, cpu, ramSize, speed, networkRate, null, offerHA, limitResourceUse, volatileVm, displayText, localStorageRequired, false, tags, isSystem, vm_type, domainId, hostTag, deploymentPlanner); - if ((bytesReadRate != null) && (bytesReadRate > 0)) offering.setBytesReadRate(bytesReadRate); if ((bytesWriteRate != null) && (bytesWriteRate > 0)) diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 9b35a4b0fbd..fb75cb76822 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -3433,7 +3433,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } private void createVmDataCommand(VirtualRouter router, UserVm vm, NicVO nic, String publicKey, Commands cmds) { - String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getServiceOfferingId()).getDisplayText(); + String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()).getDisplayText(); String zoneName = _dcDao.findById(router.getDataCenterId()).getName(); cmds.addCommand("vmdata", generateVmDataCommand(router, nic.getIp4Address(), vm.getUserData(), serviceOffering, zoneName, nic.getIp4Address(), diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 9e699623307..52fda38ffd5 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -80,8 +80,6 @@ import org.apache.cloudstack.framework.async.AsyncCallFuture; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import org.apache.cloudstack.storage.to.TemplateObjectTO; -import org.apache.commons.codec.binary.Base64; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; @@ -220,7 +218,6 @@ import com.cloud.template.VirtualMachineTemplate.BootloaderType; import com.cloud.user.Account; import com.cloud.user.AccountManager; import com.cloud.user.AccountService; -import com.cloud.user.AccountVO; import com.cloud.user.ResourceLimitService; import com.cloud.user.SSHKeyPair; import com.cloud.user.SSHKeyPairVO; @@ -246,7 +243,6 @@ import com.cloud.utils.db.Filter; import com.cloud.utils.db.GlobalLock; import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchCriteria; -import com.cloud.utils.db.TransactionCallback; import com.cloud.utils.db.TransactionCallbackNoReturn; import com.cloud.utils.db.SearchCriteria.Func; import com.cloud.utils.db.Transaction; @@ -445,6 +441,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir VolumeService _volService; @Inject VolumeDataFactory volFactory; + @Inject + UserVmDetailsDao _uservmDetailsDao; protected ScheduledExecutorService _executor = null; protected int _expungeInterval; @@ -791,7 +789,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir // Check resource limits for CPU and Memory. ServiceOfferingVO newServiceOffering = _offeringDao.findById(svcOffId); - ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId()); + ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId()); int newCpu = newServiceOffering.getCpu(); int newMemory = newServiceOffering.getRamSize(); @@ -859,7 +857,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir // Check resource limits for CPU and Memory. ServiceOfferingVO newServiceOffering = _offeringDao.findById(svcOffId); - ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId()); + ServiceOfferingVO currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId()); int newCpu = newServiceOffering.getCpu(); int newMemory = newServiceOffering.getRamSize(); @@ -1256,7 +1254,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir //Check if its a scale "up" ServiceOffering newServiceOffering = _entityMgr.findById(ServiceOffering.class, newServiceOfferingId); - ServiceOffering currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId()); + ServiceOffering currentServiceOffering = _offeringDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId()); int newCpu = newServiceOffering.getCpu(); int newMemory = newServiceOffering.getRamSize(); int newSpeed = newServiceOffering.getSpeed(); @@ -1442,7 +1440,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } // Get serviceOffering for Virtual Machine - ServiceOfferingVO serviceOffering = _serviceOfferingDao.findById(vm.getServiceOfferingId()); + ServiceOfferingVO serviceOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); // First check that the maximum number of UserVMs, CPU and Memory limit for the given // accountId will not be exceeded @@ -1721,7 +1719,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir _alertMgr.sendAlert(AlertManager.ALERT_TYPE_USERVM, vm.getDataCenterId(), vm.getPodIdToDeployIn(), msg, msg); // Get serviceOffering for Virtual Machine - ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getServiceOfferingId()); + ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); // Update Resource Count for the given account resourceCountDecrement(vm.getAccountId(), new Long(offering.getCpu()), @@ -1831,7 +1829,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir ha = vm.isHaEnabled(); } - ServiceOffering offering = _serviceOfferingDao.findById(vm.getServiceOfferingId()); + ServiceOffering offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); if (!offering.getOfferHA() && ha) { throw new InvalidParameterValueException( "Can't enable ha for the vm as it's created from the Service offering having HA disabled"); @@ -1939,7 +1937,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir // If the VM is Volatile in nature, on reboot discard the VM's root disk and create a new root disk for it: by calling restoreVM long serviceOfferingId = vmInstance.getServiceOfferingId(); - ServiceOfferingVO offering = _serviceOfferingDao.findById(serviceOfferingId); + ServiceOfferingVO offering = _serviceOfferingDao.findById(vmInstance.getId(), serviceOfferingId); if(offering != null && offering.getRemoved() == null) { if(offering.getVolatileVm()){ return restoreVMInternal(caller, vmInstance, null); @@ -2189,10 +2187,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir @Override @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List securityGroupIdList, Account owner, - String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, - HypervisorType hypervisor, HTTPMethod httpmethod, String userData, String sshKeyPair, - Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, - List affinityGroupIdList) + String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, + HypervisorType hypervisor, HTTPMethod httpmethod, String userData, String sshKeyPair, + Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, + List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); @@ -2243,17 +2241,17 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir return createVirtualMachine(zone, serviceOffering, template, hostName, displayName, owner, diskOfferingId, diskSize, networkList, securityGroupIdList, group, httpmethod, userData, sshKeyPair, hypervisor, - caller, requestedIps, defaultIps, displayVm, keyboard, affinityGroupIdList); + caller, requestedIps, defaultIps, displayVm, keyboard, affinityGroupIdList, cpuSpeed , memory, cpuNumber, rootDiskSize); } @Override @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List networkIdList, - List securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, - Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, - String sshKeyPair, Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, - List affinityGroupIdList) throws InsufficientCapacityException, ConcurrentOperationException, + List securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, + Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, + String sshKeyPair, Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, + List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); @@ -2361,15 +2359,15 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir return createVirtualMachine(zone, serviceOffering, template, hostName, displayName, owner, diskOfferingId, diskSize, networkList, securityGroupIdList, group, httpmethod, userData, sshKeyPair, hypervisor, - caller, requestedIps, defaultIps, displayVm, keyboard, affinityGroupIdList); + caller, requestedIps, defaultIps, displayVm, keyboard, affinityGroupIdList, cpuSpeed, memory, cpuNumber, rootDiskSize); } @Override @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List networkIdList, Account owner, String hostName, - String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, - HTTPMethod httpmethod, String userData, String sshKeyPair, Map requestedIps, - IpAddresses defaultIps, Boolean displayvm, String keyboard, List affinityGroupIdList) + String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, + HTTPMethod httpmethod, String userData, String sshKeyPair, Map requestedIps, + IpAddresses defaultIps, Boolean displayvm, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); @@ -2456,7 +2454,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir throw new InvalidParameterValueException( "Can't create vm of hypervisor type " + hypervisor + " in vpc network"); - + } } @@ -2476,7 +2474,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir return createVirtualMachine(zone, serviceOffering, template, hostName, displayName, owner, diskOfferingId, diskSize, networkList, null, group, httpmethod, userData, sshKeyPair, hypervisor, caller, requestedIps, - defaultIps, displayvm, keyboard, affinityGroupIdList); + defaultIps, displayvm, keyboard, affinityGroupIdList, cpuSpeed, memory, cpuNumber, rootDiskSize); } @@ -2491,7 +2489,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate tmplt, String hostName, String displayName, Account owner, Long diskOfferingId, Long diskSize, List networkList, List securityGroupIdList, String group, HTTPMethod httpmethod, String userData, String sshKeyPair, HypervisorType hypervisor, Account caller, Map requestedIps, - IpAddresses defaultIps, Boolean isDisplayVmEnabled, String keyboard, List affinityGroupIdList) + IpAddresses defaultIps, Boolean isDisplayVmEnabled, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, StorageUnavailableException, ResourceAllocationException { _accountMgr.checkAccess(caller, null, true, owner); @@ -2504,7 +2502,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (template != null) { _templateDao.loadDetails(template); } - + long accountId = owner.getId(); assert !(requestedIps != null && (defaultIps.getIp4Address() != null || defaultIps.getIp6Address() != null)) : "requestedIp list and defaultNetworkIp should never be specified together"; @@ -2531,7 +2529,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } ServiceOfferingVO offering = _serviceOfferingDao.findById(serviceOffering.getId()); - // check if account/domain is with in resource limits to create a new vm boolean isIso = Storage.ImageFormat.ISO == template.getFormat(); // For baremetal, size can be null @@ -2543,7 +2540,12 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (diskOfferingId != null) { size += _diskOfferingDao.findById(diskOfferingId).getDiskSize(); } - resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize())); + if (!offering.isDynamic()) { + resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize())); + } + else { + resourceLimitCheck(owner, new Long(cpuSpeed), new Long(memory)); + } _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, (isIso || diskOfferingId == null ? 1 : 2)); _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, new Long (size)); @@ -2732,6 +2734,36 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir long id = _vmDao.getNextInSequence(Long.class, "id"); + List details = new ArrayList(); + if (offering.isDynamic()) { + //insert the custom value of dynamic parameters + if (offering.getCpu() == null) { + if ((cpuNumber != null) && ((cpuNumber.intValue() <= 0) || (cpuNumber.intValue() > 2147483647))) { + throw new InvalidParameterValueException("Invalid CPU number value, specify a value between 1 and 2147483647"); + } + } + + if (offering.getSpeed() == null) { + if ((cpuSpeed != null) && ((cpuSpeed.intValue() <= 0) || (cpuSpeed.intValue() > 2147483647))) { + throw new InvalidParameterValueException("Invalid CPU speed value, specify a value between 1 and 2147483647"); + } + } + + if (offering.getRamSize() == null) { + if ((memory != null) && ((memory.intValue() < 32) || (memory.intValue() > 2147483647))) { + throw new InvalidParameterValueException("Invalid memory value, specify a value between 32 and 2147483647 MB"); + } + } + + details.add(new UserVmDetailVO(id, ServiceOfferingVO.DynamicParameters.cpuNumber.toString(), cpuNumber.toString())); + details.add(new UserVmDetailVO(id, ServiceOfferingVO.DynamicParameters.cpuSpeed.toString(), cpuSpeed.toString())); + details.add(new UserVmDetailVO(id, ServiceOfferingVO.DynamicParameters.memory.toString(), memory.toString())); + offering = _serviceOfferingDao.getcomputeOffering(serviceOffering.getId(), cpuNumber, cpuSpeed, memory); + } + if (hostName != null) { + // Check is hostName is RFC compliant + checkNameForRFCCompliance(hostName); + } String instanceName = null; @@ -2801,7 +2833,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir UserVmVO vm = commitUserVm(zone, template, hostName, displayName, owner, diskOfferingId, diskSize, userData, hypervisor, caller, isDisplayVmEnabled, keyboard, accountId, offering, isIso, sshPublicKey, - networkNicMap, id, instanceName, uuidName, hypervisorType); + networkNicMap, id, instanceName, uuidName, hypervisorType, rootDiskSize, details); // Assign instance to the group try { @@ -2835,7 +2867,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir final HypervisorType hypervisor, final Account caller, final Boolean isDisplayVmEnabled, final String keyboard, final long accountId, final ServiceOfferingVO offering, final boolean isIso, final String sshPublicKey, final LinkedHashMap networkNicMap, final long id, final String instanceName, final String uuidName, - final HypervisorType hypervisorType) throws InsufficientCapacityException { + final HypervisorType hypervisorType, final Long rootDiskSize,final List vmdetails) throws InsufficientCapacityException { return Transaction.execute(new TransactionCallbackWithException() { @Override public UserVmVO doInTransaction(TransactionStatus status) throws InsufficientCapacityException { @@ -2849,14 +2881,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (sshPublicKey != null) { vm.setDetail("SSH.PublicKey", sshPublicKey); } - + if (keyboard != null && !keyboard.isEmpty()) vm.setDetail(VmDetailConstants.KEYBOARD, keyboard); - + if (isIso) { vm.setIsoId(template.getId()); } - + if(isDisplayVmEnabled != null){ if(!_accountMgr.isRootAdmin(caller.getType())){ throw new PermissionDeniedException( "Cannot update parameter displayvm, only admin permitted "); @@ -2865,7 +2897,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir }else { vm.setDisplayVm(true); } - + // If hypervisor is vSphere, check for clone type setting. if (hypervisorType.equals(HypervisorType.VMware)) { // retrieve clone flag. @@ -2878,13 +2910,13 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir UserVmCloneSettingVO vmCloneSettingVO = new UserVmCloneSettingVO(id, cloneType.toString()); _vmCloneSettingDao.persist(vmCloneSettingVO); } - + long guestOSId = template.getGuestOSId(); GuestOSVO guestOS = _guestOSDao.findById(guestOSId); long guestOSCategoryId = guestOS.getCategoryId(); GuestOSCategoryVO guestOSCategory = _guestOSCategoryDao.findById(guestOSCategoryId); - - + + // If hypervisor is vSphere and OS is OS X, set special settings. if (hypervisorType.equals(HypervisorType.VMware)) { if (guestOS.getDisplayName().toLowerCase().contains("apple mac os")){ @@ -2894,28 +2926,33 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir s_logger.info("guestOS is OSX : overwrite root disk controller to scsi, use smc and efi"); } } - + Map details = template.getDetails(); if ( details != null && !details.isEmpty() ) { vm.details.putAll(details); } _vmDao.persist(vm); + if (vmdetails != null && vmdetails.size() >0) { + for (UserVmDetailVO detail : vmdetails) { + vm.setDetail(detail.getName(), detail.getValue()); + } + } _vmDao.saveDetails(vm); - + s_logger.debug("Allocating in the DB for vm"); DataCenterDeployment plan = new DataCenterDeployment(zone.getId()); - + List computeTags = new ArrayList(); computeTags.add(offering.getHostTag()); - + List rootDiskTags = new ArrayList(); rootDiskTags.add(offering.getTags()); - + if(isIso){ VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachineFromScratch(vm.getUuid(), Long.toString(owner.getAccountId()), vm.getIsoId().toString(), hostName, displayName, hypervisor.name(), guestOSCategory.getName(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(), diskSize, computeTags, rootDiskTags, networkNicMap, plan); }else { - VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachine(vm.getUuid(), Long.toString(owner.getAccountId()), Long.toString(template.getId()), hostName, displayName, hypervisor.name(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(), diskSize, computeTags, rootDiskTags, networkNicMap, plan); + VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachine(vm.getUuid(), Long.toString(owner.getAccountId()), Long.toString(template.getId()), hostName, displayName, hypervisor.name(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(), diskSize, computeTags, rootDiskTags, networkNicMap, plan, rootDiskSize); } @@ -2924,10 +2961,21 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir s_logger.debug("Successfully allocated DB entry for " + vm); } CallContext.current().setEventDetails("Vm Id: " + vm.getId()); - - UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), - vm.getHostName(), offering.getId(), template.getId(), hypervisorType.toString(), - VirtualMachine.class.getName(), vm.getUuid()); + + if (!offering.isDynamic()) { + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), + vm.getHostName(), offering.getId(), template.getId(), hypervisorType.toString(), + VirtualMachine.class.getName(), vm.getUuid()); + } + else { + HashMap vmdetailsMap = new HashMap(); + for (UserVmDetailVO vmdetail :vmdetails) { + vmdetailsMap.put(vmdetail.getName(), vmdetail.getValue()); + } + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), + vm.getHostName(), offering.getId(), template.getId(), hypervisorType.toString(), + VirtualMachine.class.getName(), vm.getUuid(), vmdetailsMap); + } //Update Resource Count for the given account resourceCountIncrement(accountId, new Long(offering.getCpu()), @@ -3401,7 +3449,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir VirtualMachineEntity vmEntity = _orchSrvc.getVirtualMachine(vm.getUuid()); // Get serviceOffering for Virtual Machine - ServiceOfferingVO offering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getServiceOfferingId()); + ServiceOfferingVO offering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()); String plannerName = offering.getDeploymentPlanner(); if (plannerName == null) { if (vm.getHypervisorType() == HypervisorType.BareMetal) { @@ -3477,7 +3525,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (vmState != State.Error) { // Get serviceOffering for Virtual Machine - ServiceOfferingVO offering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getServiceOfferingId()); + ServiceOfferingVO offering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()); //Update Resource Count for the given account resourceCountDecrement(vm.getAccountId(), new Long(offering.getCpu()), @@ -3913,7 +3961,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir private boolean isVMUsingLocalStorage(VMInstanceVO vm) { boolean usesLocalStorage = false; - ServiceOfferingVO svcOffering = _serviceOfferingDao.findById(vm + ServiceOfferingVO svcOffering = _serviceOfferingDao.findById(vm.getId(), vm .getServiceOfferingId()); if (svcOffering.getUseLocalStorage()) { usesLocalStorage = true; @@ -4129,7 +4177,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } // Checks for implicitly dedicated hosts - ServiceOfferingVO deployPlanner = _offeringDao.findById(vm.getServiceOfferingId()); + ServiceOfferingVO deployPlanner = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId()); if(deployPlanner.getDeploymentPlanner() != null && deployPlanner.getDeploymentPlanner().equals("ImplicitDedicationPlanner")) { //VM is deployed using implicit planner long accountOfVm = vm.getAccountId(); @@ -4153,7 +4201,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir //If vm is deployed using preferred implicit planner, check if all vms on destination host must be //using implicit planner and must belong to same account for (VMInstanceVO vmsDest : vmsOnDest) { - ServiceOfferingVO destPlanner = _offeringDao.findById(vmsDest.getServiceOfferingId()); + ServiceOfferingVO destPlanner = _offeringDao.findById(vm.getId(), vmsDest.getServiceOfferingId()); if (!((destPlanner.getDeploymentPlanner() != null && destPlanner.getDeploymentPlanner().equals("ImplicitDedicationPlanner")) && vmsDest.getAccountId()==accountOfVm)) { msg = "VM of account " + accountOfVm + " with preffered implicit deployment planner being migrated to host " + destHost.getName() + @@ -4494,7 +4542,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir DataCenterVO zone = _dcDao.findById(vm.getDataCenterId()); // Get serviceOffering and Volumes for Virtual Machine - final ServiceOfferingVO offering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getServiceOfferingId()); + final ServiceOfferingVO offering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()); final List volumes = _volsDao.findByInstance(cmd.getVmId()); //Remove vm from instance group diff --git a/server/test/com/cloud/capacity/CapacityManagerTest.java b/server/test/com/cloud/capacity/CapacityManagerTest.java index 3faa32f0f6d..300e6b50a65 100644 --- a/server/test/com/cloud/capacity/CapacityManagerTest.java +++ b/server/test/com/cloud/capacity/CapacityManagerTest.java @@ -57,7 +57,7 @@ public class CapacityManagerTest { capMgr=setUp(); when(vm.getHostId()).thenReturn(1l); when(vm.getServiceOfferingId()).thenReturn(2l); - when(SOfferingDao.findById(anyLong())).thenReturn(svo); + when(SOfferingDao.findById(anyLong(), anyLong())).thenReturn(svo); when(CDao.findByHostIdType(anyLong(), eq(Capacity.CAPACITY_TYPE_CPU))).thenReturn(cvo_cpu); when(CDao.findByHostIdType(anyLong(), eq(Capacity.CAPACITY_TYPE_MEMORY))).thenReturn(cvo_ram); when(cvo_cpu.getUsedCapacity()).thenReturn(500l); diff --git a/server/test/com/cloud/vm/UserVmManagerTest.java b/server/test/com/cloud/vm/UserVmManagerTest.java index df676d31594..0a3ed3c93b9 100755 --- a/server/test/com/cloud/vm/UserVmManagerTest.java +++ b/server/test/com/cloud/vm/UserVmManagerTest.java @@ -367,7 +367,7 @@ public class UserVmManagerTest { ServiceOffering so2 = getSvcoffering(256); when(_entityMgr.findById(eq(ServiceOffering.class), anyLong())).thenReturn(so1); - when(_offeringDao.findByIdIncludingRemoved(anyLong())).thenReturn((ServiceOfferingVO) so1); + when(_offeringDao.findByIdIncludingRemoved(anyLong(), anyLong())).thenReturn((ServiceOfferingVO) so1); Account account = new AccountVO("testaccount", 1L, "networkdomain", (short)0, UUID.randomUUID().toString()); UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString()); diff --git a/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java b/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java index f2ebf67acf9..47e509f140c 100644 --- a/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java +++ b/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java @@ -24,6 +24,9 @@ import java.util.Set; import javax.inject.Inject; +import com.cloud.event.dao.UsageEventDao; +import com.cloud.event.dao.UsageEventDetailsDao; +import com.cloud.vm.dao.UserVmDetailsDao; import junit.framework.TestCase; import org.junit.After; @@ -78,6 +81,15 @@ public class CreateNetworkOfferingTest extends TestCase{ @Inject VpcManager vpcMgr; + @Inject + UserVmDetailsDao userVmDetailsDao; + + @Inject + UsageEventDao UsageEventDao; + + @Inject + UsageEventDetailsDao usageEventDetailsDao; + @Override @Before public void setUp() { diff --git a/server/test/org/apache/cloudstack/service/ServiceOfferingVOTest.java b/server/test/org/apache/cloudstack/service/ServiceOfferingVOTest.java new file mode 100644 index 00000000000..38425c6874c --- /dev/null +++ b/server/test/org/apache/cloudstack/service/ServiceOfferingVOTest.java @@ -0,0 +1,49 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.service; + +import com.cloud.service.ServiceOfferingVO; +import com.cloud.vm.VirtualMachine; +import org.junit.Before; +import org.junit.Test; +import org.junit.Assert; +import org.mockito.MockitoAnnotations; + +public class ServiceOfferingVOTest { + ServiceOfferingVO offeringCustom; + ServiceOfferingVO offering; + + + @Before + public void setup(){ + MockitoAnnotations.initMocks(this); + offeringCustom = new ServiceOfferingVO("custom", null, null, 500, 10, 10, false, "custom", false, false, "", false, VirtualMachine.Type.User, false); + offering = new ServiceOfferingVO("normal", 1, 1000, 500, 10, 10, false, "normal", false, false, "", false, VirtualMachine.Type.User, false); + } + + // Test restoreVm when VM state not in running/stopped case + @Test + public void isDynamic() { + Assert.assertTrue(offeringCustom.isDynamic()); + } + + @Test + public void notDynamic() { + Assert.assertTrue(!offering.isDynamic()); + } + +} \ No newline at end of file diff --git a/server/test/resources/createNetworkOffering.xml b/server/test/resources/createNetworkOffering.xml index 9d684ba12bb..c6228dab707 100644 --- a/server/test/resources/createNetworkOffering.xml +++ b/server/test/resources/createNetworkOffering.xml @@ -43,5 +43,7 @@ - + + + diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index 980650dce17..2dd998b2361 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -579,3 +579,13 @@ insert into cloud.monitoring_services(id, service, process_name, service_name, s insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(2,'dhcp','dnsmasq','dnsmasq','/etc/init.d/dnsmasq','/var/run/dnsmasq/dnsmasq.pid',false); insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(3,'loadbalancing','haproxy','haproxy','/etc/init.d/haproxy','/var/run/haproxy.pid',false); insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(4,'webserver','apache2','apache2','/etc/init.d/apache2','/var/run/apache2.pid', true); +ALTER TABLE `cloud`.`service_offering` CHANGE COLUMN `cpu` `cpu` INT(10) UNSIGNED NULL COMMENT '# of cores' , CHANGE COLUMN `speed` `speed` INT(10) UNSIGNED NULL COMMENT 'speed per core in mhz' , CHANGE COLUMN `ram_size` `ram_size` BIGINT(20) UNSIGNED NULL ; + +CREATE TABLE `cloud`.`usage_event_details` ( + `id` bigint unsigned NOT NULL auto_increment, + `usage_event_id` bigint unsigned NOT NULL COMMENT 'usage event id', + `name` varchar(255) NOT NULL, + `value` varchar(1024) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_usage_event_details__usage_event_id` FOREIGN KEY `fk_usage_event_details__usage_event_id`(`usage_event_id`) REFERENCES `usage_event`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; From e77ab385439272dabbd424ff63efb0637def9e0a Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Thu, 7 Nov 2013 13:13:39 +0530 Subject: [PATCH 045/108] Fixing the implementation for AttachCommand and DetachCommand in hyperv agent. Also implemented RebootCommand for rebooting an instance on hyperv host. --- .../HypervResource/CloudStackTypes.cs | 22 ++ .../HypervResourceController.cs | 70 ++++++- .../ServerResource/HypervResource/Utils.cs | 190 +++++++++++++++--- .../HypervResource/WmiCallsV2.cs | 8 +- 4 files changed, 260 insertions(+), 30 deletions(-) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs index ae595fcc215..41b2bac81b3 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs @@ -279,6 +279,27 @@ namespace HypervResource } } + public class DiskTO + { + public string type; + public TemplateObjectTO templateObjectTO = null; + + public static DiskTO ParseJson(dynamic json) + { + DiskTO result = null; + if (json != null) + { + result = new DiskTO() + { + templateObjectTO = TemplateObjectTO.ParseJson(json.data), + type = (string)json.type, + }; + } + + return result; + } + } + enum VolumeType { UNKNOWN, @@ -589,6 +610,7 @@ namespace HypervResource public const string SwiftTO = "com.cloud.agent.api.to.SwiftTO"; public const string VirtualMachineTO = "com.cloud.agent.api.to.VirtualMachineTO"; public const string VolumeTO = "com.cloud.agent.api.to.VolumeTO"; + public const string DiskTO = "com.cloud.agent.api.to.DiskTO"; public const string InternalErrorException = "com.cloud.exception.InternalErrorException"; public const string HostType = "com.cloud.host.Host.Type"; public const string HypervisorType = "com.cloud.hypervisor.Hypervisor.HypervisorType"; diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs index ed3736b072b..43b44dfa00b 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs @@ -196,7 +196,19 @@ namespace HypervResource try { string vmName = (string)cmd.vmName; - result = true; + DiskTO disk = DiskTO.ParseJson(cmd.disk); + TemplateObjectTO dataStore = disk.templateObjectTO; + + if (dataStore.nfsDataStoreTO != null) + { + NFSTO share = dataStore.nfsDataStoreTO; + Utils.connectToRemote(share.UncPath, share.Domain, share.User, share.Password); + + // The share is mapped, now attach the iso + string isoPath = Path.Combine(share.UncPath.Replace('/', Path.DirectorySeparatorChar), dataStore.path); + wmiCallsV2.AttachIso(vmName, isoPath); + result = true; + } } catch (Exception sysEx) { @@ -229,7 +241,18 @@ namespace HypervResource try { string vmName = (string)cmd.vmName; - result = true; + DiskTO disk = DiskTO.ParseJson(cmd.disk); + TemplateObjectTO dataStore = disk.templateObjectTO; + + if (dataStore.nfsDataStoreTO != null) + { + NFSTO share = dataStore.nfsDataStoreTO; + // The share is mapped, now attach the iso + string isoPath = Path.Combine(share.UncPath.Replace('/', Path.DirectorySeparatorChar), + dataStore.path.Replace('/', Path.DirectorySeparatorChar)); + wmiCallsV2.DetachDisk(vmName, isoPath); + result = true; + } } catch (Exception sysEx) { @@ -247,6 +270,49 @@ namespace HypervResource } } + // POST api/HypervResource/RebootCommand + [HttpPost] + [ActionName(CloudStackTypes.RebootCommand)] + public JContainer RebootCommand([FromBody]dynamic cmd) + { + using (log4net.NDC.Push(Guid.NewGuid().ToString())) + { + logger.Info(CloudStackTypes.RebootCommand + cmd.ToString()); + + string details = null; + bool result = false; + + try + { + string vmName = (string)cmd.vmName; + var sys = wmiCallsV2.GetComputerSystem(vmName); + if (sys == null) + { + details = CloudStackTypes.RebootCommand + " requested unknown VM " + vmName; + logger.Error(details); + } + else + { + wmiCallsV2.SetState(sys, RequiredState.Reset); + result = true; + } + } + catch (Exception sysEx) + { + details = CloudStackTypes.RebootCommand + " failed due to " + sysEx.Message; + logger.Error(details, sysEx); + } + + object ansContent = new + { + result = result, + details = details + }; + + return ReturnCloudStackTypedJArray(ansContent, CloudStackTypes.RebootAnswer); + } + } + // POST api/HypervResource/DestroyCommand [HttpPost] [ActionName(CloudStackTypes.DestroyCommand)] diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs index e55f2ad1e99..631a7bd2cf4 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs @@ -66,30 +66,30 @@ namespace HypervResource bool isSuccess = LogonUser(cifsShareDetails.User, cifsShareDetails.Domain, cifsShareDetails.Password, LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_DEFAULT, ref token); using (WindowsImpersonationContext remoteIdentity = new WindowsIdentity(token).Impersonate()) { - String dest = ""; - if (filePathRelativeToShare.EndsWith(".iso") || filePathRelativeToShare.EndsWith(".vhd") || filePathRelativeToShare.EndsWith(".vhdx")) - { - dest = Path.Combine(cifsShareDetails.UncPath, filePathRelativeToShare); - dest = dest.Replace('/', Path.DirectorySeparatorChar); - } - // if the filePathRelativeToShare string don't have filename and only a dir point then find the vhd files in that folder and use - // In the clean setup, first copy command wont be having the filename it contains onlyu dir path. - // we need to scan the folder point and then copy the file to destination. - else if (!filePathRelativeToShare.EndsWith(".vhd") || !filePathRelativeToShare.EndsWith(".vhdx")) - { - // scan the folder and get the vhd filename. - String uncPath = Path.Combine(cifsShareDetails.UncPath, Path.Combine(filePathRelativeToShare.Split('/'))); - //uncPath = uncPath.Replace("/", "\\"); - DirectoryInfo dir = new DirectoryInfo(uncPath); - FileInfo[] vhdFiles = dir.GetFiles("*.vhd*"); - if (vhdFiles.Length > 0) - { - FileInfo file = vhdFiles[0]; - dest = file.FullName; - } - } - s_logger.Info(CloudStackTypes.CopyCommand + ": copy " + Path.Combine(cifsShareDetails.UncPath, filePathRelativeToShare) + " to " + destFile); + String dest = ""; + if (filePathRelativeToShare.EndsWith(".iso") || filePathRelativeToShare.EndsWith(".vhd") || filePathRelativeToShare.EndsWith(".vhdx")) + { + dest = Path.Combine(cifsShareDetails.UncPath, filePathRelativeToShare); + dest = dest.Replace('/', Path.DirectorySeparatorChar); + } + // if the filePathRelativeToShare string don't have filename and only a dir point then find the vhd files in that folder and use + // In the clean setup, first copy command wont be having the filename it contains onlyu dir path. + // we need to scan the folder point and then copy the file to destination. + else if (!filePathRelativeToShare.EndsWith(".vhd") || !filePathRelativeToShare.EndsWith(".vhdx")) + { + // scan the folder and get the vhd filename. + String uncPath = Path.Combine(cifsShareDetails.UncPath, Path.Combine(filePathRelativeToShare.Split('/'))); + //uncPath = uncPath.Replace("/", "\\"); + DirectoryInfo dir = new DirectoryInfo(uncPath); + FileInfo[] vhdFiles = dir.GetFiles("*.vhd*"); + if (vhdFiles.Length > 0) + { + FileInfo file = vhdFiles[0]; + dest = file.FullName; + } + } + s_logger.Info(CloudStackTypes.CopyCommand + ": copy " + Path.Combine(cifsShareDetails.UncPath, filePathRelativeToShare) + " to " + destFile); File.Copy(dest, destFile, true); remoteIdentity.Undo(); } @@ -103,6 +103,32 @@ namespace HypervResource } } + public static void connectToRemote(string remoteUNC, string domain, string username, string password) + { + NETRESOURCE nr = new NETRESOURCE(); + nr.dwType = RESOURCETYPE_DISK; + nr.lpRemoteName = remoteUNC.Replace('/', Path.DirectorySeparatorChar); + if (domain != null) + { + username = domain + @"\" + username; + } + + int ret = WNetUseConnection(IntPtr.Zero, nr, password, username, 0, null, null, null); + if (ret != NO_ERROR) + { + throw new ArgumentException("net use of share " + remoteUNC + "failed with "+ getErrorForNumber(ret)); + } + } + + public static void disconnectRemote(string remoteUNC) + { + int ret = WNetCancelConnection2(remoteUNC, CONNECT_UPDATE_PROFILE, false); + if (ret != NO_ERROR) + { + throw new ArgumentException("net disconnect of share " + remoteUNC + "failed with " + getErrorForNumber(ret)); + } + } + // from http://stackoverflow.com/a/2541569/939250 #region imports [DllImport("advapi32.dll", SetLastError = true)] @@ -113,9 +139,16 @@ namespace HypervResource [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)] public extern static bool DuplicateToken(IntPtr existingTokenHandle, int SECURITY_IMPERSONATION_LEVEL, ref IntPtr duplicateTokenHandle); + + [DllImport("Mpr.dll")] + private static extern int WNetUseConnection(IntPtr hwndOwner, NETRESOURCE lpNetResource, string lpPassword, string lpUserID, int dwFlags, + string lpAccessName, string lpBufferSize, string lpResult); + + [DllImport("Mpr.dll")] + private static extern int WNetCancelConnection2(string lpName, int dwFlags, bool fForce); #endregion - #region logon consts + #region consts // logon types const int LOGON32_LOGON_INTERACTIVE = 2; const int LOGON32_LOGON_NETWORK = 3; @@ -126,6 +159,115 @@ namespace HypervResource const int LOGON32_PROVIDER_WINNT50 = 3; const int LOGON32_PROVIDER_WINNT40 = 2; const int LOGON32_PROVIDER_WINNT35 = 1; + + const int RESOURCE_CONNECTED = 0x00000001; + const int RESOURCE_GLOBALNET = 0x00000002; + const int RESOURCE_REMEMBERED = 0x00000003; + + const int RESOURCETYPE_ANY = 0x00000000; + const int RESOURCETYPE_DISK = 0x00000001; + const int RESOURCETYPE_PRINT = 0x00000002; + + const int RESOURCEDISPLAYTYPE_GENERIC = 0x00000000; + const int RESOURCEDISPLAYTYPE_DOMAIN = 0x00000001; + const int RESOURCEDISPLAYTYPE_SERVER = 0x00000002; + const int RESOURCEDISPLAYTYPE_SHARE = 0x00000003; + const int RESOURCEDISPLAYTYPE_FILE = 0x00000004; + const int RESOURCEDISPLAYTYPE_GROUP = 0x00000005; + + const int RESOURCEUSAGE_CONNECTABLE = 0x00000001; + const int RESOURCEUSAGE_CONTAINER = 0x00000002; + + + const int CONNECT_INTERACTIVE = 0x00000008; + const int CONNECT_PROMPT = 0x00000010; + const int CONNECT_REDIRECT = 0x00000080; + const int CONNECT_UPDATE_PROFILE = 0x00000001; + const int CONNECT_COMMANDLINE = 0x00000800; + const int CONNECT_CMD_SAVECRED = 0x00001000; + + const int CONNECT_LOCALDRIVE = 0x00000100; #endregion + + #region Errors + const int NO_ERROR = 0; + + const int ERROR_ACCESS_DENIED = 5; + const int ERROR_ALREADY_ASSIGNED = 85; + const int ERROR_BAD_DEVICE = 1200; + const int ERROR_BAD_NET_NAME = 67; + const int ERROR_BAD_PROVIDER = 1204; + const int ERROR_CANCELLED = 1223; + const int ERROR_EXTENDED_ERROR = 1208; + const int ERROR_INVALID_ADDRESS = 487; + const int ERROR_INVALID_PARAMETER = 87; + const int ERROR_INVALID_PASSWORD = 1216; + const int ERROR_MORE_DATA = 234; + const int ERROR_NO_MORE_ITEMS = 259; + const int ERROR_NO_NET_OR_BAD_PATH = 1203; + const int ERROR_NO_NETWORK = 1222; + + const int ERROR_BAD_PROFILE = 1206; + const int ERROR_CANNOT_OPEN_PROFILE = 1205; + const int ERROR_DEVICE_IN_USE = 2404; + const int ERROR_NOT_CONNECTED = 2250; + const int ERROR_OPEN_FILES = 2401; + + private struct ErrorClass + { + public int num; + public string message; + public ErrorClass(int num, string message) + { + this.num = num; + this.message = message; + } + } + + private static ErrorClass[] ERROR_LIST = new ErrorClass[] { + new ErrorClass(ERROR_ACCESS_DENIED, "Error: Access Denied"), + new ErrorClass(ERROR_ALREADY_ASSIGNED, "Error: Already Assigned"), + new ErrorClass(ERROR_BAD_DEVICE, "Error: Bad Device"), + new ErrorClass(ERROR_BAD_NET_NAME, "Error: Bad Net Name"), + new ErrorClass(ERROR_BAD_PROVIDER, "Error: Bad Provider"), + new ErrorClass(ERROR_CANCELLED, "Error: Cancelled"), + new ErrorClass(ERROR_EXTENDED_ERROR, "Error: Extended Error"), + new ErrorClass(ERROR_INVALID_ADDRESS, "Error: Invalid Address"), + new ErrorClass(ERROR_INVALID_PARAMETER, "Error: Invalid Parameter"), + new ErrorClass(ERROR_INVALID_PASSWORD, "Error: Invalid Password"), + new ErrorClass(ERROR_MORE_DATA, "Error: More Data"), + new ErrorClass(ERROR_NO_MORE_ITEMS, "Error: No More Items"), + new ErrorClass(ERROR_NO_NET_OR_BAD_PATH, "Error: No Net Or Bad Path"), + new ErrorClass(ERROR_NO_NETWORK, "Error: No Network"), + new ErrorClass(ERROR_BAD_PROFILE, "Error: Bad Profile"), + new ErrorClass(ERROR_CANNOT_OPEN_PROFILE, "Error: Cannot Open Profile"), + new ErrorClass(ERROR_DEVICE_IN_USE, "Error: Device In Use"), + new ErrorClass(ERROR_EXTENDED_ERROR, "Error: Extended Error"), + new ErrorClass(ERROR_NOT_CONNECTED, "Error: Not Connected"), + new ErrorClass(ERROR_OPEN_FILES, "Error: Open Files"), + }; + + private static string getErrorForNumber(int errNum) + { + foreach (ErrorClass er in ERROR_LIST) + { + if (er.num == errNum) return er.message; + } + return "Error: Unknown, " + errNum; + } + #endregion + + [StructLayout(LayoutKind.Sequential)] + private class NETRESOURCE + { + public int dwScope = 0; + public int dwType = 0; + public int dwDisplayType = 0; + public int dwUsage = 0; + public string lpLocalName = ""; + public string lpRemoteName = ""; + public string lpComment = ""; + public string lpProvider = ""; + } } } diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs index 18b96cc6ac1..547a6b7cdfd 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs @@ -447,6 +447,7 @@ namespace HypervResource pingReply = pingSender.Send(ipAddress, pingTimeout, buffer, pingOptions); if (pingReply.Status == IPStatus.Success) { + System.Threading.Thread.Sleep(30000); return true; } else @@ -591,11 +592,11 @@ namespace HypervResource } string hostResource = item.HostResource[0]; - if (!hostResource.Equals(diskFileName)) + if (Path.Equals(hostResource, diskFileName)) { - continue; + imageToRemove = item; + break; } - imageToRemove = item; } // assert @@ -739,7 +740,6 @@ namespace HypervResource // Disk drives are attached to a 'Parent' IDE controller. We IDE Controller's settings for the 'Path', which our new Disk drive will use to reference it. VirtualSystemSettingData vmSettings = GetVmSettings(vm); var driveWmiObj = GetDvdDriveSettings(vmSettings); - InsertDiskImage(vm, isoPath, IDE_ISO_DISK, driveWmiObj.Path); } From c06d8a750c75f500fa29479c0aec58eb7fcea2ba Mon Sep 17 00:00:00 2001 From: wilderrodrigues Date: Thu, 7 Nov 2013 09:22:43 +0100 Subject: [PATCH 046/108] Fix for issues on Coverity related to IDs cv_1125383, cv_1125382, cv_1125380, cv_1125379, cv_1125378, cv_1125377, cv_1125376, cv_1125375, cv_1125374. Those bugs are related to classes not implementing Serializable, nox overriding the equals and/or hashCode methods and with empty finalize method. Signed-off-by: Hugo Trippaers --- .../contrail/management/ServerDBSyncImpl.java | 3 ++- .../management/ServerEventHandlerImpl.java | 4 ---- .../network/contrail/model/ModelObject.java | 19 ++++++++++++++++++- .../contrail/model/ModelObjectBase.java | 18 +++++++++++++++++- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java index 8cb4e8d0b32..7a77040e0c9 100644 --- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java +++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java @@ -18,6 +18,7 @@ package org.apache.cloudstack.network.contrail.management; import java.io.IOException; +import java.io.Serializable; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -931,7 +932,7 @@ public class ServerDBSyncImpl implements ServerDBSync { s_logger.debug("equal " + siModel.getQualifiedName()); } - static class ServiceInstanceComparator implements Comparator { + static class ServiceInstanceComparator implements Comparator, Serializable { @Override public int compare(ServiceInstance obj1, ServiceInstance obj2) { String name1 = StringUtils.join(obj1.getQualifiedName(), ':'); diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerEventHandlerImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerEventHandlerImpl.java index 455e6012e43..ec374409fc0 100644 --- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerEventHandlerImpl.java +++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerEventHandlerImpl.java @@ -63,10 +63,6 @@ public class ServerEventHandlerImpl implements ServerEventHandler { setClassMap(); } - protected void finalize () { - - } - private void setMethodMap() { _methodMap = new HashMap(); Method methods[] = this.getClass().getMethods(); diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ModelObject.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ModelObject.java index 71d28ac5867..e43c9db36cd 100644 --- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ModelObject.java +++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ModelObject.java @@ -18,6 +18,7 @@ package org.apache.cloudstack.network.contrail.model; import java.io.IOException; +import java.io.Serializable; import java.lang.ref.WeakReference; import java.util.TreeSet; @@ -38,7 +39,7 @@ import com.cloud.exception.InternalErrorException; * The update method pushes updates to the contrail API server. */ public interface ModelObject { - public static class ModelReference implements Comparable { + public static class ModelReference implements Comparable, Serializable { WeakReference reference; ModelReference(ModelObject obj) { reference = new WeakReference(obj); @@ -57,8 +58,22 @@ public interface ModelObject { return lhs.compareTo(rhs); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + + ((reference == null) ? 0 : reference.hashCode()); + return result; + } + @Override public boolean equals(Object other) { + if (this == other) + return true; + if (other == null) + return false; try { ModelReference rhs = (ModelReference) other; return compareTo(rhs) == 0; @@ -69,6 +84,8 @@ public interface ModelObject { public ModelObject get() { return reference.get(); } + + }; public void addSuccessor(ModelObject child); diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ModelObjectBase.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ModelObjectBase.java index f22c7c546a3..8d48fa10492 100644 --- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ModelObjectBase.java +++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ModelObjectBase.java @@ -17,11 +17,12 @@ package org.apache.cloudstack.network.contrail.model; +import java.io.Serializable; import java.util.Comparator; import java.util.TreeSet; public abstract class ModelObjectBase implements ModelObject { - public static class UuidComparator implements Comparator { + public static class UuidComparator implements Comparator, Serializable { @Override public int compare(ModelObject lhs, ModelObject rhs) { if (lhs == null) { @@ -78,8 +79,23 @@ public abstract class ModelObjectBase implements ModelObject { _successors.clear(); } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + + ((_ancestors == null) ? 0 : _ancestors.hashCode()); + result = prime * result + + ((_successors == null) ? 0 : _successors.hashCode()); + return result; + } + @Override public boolean equals(Object rhs) { + if (this == rhs) + return true; + if (rhs == null) + return false; ModelObject other; try { other = (ModelObject) rhs; From 494ccd821d711a2957531d1c33274ed293e4d925 Mon Sep 17 00:00:00 2001 From: ynojima Date: Wed, 6 Nov 2013 11:02:56 -0700 Subject: [PATCH 047/108] Bugfix: VR has double NICs connected to Public network replace vlanid wih broadcast uri to support vxlan to identify whether id is VLAN ID or VNI Signed-off-by: ynojima Signed-off-by: Hugo Trippaers --- .../resource/LibvirtComputingResource.java | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index a6593982abd..570eae60078 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -51,6 +51,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; +import java.util.regex.Pattern; +import java.util.regex.Matcher; import javax.ejb.Local; import javax.naming.ConfigurationException; @@ -1656,14 +1658,19 @@ ServerResource { } } - private String getVlanIdFromBridge(String brName) { + private String getBroadcastUriFromBridge(String brName) { String pif= matchPifFileInDirectory(brName); - String[] pifparts = pif.split("\\."); - - if(pifparts.length == 2) { - return pifparts[1]; + Pattern pattern = Pattern.compile("(\\D+)(\\d+)"); + Matcher matcher = pattern.matcher(pif); + if(matcher.find()) { + if (brName.startsWith("brvx")){ + return BroadcastDomainType.Vxlan.toUri(matcher.group(2)).toString(); + } + else{ + return BroadcastDomainType.Vlan.toUri(matcher.group(2)).toString(); + } } else { - s_logger.debug("failed to get vlan id from bridge " + brName + s_logger.debug("failed to get vNet id from bridge " + brName + "attached to physical interface" + pif); return ""; } @@ -1934,7 +1941,7 @@ ServerResource { for (InterfaceDef pluggedNic : pluggedNics) { String pluggedVlanBr = pluggedNic.getBrName(); - String pluggedVlanId = getVlanIdFromBridge(pluggedVlanBr); + String pluggedVlanId = getBroadcastUriFromBridge(pluggedVlanBr); if (pubVlan.equalsIgnoreCase(Vlan.UNTAGGED) && pluggedVlanBr.equalsIgnoreCase(_publicBridgeName)) { break; @@ -1975,25 +1982,25 @@ ServerResource { conn = LibvirtConnection.getConnectionByVmName(routerName); IpAddressTO[] ips = cmd.getIpAddresses(); Integer devNum = 0; - Map vlanToNicNum = new HashMap(); + Map broadcastUriToNicNum = new HashMap(); List pluggedNics = getInterfaces(conn, routerName); for (InterfaceDef pluggedNic : pluggedNics) { String pluggedVlan = pluggedNic.getBrName(); if (pluggedVlan.equalsIgnoreCase(_linkLocalBridgeName)) { - vlanToNicNum.put("LinkLocal",devNum); + broadcastUriToNicNum.put("LinkLocal", devNum); } else if (pluggedVlan.equalsIgnoreCase(_publicBridgeName) || pluggedVlan.equalsIgnoreCase(_privBridgeName) || pluggedVlan.equalsIgnoreCase(_guestBridgeName)) { - vlanToNicNum.put(Vlan.UNTAGGED,devNum); + broadcastUriToNicNum.put(BroadcastDomainType.Vlan.toUri(Vlan.UNTAGGED).toString(), devNum); } else { - vlanToNicNum.put(getVlanIdFromBridge(pluggedVlan),devNum); + broadcastUriToNicNum.put(getBroadcastUriFromBridge(pluggedVlan), devNum); } devNum++; } for (IpAddressTO ip : ips) { - String nicName = "eth" + vlanToNicNum.get(ip.getBroadcastUri()); + String nicName = "eth" + broadcastUriToNicNum.get(ip.getBroadcastUri()); String netmask = Long.toString(NetUtils.getCidrSize(ip.getVlanNetmask())); String subnet = NetUtils.getSubNet(ip.getPublicIp(), ip.getVlanNetmask()); _virtRouterResource.assignVpcIpToRouter(routerIP, ip.isAdd(), ip.getPublicIp(), @@ -2021,19 +2028,19 @@ ServerResource { try { conn = LibvirtConnection.getConnectionByVmName(routerName); List nics = getInterfaces(conn, routerName); - Map vlanAllocatedToVM = new HashMap(); + Map broadcastUriAllocatedToVM = new HashMap(); Integer nicPos = 0; for (InterfaceDef nic : nics) { if (nic.getBrName().equalsIgnoreCase(_linkLocalBridgeName)) { - vlanAllocatedToVM.put("LinkLocal", nicPos); + broadcastUriAllocatedToVM.put("LinkLocal", nicPos); } else { if (nic.getBrName().equalsIgnoreCase(_publicBridgeName) || nic.getBrName().equalsIgnoreCase(_privBridgeName) || nic.getBrName().equalsIgnoreCase(_guestBridgeName)) { - vlanAllocatedToVM.put(Vlan.UNTAGGED, nicPos); + broadcastUriAllocatedToVM.put(BroadcastDomainType.Vlan.toUri(Vlan.UNTAGGED).toString(), nicPos); } else { - String vlanId = getVlanIdFromBridge(nic.getBrName()); - vlanAllocatedToVM.put(vlanId, nicPos); + String broadcastUri = getBroadcastUriFromBridge(nic.getBrName()); + broadcastUriAllocatedToVM.put(broadcastUri, nicPos); } } nicPos++; @@ -2044,14 +2051,14 @@ ServerResource { int nicNum = 0; boolean newNic = false; for (IpAddressTO ip : ips) { - if (!vlanAllocatedToVM.containsKey(ip.getBroadcastUri())) { + if (!broadcastUriAllocatedToVM.containsKey(ip.getBroadcastUri())) { /* plug a vif into router */ VifHotPlug(conn, routerName, ip.getBroadcastUri(), ip.getVifMacAddress()); - vlanAllocatedToVM.put(ip.getBroadcastUri(), nicPos++); + broadcastUriAllocatedToVM.put(ip.getBroadcastUri(), nicPos++); newNic = true; } - nicNum = vlanAllocatedToVM.get(ip.getBroadcastUri()); + nicNum = broadcastUriAllocatedToVM.get(ip.getBroadcastUri()); networkUsage(routerIp, "addVif", "eth" + nicNum); result = _virtRouterResource.assignPublicIpAddress(routerName, routerIp, ip.getPublicIp(), ip.isAdd(), ip.isFirstIP(), From 5d75c6b75c3ee65a15563d4c6b62cae7761afd86 Mon Sep 17 00:00:00 2001 From: Ashutosh K Date: Thu, 7 Nov 2013 16:00:43 +0530 Subject: [PATCH 048/108] CLOUDSTACK-4996: Resolved gateway accessibility issue Gateway of isolated network is pinged instead of shared network Signed-off-by: Girish Shilamkar --- .../component/test_vpc_vm_life_cycle.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/integration/component/test_vpc_vm_life_cycle.py b/test/integration/component/test_vpc_vm_life_cycle.py index 425c2848f96..5893cc35bc5 100644 --- a/test/integration/component/test_vpc_vm_life_cycle.py +++ b/test/integration/component/test_vpc_vm_life_cycle.py @@ -26,6 +26,7 @@ from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * from marvin.remoteSSHClient import remoteSSHClient +from marvin.codes import PASS import time @@ -1195,10 +1196,20 @@ class TestVMLifeCycleSharedNwVPC(cloudstackTestCase): ) self.debug("We should be allowed to ping virtual gateway") - self.debug("VM gateway: %s" % self.vm_1.nic[0].gateway) + self.debug("Finding the gateway corresponding to isolated network") + gateways = [nic.gateway for nic in self.vm_1.nic if nic.networkid == self.network_1.id] - res = ssh_1.execute("ping -c 1 %s" % self.vm_1.nic[0].gateway) - self.debug("ping -c 1 %s: %s" % (self.vm_1.nic[0].gateway, res)) + gateway_list_validation_result = validateList(gateways) + + self.assertEqual(gateway_list_validation_result[0], PASS, "gateway list validation failed due to %s" % + gateway_list_validation_result[2]) + + gateway = gateway_list_validation_result[1] + + self.debug("VM gateway: %s" % gateway) + + res = ssh_1.execute("ping -c 1 %s" % gateway) + self.debug("ping -c 1 %s: %s" % (gateway, res)) result = str(res) self.assertEqual( From 416206595edabfeb6245f3a2b13c6727c3f5e65e Mon Sep 17 00:00:00 2001 From: Jayapal Date: Thu, 7 Nov 2013 17:07:30 +0530 Subject: [PATCH 049/108] CLOUDSTACK-4736 Fixed issue in default service selection --- .../cloud/network/dao/MonitoringServiceDaoImpl.java | 2 +- .../com/cloud/network/dao/MonitoringServiceVO.java | 13 +++++-------- .../router/VirtualNetworkApplianceManagerImpl.java | 2 +- setup/db/db/schema-421to430.sql | 9 +++++---- .../patches/debian/config/root/monitorServices.py | 4 ++-- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java b/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java index 53dc7d455bb..e0b2c20ad35 100644 --- a/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java +++ b/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java @@ -35,7 +35,7 @@ public class MonitoringServiceDaoImpl extends GenericDaoBase servicesTO = new ArrayList(); for (MonitoringServiceVO service: services) { MonitorServiceTO serviceTO = new MonitorServiceTO( service.getService(), service.getProcessname(), service.getServiceName(), service.getServicePath(), - service.getPidFile(), service.getDefault()); + service.getPidFile(), service.isDefaultService()); servicesTO.add(serviceTO); } diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index 2dd998b2361..7bacefe31b0 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -575,10 +575,11 @@ create table `cloud`.`monitoring_services` ( `isDefault` boolean COMMENT 'Default service', PRIMARY KEY (`id`) ); -insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(1,'ssh','sshd', 'ssh','/etc/init.d/ssh','/var/run/sshd.pid',true); -insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(2,'dhcp','dnsmasq','dnsmasq','/etc/init.d/dnsmasq','/var/run/dnsmasq/dnsmasq.pid',false); -insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(3,'loadbalancing','haproxy','haproxy','/etc/init.d/haproxy','/var/run/haproxy.pid',false); -insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(4,'webserver','apache2','apache2','/etc/init.d/apache2','/var/run/apache2.pid', true); +insert into cloud.monitoring_services(id, uuid, service, process_name, service_name, service_path, pidfile, isDefault) values(1, UUID(), 'ssh','sshd', 'ssh','/etc/init.d/ssh','/var/run/sshd.pid',true); +insert into cloud.monitoring_services(id, uuid, service, process_name, service_name, service_path, pidfile, isDefault) values(2, UUID(), 'dhcp','dnsmasq','dnsmasq','/etc/init.d/dnsmasq','/var/run/dnsmasq/dnsmasq.pid',false); +insert into cloud.monitoring_services(id, uuid, service, process_name, service_name, service_path, pidfile, isDefault) values(3, UUID(), 'loadbalancing','haproxy','haproxy','/etc/init.d/haproxy','/var/run/haproxy.pid',false); +insert into cloud.monitoring_services(id, uuid, service, process_name, service_name, service_path, pidfile, isDefault) values(4, UUID(), 'webserver','apache2','apache2','/etc/init.d/apache2','/var/run/apache2.pid', true); + ALTER TABLE `cloud`.`service_offering` CHANGE COLUMN `cpu` `cpu` INT(10) UNSIGNED NULL COMMENT '# of cores' , CHANGE COLUMN `speed` `speed` INT(10) UNSIGNED NULL COMMENT 'speed per core in mhz' , CHANGE COLUMN `ram_size` `ram_size` BIGINT(20) UNSIGNED NULL ; CREATE TABLE `cloud`.`usage_event_details` ( diff --git a/systemvm/patches/debian/config/root/monitorServices.py b/systemvm/patches/debian/config/root/monitorServices.py index 358c9dcdfac..f0c2afe83a6 100755 --- a/systemvm/patches/debian/config/root/monitorServices.py +++ b/systemvm/patches/debian/config/root/monitorServices.py @@ -170,7 +170,7 @@ def checkProcessStatus( process ): if isPidMatchPidFile(pidfile, pids) == StatusCodes.SUCCESS: pidFileMatched = 1; printd("pid file is matched ...") - raisealert(log.INFO, "The process detected as running", process_name) + raisealert(log.ALERT, "The process detected as running", process_name) break else: printd("pid file is not matched ...") @@ -201,7 +201,7 @@ def checkProcessStatus( process ): if return_val == 0: printd("The process" + process_name +" recovered successfully ") msg="The process " +process_name+" is recovered successfully " - raisealert(log.ALERT,process_name,msg) + raisealert(log.INFO,process_name,msg) break; else: From f611c24dd509ddea69656813435800e03ecbbb5b Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 7 Nov 2013 13:11:54 +0100 Subject: [PATCH 050/108] Fix CID 1127027 Dereference before null check template can't be null at this point as it has already been dereferenced --- .../src/com/cloud/vm/UserVmManagerImpl.java | 443 +++++++++--------- 1 file changed, 222 insertions(+), 221 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 52fda38ffd5..3eaf33a6119 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -35,6 +35,7 @@ import javax.naming.ConfigurationException; import org.apache.commons.codec.binary.Base64; import org.apache.log4j.Logger; + import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroupService; @@ -68,15 +69,15 @@ import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationSer import org.apache.cloudstack.engine.service.api.OrchestrationService; import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo; +import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory; +import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService; +import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult; +import org.apache.cloudstack.framework.async.AsyncCallFuture; import org.apache.cloudstack.framework.config.ConfigKey; import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.jobs.AsyncJobManager; import org.apache.cloudstack.managed.context.ManagedContextRunnable; -import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory; -import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService; -import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult; -import org.apache.cloudstack.framework.async.AsyncCallFuture; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import org.apache.cloudstack.storage.to.TemplateObjectTO; @@ -243,9 +244,9 @@ import com.cloud.utils.db.Filter; import com.cloud.utils.db.GlobalLock; import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchCriteria; -import com.cloud.utils.db.TransactionCallbackNoReturn; import com.cloud.utils.db.SearchCriteria.Func; import com.cloud.utils.db.Transaction; +import com.cloud.utils.db.TransactionCallbackNoReturn; import com.cloud.utils.db.TransactionCallbackWithException; import com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn; import com.cloud.utils.db.TransactionStatus; @@ -726,7 +727,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir return true; } - User user = _userDao.findById(userId); + _userDao.findById(userId); try { VirtualMachineEntity vmEntity = _orchSrvc.getVirtualMachine(vm.getUuid()); status = vmEntity.stop(Long.toString(userId)); @@ -1148,11 +1149,11 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vmInstance.getAccountId(), vmInstance.getDataCenterId(), vmInstance.getId(), oldNicIdString, oldNetworkOfferingId, null, 1L, VirtualMachine.class.getName(), vmInstance.getUuid()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vmInstance.getAccountId(), vmInstance.getDataCenterId(), - vmInstance.getId(), nicIdString, newNetworkOfferingId, null, 1L, VirtualMachine.class.getName(), vmInstance.getUuid()); + vmInstance.getId(), nicIdString, newNetworkOfferingId, null, 1L, VirtualMachine.class.getName(), vmInstance.getUuid()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vmInstance.getAccountId(), vmInstance.getDataCenterId(), vmInstance.getId(), nicIdString, newNetworkOfferingId, null, 0L, VirtualMachine.class.getName(), vmInstance.getUuid()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vmInstance.getAccountId(), vmInstance.getDataCenterId(), - vmInstance.getId(), oldNicIdString, oldNetworkOfferingId, null, 0L, VirtualMachine.class.getName(), vmInstance.getUuid()); + vmInstance.getId(), oldNicIdString, oldNetworkOfferingId, null, 0L, VirtualMachine.class.getName(), vmInstance.getUuid()); return _vmDao.findById(vmInstance.getId()); } @@ -1286,7 +1287,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir ExcludeList excludes = new ExcludeList(); boolean enableDynamicallyScaleVm = EnableDynamicallyScaleVm.valueIn(vmInstance.getDataCenterId()); if(!enableDynamicallyScaleVm){ - throw new PermissionDeniedException("Dynamically scaling virtual machines is disabled for this zone, please contact your admin"); + throw new PermissionDeniedException("Dynamically scaling virtual machines is disabled for this zone, please contact your admin"); } if (!vmInstance.isDynamicallyScalable()) { throw new CloudRuntimeException("Unable to Scale the vm: " + vmInstance.getUuid() + " as vm does not have tools to support dynamic scaling"); @@ -1430,24 +1431,24 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir Transaction.execute(new TransactionCallbackWithExceptionNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) throws ResourceAllocationException { - + Account account = _accountDao.lockRow(vm.getAccountId(), true); - + // if the account is deleted, throw error if (account.getRemoved() != null) { throw new CloudRuntimeException( "Unable to recover VM as the account is deleted"); } - + // Get serviceOffering for Virtual Machine ServiceOfferingVO serviceOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); - + // First check that the maximum number of UserVMs, CPU and Memory limit for the given // accountId will not be exceeded resourceLimitCheck(account, new Long(serviceOffering.getCpu()), new Long(serviceOffering.getRamSize())); - + _haMgr.cancelDestroy(vm, vm.getHostId()); - + try { if (!_itMgr.stateTransitTo(vm, VirtualMachine.Event.RecoveryRequested, null)) { @@ -1462,7 +1463,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir "Unable to recover the vm because it is not in the correct state: " + vmId); } - + // Recover the VM's disks List volumes = _volsDao.findByInstance(vmId); for (VolumeVO volume : volumes) { @@ -1484,7 +1485,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir volume.getSize(), Volume.class.getName(), volume.getUuid()); } } - + //Update Resource Count for the given account resourceCountIncrement(account.getId(), new Long(serviceOffering.getCpu()), new Long(serviceOffering.getRamSize())); @@ -1544,7 +1545,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir String value = _configDao.getValue(Config.SetVmInternalNameUsingDisplayName.key()); _instanceNameFlag = (value == null)?false:Boolean.parseBoolean(value); - _scaleRetry = NumbersUtil.parseInt(configs.get(Config.ScaleRetry.key()), 2); + _scaleRetry = NumbersUtil.parseInt(configs.get(Config.ScaleRetry.key()), 2); s_logger.info("User VM Manager is configured."); @@ -1795,7 +1796,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, vmInstance); - + if (isDisplayVmEnabled != null) { if(!_accountMgr.isRootAdmin(caller.getType())){ throw new PermissionDeniedException( "Cannot update parameter displayvm, only admin permitted "); @@ -1808,7 +1809,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir @Override public UserVm updateVirtualMachine(long id, String displayName, String group, Boolean ha, Boolean isDisplayVmEnabled, Long osTypeId, String userData, Boolean isDynamicallyScalable, HTTPMethod httpMethod) - throws ResourceUnavailableException, InsufficientCapacityException { + throws ResourceUnavailableException, InsufficientCapacityException { UserVmVO vm = _vmDao.findById(id); if (vm == null) { throw new CloudRuntimeException( @@ -1820,7 +1821,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir throw new InvalidParameterValueException("Vm with id " + id + " is not in the right state"); } - + if (displayName == null) { displayName = vm.getDisplayName(); } @@ -1834,7 +1835,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir throw new InvalidParameterValueException( "Can't enable ha for the vm as it's created from the Service offering having HA disabled"); } - + if (isDisplayVmEnabled == null) { isDisplayVmEnabled = vm.isDisplayVm(); } @@ -1853,7 +1854,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (isDynamicallyScalable == null) { isDynamicallyScalable = vm.isDynamicallyScalable(); } - + if (osTypeId == null) { osTypeId = vm.getGuestOSId(); } @@ -1886,26 +1887,26 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir List nics = _nicDao.listByVmId(vm.getId()); if (nics == null || nics.isEmpty()) { - s_logger.error("unable to find any nics for vm " + vm.getUuid()); - return false; + s_logger.error("unable to find any nics for vm " + vm.getUuid()); + return false; } for (Nic nic : nics) { - Network network = _networkDao.findById(nic.getNetworkId()); - NicProfile nicProfile = new NicProfile(nic, network, null, null, null, - _networkModel.isSecurityGroupSupportedInNetwork(network), - _networkModel.getNetworkTag(template.getHypervisorType(), network)); + Network network = _networkDao.findById(nic.getNetworkId()); + NicProfile nicProfile = new NicProfile(nic, network, null, null, null, + _networkModel.isSecurityGroupSupportedInNetwork(network), + _networkModel.getNetworkTag(template.getHypervisorType(), network)); - VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vm); + VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vm); - UserDataServiceProvider element = _networkModel.getUserDataUpdateProvider(network); - if (element == null) { - throw new CloudRuntimeException("Can't find network element for " + Service.UserData.getName() + " provider needed for UserData update"); - } - boolean result = element.saveUserData(network, nicProfile, vmProfile); - if (!result) { - s_logger.error("Failed to update userdata for vm " + vm + " and nic " + nic); - } + UserDataServiceProvider element = _networkModel.getUserDataUpdateProvider(network); + if (element == null) { + throw new CloudRuntimeException("Can't find network element for " + Service.UserData.getName() + " provider needed for UserData update"); + } + boolean result = element.saveUserData(network, nicProfile, vmProfile); + if (!result) { + s_logger.error("Failed to update userdata for vm " + vm + " and nic " + nic); + } } return true; @@ -1957,11 +1958,11 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir CallContext ctx = CallContext.current(); long vmId = cmd.getId(); boolean expunge = cmd.getExpunge(); - + if (!_accountMgr.isAdmin(ctx.getCallingAccount().getType()) && expunge) { throw new PermissionDeniedException("Parameter " + ApiConstants.EXPUNGE + " can be passed by Admin only"); } - + UserVm destroyedVm = destroyVm(vmId); if (expunge) { UserVmVO vm = _vmDao.findById(vmId); @@ -1969,7 +1970,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir throw new CloudRuntimeException("Failed to expunge vm " + destroyedVm); } } - + return destroyedVm; } @@ -2103,7 +2104,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir throw new CloudRuntimeException("Failed to acquire lock on vm group id=" + groupFinal.getId() + " name=" + groupFinal.getName()); } - + // Currently don't allow to assign a vm to more than one group if (_groupVMMapDao.listByInstanceId(userVmId) != null) { // Delete all mappings from group_vm_map table @@ -2187,11 +2188,11 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir @Override @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List securityGroupIdList, Account owner, - String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, - HypervisorType hypervisor, HTTPMethod httpmethod, String userData, String sshKeyPair, - Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, - List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) - throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { + String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, + HypervisorType hypervisor, HTTPMethod httpmethod, String userData, String sshKeyPair, + Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, + List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) + throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); List networkList = new ArrayList(); @@ -2241,18 +2242,18 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir return createVirtualMachine(zone, serviceOffering, template, hostName, displayName, owner, diskOfferingId, diskSize, networkList, securityGroupIdList, group, httpmethod, userData, sshKeyPair, hypervisor, - caller, requestedIps, defaultIps, displayVm, keyboard, affinityGroupIdList, cpuSpeed , memory, cpuNumber, rootDiskSize); + caller, requestedIps, defaultIps, displayVm, keyboard, affinityGroupIdList, cpuSpeed , memory, cpuNumber, rootDiskSize); } @Override @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List networkIdList, - List securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, - Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, - String sshKeyPair, Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, - List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) throws InsufficientCapacityException, ConcurrentOperationException, - ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { + List securityGroupIdList, Account owner, String hostName, String displayName, Long diskOfferingId, + Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData, + String sshKeyPair, Map requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, + List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) throws InsufficientCapacityException, ConcurrentOperationException, + ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); List networkList = new ArrayList(); @@ -2359,16 +2360,16 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir return createVirtualMachine(zone, serviceOffering, template, hostName, displayName, owner, diskOfferingId, diskSize, networkList, securityGroupIdList, group, httpmethod, userData, sshKeyPair, hypervisor, - caller, requestedIps, defaultIps, displayVm, keyboard, affinityGroupIdList, cpuSpeed, memory, cpuNumber, rootDiskSize); + caller, requestedIps, defaultIps, displayVm, keyboard, affinityGroupIdList, cpuSpeed, memory, cpuNumber, rootDiskSize); } @Override @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true) public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, List networkIdList, Account owner, String hostName, - String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, - HTTPMethod httpmethod, String userData, String sshKeyPair, Map requestedIps, - IpAddresses defaultIps, Boolean displayvm, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) - throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { + String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, + HTTPMethod httpmethod, String userData, String sshKeyPair, Map requestedIps, + IpAddresses defaultIps, Boolean displayvm, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) + throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException { Account caller = CallContext.current().getCallingAccount(); List networkList = new ArrayList(); @@ -2473,8 +2474,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } return createVirtualMachine(zone, serviceOffering, template, hostName, displayName, owner, diskOfferingId, - diskSize, networkList, null, group, httpmethod, userData, sshKeyPair, hypervisor, caller, requestedIps, - defaultIps, displayvm, keyboard, affinityGroupIdList, cpuSpeed, memory, cpuNumber, rootDiskSize); + diskSize, networkList, null, group, httpmethod, userData, sshKeyPair, hypervisor, caller, requestedIps, + defaultIps, displayvm, keyboard, affinityGroupIdList, cpuSpeed, memory, cpuNumber, rootDiskSize); } @@ -2487,9 +2488,9 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir @DB protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate tmplt, String hostName, String displayName, Account owner, Long diskOfferingId, - Long diskSize, List networkList, List securityGroupIdList, String group, HTTPMethod httpmethod, - String userData, String sshKeyPair, HypervisorType hypervisor, Account caller, Map requestedIps, - IpAddresses defaultIps, Boolean isDisplayVmEnabled, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) + Long diskSize, List networkList, List securityGroupIdList, String group, HTTPMethod httpmethod, + String userData, String sshKeyPair, HypervisorType hypervisor, Account caller, Map requestedIps, + IpAddresses defaultIps, Boolean isDisplayVmEnabled, String keyboard, List affinityGroupIdList, Integer cpuSpeed, Integer memory, Integer cpuNumber, Long rootDiskSize) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, StorageUnavailableException, ResourceAllocationException { _accountMgr.checkAccess(caller, null, true, owner); @@ -2535,17 +2536,17 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir Long tmp = _templateDao.findById(template.getId()).getSize(); long size = 0; if (tmp != null) { - size = tmp; + size = tmp; } if (diskOfferingId != null) { size += _diskOfferingDao.findById(diskOfferingId).getDiskSize(); } - if (!offering.isDynamic()) { - resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize())); - } - else { - resourceLimitCheck(owner, new Long(cpuSpeed), new Long(memory)); - } + if (!offering.isDynamic()) { + resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize())); + } + else { + resourceLimitCheck(owner, new Long(cpuSpeed), new Long(memory)); + } _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, (isIso || diskOfferingId == null ? 1 : 2)); _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, new Long (size)); @@ -2782,7 +2783,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir hostName = generateHostName(uuidName); } } - + if (hostName != null) { // Check is hostName is RFC compliant checkNameForRFCCompliance(hostName); @@ -2817,14 +2818,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir // * verify that there are no duplicates if (hostNames.contains(hostName)) { throw new InvalidParameterValueException("The vm with hostName " + hostName - + " already exists in the network domain: " + ntwkDomain + "; network=" - + _networkModel.getNetwork(ntwkId)); + + " already exists in the network domain: " + ntwkDomain + "; network=" + + _networkModel.getNetwork(ntwkId)); } } } HypervisorType hypervisorType = null; - if (template == null || template.getHypervisorType() == null + if (template.getHypervisorType() == null || template.getHypervisorType() == HypervisorType.None) { hypervisorType = hypervisor; } else { @@ -2925,7 +2926,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir vm.setDetail("firmware", "efi"); s_logger.info("guestOS is OSX : overwrite root disk controller to scsi, use smc and efi"); } - } + } Map details = template.getDetails(); if ( details != null && !details.isEmpty() ) { @@ -2950,33 +2951,33 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir rootDiskTags.add(offering.getTags()); if(isIso){ - VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachineFromScratch(vm.getUuid(), Long.toString(owner.getAccountId()), vm.getIsoId().toString(), hostName, displayName, hypervisor.name(), guestOSCategory.getName(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(), diskSize, computeTags, rootDiskTags, networkNicMap, plan); + _orchSrvc.createVirtualMachineFromScratch(vm.getUuid(), Long.toString(owner.getAccountId()), vm.getIsoId().toString(), hostName, displayName, hypervisor.name(), guestOSCategory.getName(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(), diskSize, computeTags, rootDiskTags, networkNicMap, plan); }else { - VirtualMachineEntity vmEntity = _orchSrvc.createVirtualMachine(vm.getUuid(), Long.toString(owner.getAccountId()), Long.toString(template.getId()), hostName, displayName, hypervisor.name(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(), diskSize, computeTags, rootDiskTags, networkNicMap, plan, rootDiskSize); + _orchSrvc.createVirtualMachine(vm.getUuid(), Long.toString(owner.getAccountId()), Long.toString(template.getId()), hostName, displayName, hypervisor.name(), offering.getCpu(), offering.getSpeed(), offering.getRamSize(), diskSize, computeTags, rootDiskTags, networkNicMap, plan, rootDiskSize); } - - - + + + if (s_logger.isDebugEnabled()) { s_logger.debug("Successfully allocated DB entry for " + vm); } CallContext.current().setEventDetails("Vm Id: " + vm.getId()); if (!offering.isDynamic()) { - UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), - vm.getHostName(), offering.getId(), template.getId(), hypervisorType.toString(), - VirtualMachine.class.getName(), vm.getUuid()); + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), + vm.getHostName(), offering.getId(), template.getId(), hypervisorType.toString(), + VirtualMachine.class.getName(), vm.getUuid()); } else { - HashMap vmdetailsMap = new HashMap(); - for (UserVmDetailVO vmdetail :vmdetails) { - vmdetailsMap.put(vmdetail.getName(), vmdetail.getValue()); - } - UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), - vm.getHostName(), offering.getId(), template.getId(), hypervisorType.toString(), - VirtualMachine.class.getName(), vm.getUuid(), vmdetailsMap); + HashMap vmdetailsMap = new HashMap(); + for (UserVmDetailVO vmdetail :vmdetails) { + vmdetailsMap.put(vmdetail.getName(), vmdetail.getValue()); + } + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), + vm.getHostName(), offering.getId(), template.getId(), hypervisorType.toString(), + VirtualMachine.class.getName(), vm.getUuid(), vmdetailsMap); } - + //Update Resource Count for the given account resourceCountIncrement(accountId, new Long(offering.getCpu()), new Long(offering.getRamSize())); @@ -3001,7 +3002,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir decodedUserData = Base64.decodeBase64(userData.getBytes()); if (decodedUserData.length > MAX_HTTP_GET_LENGTH) { throw new InvalidParameterValueException( - "User data is too long for GET request"); + "User data is too long for GET request"); } } else if (httpmethod.equals(HTTPMethod.POST)) { if (userData.length() >= MAX_HTTP_POST_LENGTH) { @@ -3011,7 +3012,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir decodedUserData = Base64.decodeBase64(userData.getBytes()); if (decodedUserData.length > MAX_HTTP_POST_LENGTH) { throw new InvalidParameterValueException( - "User data is too long for POST request"); + "User data is too long for POST request"); } } @@ -3099,17 +3100,17 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir @Override public boolean setupVmForPvlan(boolean add, Long hostId, NicProfile nic) { if (!nic.getBroadCastUri().getScheme().equals("pvlan")) { - return false; - } + return false; + } String op = "add"; if (!add) { - // "delete" would remove all the rules(if using ovs) related to this vm - op = "delete"; + // "delete" would remove all the rules(if using ovs) related to this vm + op = "delete"; } Network network = _networkDao.findById(nic.getNetworkId()); Host host = _hostDao.findById(hostId); String networkTag = _networkModel.getNetworkTag(host.getHypervisorType(), network); - PvlanSetupCommand cmd = PvlanSetupCommand.createVmSetup(op, nic.getBroadCastUri(), networkTag, nic.getMacAddress()); + PvlanSetupCommand cmd = PvlanSetupCommand.createVmSetup(op, nic.getBroadCastUri(), networkTag, nic.getMacAddress()); Answer answer = null; try { answer = _agentMgr.send(hostId, cmd); @@ -3123,7 +3124,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir boolean result = true; if (answer == null || !answer.getResult()) { - result = false; + result = false; } return result; } @@ -3146,10 +3147,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir List volumes = _volsDao.findByInstance(userVm.getId()); VmDiskStatisticsVO diskstats = null; for (VolumeVO volume : volumes) { - diskstats = _vmDiskStatsDao.findBy(userVm.getAccountId(), userVm.getDataCenterId(),userVm.getId(), volume.getId()); + diskstats = _vmDiskStatsDao.findBy(userVm.getAccountId(), userVm.getDataCenterId(),userVm.getId(), volume.getId()); if (diskstats == null) { - diskstats = new VmDiskStatisticsVO(userVm.getAccountId(), userVm.getDataCenterId(),userVm.getId(), volume.getId()); - _vmDiskStatsDao.persist(diskstats); + diskstats = new VmDiskStatisticsVO(userVm.getAccountId(), userVm.getDataCenterId(),userVm.getId(), volume.getId()); + _vmDiskStatsDao.persist(diskstats); } } @@ -3202,15 +3203,15 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir guestNetwork = network; // In vmware, we will be effecting pvlan settings in portgroups in StartCommand. if (profile.getHypervisorType() != HypervisorType.VMware) { - if (nic.getBroadcastUri().getScheme().equals("pvlan")) { - NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), 0, false, "pvlan-nic"); - if (!setupVmForPvlan(true, hostId, nicProfile)) { - return false; - } + if (nic.getBroadcastUri().getScheme().equals("pvlan")) { + NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), 0, false, "pvlan-nic"); + if (!setupVmForPvlan(true, hostId, nicProfile)) { + return false; + } + } } } } - } boolean ipChanged = false; if (originalIp != null && !originalIp.equalsIgnoreCase(returnedIp)) { if (returnedIp != null && guestNic != null) { @@ -3225,7 +3226,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } } if (ipChanged) { - DataCenterVO dc = _dcDao.findById(vm.getDataCenterId()); + _dcDao.findById(vm.getDataCenterId()); UserVmVO userVm = _vmDao.findById(profile.getId()); // dc.getDhcpProvider().equalsIgnoreCase(Provider.ExternalDhcpServer.getName()) if (_ntwkSrvcDao.canProviderSupportServiceInNetwork( @@ -3279,15 +3280,15 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir "unable to find a virtual machine with id " + vmId); } - UserVO user = _userDao.findById(userId); + _userDao.findById(userId); boolean status = false; try { VirtualMachineEntity vmEntity = _orchSrvc.getVirtualMachine(vm.getUuid()); status = vmEntity.stop(Long.toString(userId)); if (status) { - return _vmDao.findById(vmId); + return _vmDao.findById(vmId); } else { - return null; + return null; } } catch (ResourceUnavailableException e) { throw new CloudRuntimeException( @@ -3327,8 +3328,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir NetworkVO network = _networkDao.findById(nic.getNetworkId()); if (network.getTrafficType() == TrafficType.Guest) { if (nic.getBroadcastUri() != null && nic.getBroadcastUri().getScheme().equals("pvlan")) { - NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), 0, false, "pvlan-nic"); - setupVmForPvlan(false, vm.getHostId(), nicProfile); + NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), 0, false, "pvlan-nic"); + setupVmForPvlan(false, vm.getHostId(), nicProfile); } } } @@ -3497,7 +3498,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } _accountMgr.checkAccess(caller, null, true, vm); - User userCaller = _userDao.findById(userId); + _userDao.findById(userId); boolean status; State vmState = vm.getState(); @@ -3546,16 +3547,16 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir // support KVM only util 2013.06.25 if (!userVm.getHypervisorType().equals(HypervisorType.KVM)) return; - s_logger.debug("Collect vm disk statistics from host before stopping Vm"); - long hostId = userVm.getHostId(); - List vmNames = new ArrayList(); - vmNames.add(userVm.getInstanceName()); - final HostVO host = _hostDao.findById(hostId); + s_logger.debug("Collect vm disk statistics from host before stopping Vm"); + long hostId = userVm.getHostId(); + List vmNames = new ArrayList(); + vmNames.add(userVm.getInstanceName()); + final HostVO host = _hostDao.findById(hostId); - GetVmDiskStatsAnswer diskStatsAnswer = null; - try { - diskStatsAnswer = (GetVmDiskStatsAnswer) _agentMgr.easySend(hostId, new GetVmDiskStatsCommand(vmNames, host.getGuid(), host.getName())); - } catch (Exception e) { + GetVmDiskStatsAnswer diskStatsAnswer = null; + try { + diskStatsAnswer = (GetVmDiskStatsAnswer) _agentMgr.easySend(hostId, new GetVmDiskStatsCommand(vmNames, host.getGuid(), host.getName())); + } catch (Exception e) { s_logger.warn("Error while collecting disk stats for vm: " + userVm.getHostName() + " from host: " + host.getName(), e); return; } @@ -3575,83 +3576,83 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir List vmDiskStats = vmDiskStatsByName.get(userVm.getInstanceName()); if (vmDiskStats == null) return; - - for (VmDiskStatsEntry vmDiskStat:vmDiskStats) { - SearchCriteria sc_volume = _volsDao.createSearchCriteria(); - sc_volume.addAnd("path", SearchCriteria.Op.EQ, vmDiskStat.getPath()); - VolumeVO volume = _volsDao.search(sc_volume, null).get(0); - VmDiskStatisticsVO previousVmDiskStats = _vmDiskStatsDao.findBy(userVm.getAccountId(), userVm.getDataCenterId(), userVm.getId(), volume.getId()); - VmDiskStatisticsVO vmDiskStat_lock = _vmDiskStatsDao.lock(userVm.getAccountId(), userVm.getDataCenterId(), userVm.getId(), volume.getId()); - - if ((vmDiskStat.getIORead() == 0) && (vmDiskStat.getIOWrite() == 0) && (vmDiskStat.getBytesRead() == 0) && (vmDiskStat.getBytesWrite() == 0)) { - s_logger.debug("Read/Write of IO and Bytes are both 0. Not updating vm_disk_statistics"); - continue; - } - - if (vmDiskStat_lock == null) { - s_logger.warn("unable to find vm disk stats from host for account: " + userVm.getAccountId() + " with vmId: " + userVm.getId()+ " and volumeId:" + volume.getId()); - continue; - } - - if (previousVmDiskStats != null - && ((previousVmDiskStats.getCurrentIORead() != vmDiskStat_lock.getCurrentIORead()) - || ((previousVmDiskStats.getCurrentIOWrite() != vmDiskStat_lock.getCurrentIOWrite()) - || (previousVmDiskStats.getCurrentBytesRead() != vmDiskStat_lock.getCurrentBytesRead()) - || (previousVmDiskStats.getCurrentBytesWrite() != vmDiskStat_lock.getCurrentBytesWrite())))) { - s_logger.debug("vm disk stats changed from the time GetVmDiskStatsCommand was sent. " + - "Ignoring current answer. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + - " IO Read: " + vmDiskStat.getIORead() + " IO Write: " + vmDiskStat.getIOWrite() + - " Bytes Read: " + vmDiskStat.getBytesRead() + " Bytes Write: " + vmDiskStat.getBytesWrite()); - continue; - } - - if (vmDiskStat_lock.getCurrentIORead() > vmDiskStat.getIORead()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Read # of IO that's less than the last one. " + - "Assuming something went wrong and persisting it. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + - " Reported: " + vmDiskStat.getIORead() + " Stored: " + vmDiskStat_lock.getCurrentIORead()); - } - vmDiskStat_lock.setNetIORead(vmDiskStat_lock.getNetIORead() + vmDiskStat_lock.getCurrentIORead()); - } - vmDiskStat_lock.setCurrentIORead(vmDiskStat.getIORead()); - if (vmDiskStat_lock.getCurrentIOWrite() > vmDiskStat.getIOWrite()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Write # of IO that's less than the last one. " + - "Assuming something went wrong and persisting it. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + - " Reported: " + vmDiskStat.getIOWrite() + " Stored: " + vmDiskStat_lock.getCurrentIOWrite()); - } - vmDiskStat_lock.setNetIOWrite(vmDiskStat_lock.getNetIOWrite() + vmDiskStat_lock.getCurrentIOWrite()); - } - vmDiskStat_lock.setCurrentIOWrite(vmDiskStat.getIOWrite()); - if (vmDiskStat_lock.getCurrentBytesRead() > vmDiskStat.getBytesRead()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Read # of Bytes that's less than the last one. " + - "Assuming something went wrong and persisting it. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + - " Reported: " + vmDiskStat.getBytesRead() + " Stored: " + vmDiskStat_lock.getCurrentBytesRead()); - } - vmDiskStat_lock.setNetBytesRead(vmDiskStat_lock.getNetBytesRead() + vmDiskStat_lock.getCurrentBytesRead()); - } - vmDiskStat_lock.setCurrentBytesRead(vmDiskStat.getBytesRead()); - if (vmDiskStat_lock.getCurrentBytesWrite() > vmDiskStat.getBytesWrite()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Write # of Bytes that's less than the last one. " + - "Assuming something went wrong and persisting it. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + - " Reported: " + vmDiskStat.getBytesWrite() + " Stored: " + vmDiskStat_lock.getCurrentBytesWrite()); - } - vmDiskStat_lock.setNetBytesWrite(vmDiskStat_lock.getNetBytesWrite() + vmDiskStat_lock.getCurrentBytesWrite()); - } - vmDiskStat_lock.setCurrentBytesWrite(vmDiskStat.getBytesWrite()); - - if (! _dailyOrHourly) { - //update agg bytes - vmDiskStat_lock.setAggIORead(vmDiskStat_lock.getNetIORead() + vmDiskStat_lock.getCurrentIORead()); - vmDiskStat_lock.setAggIOWrite(vmDiskStat_lock.getNetIOWrite() + vmDiskStat_lock.getCurrentIOWrite()); - vmDiskStat_lock.setAggBytesRead(vmDiskStat_lock.getNetBytesRead() + vmDiskStat_lock.getCurrentBytesRead()); - vmDiskStat_lock.setAggBytesWrite(vmDiskStat_lock.getNetBytesWrite() + vmDiskStat_lock.getCurrentBytesWrite()); - } - - _vmDiskStatsDao.update(vmDiskStat_lock.getId(), vmDiskStat_lock); - } + + for (VmDiskStatsEntry vmDiskStat:vmDiskStats) { + SearchCriteria sc_volume = _volsDao.createSearchCriteria(); + sc_volume.addAnd("path", SearchCriteria.Op.EQ, vmDiskStat.getPath()); + VolumeVO volume = _volsDao.search(sc_volume, null).get(0); + VmDiskStatisticsVO previousVmDiskStats = _vmDiskStatsDao.findBy(userVm.getAccountId(), userVm.getDataCenterId(), userVm.getId(), volume.getId()); + VmDiskStatisticsVO vmDiskStat_lock = _vmDiskStatsDao.lock(userVm.getAccountId(), userVm.getDataCenterId(), userVm.getId(), volume.getId()); + + if ((vmDiskStat.getIORead() == 0) && (vmDiskStat.getIOWrite() == 0) && (vmDiskStat.getBytesRead() == 0) && (vmDiskStat.getBytesWrite() == 0)) { + s_logger.debug("Read/Write of IO and Bytes are both 0. Not updating vm_disk_statistics"); + continue; + } + + if (vmDiskStat_lock == null) { + s_logger.warn("unable to find vm disk stats from host for account: " + userVm.getAccountId() + " with vmId: " + userVm.getId()+ " and volumeId:" + volume.getId()); + continue; + } + + if (previousVmDiskStats != null + && ((previousVmDiskStats.getCurrentIORead() != vmDiskStat_lock.getCurrentIORead()) + || ((previousVmDiskStats.getCurrentIOWrite() != vmDiskStat_lock.getCurrentIOWrite()) + || (previousVmDiskStats.getCurrentBytesRead() != vmDiskStat_lock.getCurrentBytesRead()) + || (previousVmDiskStats.getCurrentBytesWrite() != vmDiskStat_lock.getCurrentBytesWrite())))) { + s_logger.debug("vm disk stats changed from the time GetVmDiskStatsCommand was sent. " + + "Ignoring current answer. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + + " IO Read: " + vmDiskStat.getIORead() + " IO Write: " + vmDiskStat.getIOWrite() + + " Bytes Read: " + vmDiskStat.getBytesRead() + " Bytes Write: " + vmDiskStat.getBytesWrite()); + continue; + } + + if (vmDiskStat_lock.getCurrentIORead() > vmDiskStat.getIORead()) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Read # of IO that's less than the last one. " + + "Assuming something went wrong and persisting it. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + + " Reported: " + vmDiskStat.getIORead() + " Stored: " + vmDiskStat_lock.getCurrentIORead()); + } + vmDiskStat_lock.setNetIORead(vmDiskStat_lock.getNetIORead() + vmDiskStat_lock.getCurrentIORead()); + } + vmDiskStat_lock.setCurrentIORead(vmDiskStat.getIORead()); + if (vmDiskStat_lock.getCurrentIOWrite() > vmDiskStat.getIOWrite()) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Write # of IO that's less than the last one. " + + "Assuming something went wrong and persisting it. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + + " Reported: " + vmDiskStat.getIOWrite() + " Stored: " + vmDiskStat_lock.getCurrentIOWrite()); + } + vmDiskStat_lock.setNetIOWrite(vmDiskStat_lock.getNetIOWrite() + vmDiskStat_lock.getCurrentIOWrite()); + } + vmDiskStat_lock.setCurrentIOWrite(vmDiskStat.getIOWrite()); + if (vmDiskStat_lock.getCurrentBytesRead() > vmDiskStat.getBytesRead()) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Read # of Bytes that's less than the last one. " + + "Assuming something went wrong and persisting it. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + + " Reported: " + vmDiskStat.getBytesRead() + " Stored: " + vmDiskStat_lock.getCurrentBytesRead()); + } + vmDiskStat_lock.setNetBytesRead(vmDiskStat_lock.getNetBytesRead() + vmDiskStat_lock.getCurrentBytesRead()); + } + vmDiskStat_lock.setCurrentBytesRead(vmDiskStat.getBytesRead()); + if (vmDiskStat_lock.getCurrentBytesWrite() > vmDiskStat.getBytesWrite()) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Write # of Bytes that's less than the last one. " + + "Assuming something went wrong and persisting it. Host: " + host.getName() + " . VM: " + vmDiskStat.getVmName() + + " Reported: " + vmDiskStat.getBytesWrite() + " Stored: " + vmDiskStat_lock.getCurrentBytesWrite()); + } + vmDiskStat_lock.setNetBytesWrite(vmDiskStat_lock.getNetBytesWrite() + vmDiskStat_lock.getCurrentBytesWrite()); + } + vmDiskStat_lock.setCurrentBytesWrite(vmDiskStat.getBytesWrite()); + + if (! _dailyOrHourly) { + //update agg bytes + vmDiskStat_lock.setAggIORead(vmDiskStat_lock.getNetIORead() + vmDiskStat_lock.getCurrentIORead()); + vmDiskStat_lock.setAggIOWrite(vmDiskStat_lock.getNetIOWrite() + vmDiskStat_lock.getCurrentIOWrite()); + vmDiskStat_lock.setAggBytesRead(vmDiskStat_lock.getNetBytesRead() + vmDiskStat_lock.getCurrentBytesRead()); + vmDiskStat_lock.setAggBytesWrite(vmDiskStat_lock.getNetBytesWrite() + vmDiskStat_lock.getCurrentBytesWrite()); + } + + _vmDiskStatsDao.update(vmDiskStat_lock.getId(), vmDiskStat_lock); + } } }); } catch (Exception e) { @@ -3691,7 +3692,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir boolean status; - status = expunge(vm, userId, caller); + status = expunge(vm, userId, caller); if (status) { return _vmDao.findByIdIncludingRemoved(vmId); } else { @@ -4063,7 +4064,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir checkHostsDedication(vm, srcHostId, destinationHost.getId()); - // call to core process + // call to core process DataCenterVO dcVO = _dcDao.findById(destinationHost.getDataCenterId()); HostPodVO pod = _podDao.findById(destinationHost.getPodId()); Cluster cluster = _clusterDao.findById(destinationHost.getClusterId()); @@ -4205,7 +4206,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (!((destPlanner.getDeploymentPlanner() != null && destPlanner.getDeploymentPlanner().equals("ImplicitDedicationPlanner")) && vmsDest.getAccountId()==accountOfVm)) { msg = "VM of account " + accountOfVm + " with preffered implicit deployment planner being migrated to host " + destHost.getName() + - " not having all vms implicitly dedicated to account " + accountOfVm; + " not having all vms implicitly dedicated to account " + accountOfVm; } } } @@ -4358,11 +4359,11 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir // Check if the source and destination hosts are of the same type and support storage motion. if (!(srcHost.getHypervisorType().equals(destinationHost.getHypervisorType()) && - srcHost.getHypervisorVersion().equals(destinationHost.getHypervisorVersion()))) { + srcHost.getHypervisorVersion().equals(destinationHost.getHypervisorVersion()))) { throw new CloudRuntimeException("The source and destination hosts are not of the same type and version. " + - "Source hypervisor type and version: " + srcHost.getHypervisorType().toString() + " " + - srcHost.getHypervisorVersion() + ", Destination hypervisor type and version: " + - destinationHost.getHypervisorType().toString() + " " + destinationHost.getHypervisorVersion()); + "Source hypervisor type and version: " + srcHost.getHypervisorType().toString() + " " + + srcHost.getHypervisorVersion() + ", Destination hypervisor type and version: " + + destinationHost.getHypervisorType().toString() + " " + destinationHost.getHypervisorVersion()); } HypervisorCapabilitiesVO capabilities = _hypervisorCapabilitiesDao.findByHypervisorTypeAndVersion( @@ -4432,7 +4433,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir _itMgr.migrateWithStorage(vm.getUuid(), srcHostId, destinationHost.getId(), volToPoolObjectMap); return _vmDao.findById(vm.getId()); -} + } @DB @Override @@ -4580,16 +4581,16 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_DESTROY, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), vm.getServiceOfferingId(), vm.getTemplateId(), vm.getHypervisorType().toString(), VirtualMachine.class.getName(), vm.getUuid()); - + // update resource counts for old account resourceCountDecrement(oldAccount.getAccountId(), new Long(offering.getCpu()), new Long(offering.getRamSize())); - + // OWNERSHIP STEP 1: update the vm owner vm.setAccountId(newAccount.getAccountId()); vm.setDomainId(cmd.getDomainId()); _vmDao.persist(vm); - + // OS 2: update volume for (VolumeVO volume : volumes) { UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(), @@ -4613,10 +4614,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir _snapshotDao.remove(snapshot.getId()); } } - + //update resource count of new account resourceCountIncrement(newAccount.getAccountId(), new Long(offering.getCpu()), new Long(offering.getRamSize())); - + //generate usage events to account for this change UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), vm.getServiceOfferingId(), vm.getTemplateId(), vm.getHypervisorType().toString(), @@ -4867,7 +4868,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir Long userId = caller.getId(); Account owner = _accountDao.findById(vm.getAccountId()); - UserVO user = _userDao.findById(userId); + _userDao.findById(userId); long vmId = vm.getId(); boolean needRestart = false; @@ -4908,7 +4909,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir Long templateId = root.getTemplateId(); boolean isISO = false; if(templateId == null) { - // Assuming that for a vm deployed using ISO, template ID is set to NULL + // Assuming that for a vm deployed using ISO, template ID is set to NULL isISO = true; templateId = vm.getIsoId(); } @@ -4963,10 +4964,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir vm.setTemplateId(newTemplateId); _vmDao.update(vmId, vm); } else { - newVol = volumeMgr.allocateDuplicateVolume(root, newTemplateId); - vm.setGuestOSId(template.getGuestOSId()); - vm.setTemplateId(newTemplateId); - _vmDao.update(vmId, vm); + newVol = volumeMgr.allocateDuplicateVolume(root, newTemplateId); + vm.setGuestOSId(template.getGuestOSId()); + vm.setTemplateId(newTemplateId); + _vmDao.update(vmId, vm); } } else { newVol = volumeMgr.allocateDuplicateVolume(root, null); @@ -5032,7 +5033,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (vm != null && vm.getState() == State.Stopping) collectVmDiskStatistics(vm); } - + private void encryptAndStorePassword(UserVmVO vm, String password) { String sshPublicKey = vm.getDetail("SSH.PublicKey"); if (sshPublicKey != null && !sshPublicKey.equals("") From 9631df8d0ec96085b03ba6a324089b9ca41edf0c Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 7 Nov 2013 13:23:22 +0100 Subject: [PATCH 051/108] Fix CID 1127021 Operands don't affect results int can never be bigger than maxint. Auto unboxing of Integer, not need for intValue() --- server/src/com/cloud/vm/UserVmManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 3eaf33a6119..2d537bf5f97 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2739,19 +2739,19 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir if (offering.isDynamic()) { //insert the custom value of dynamic parameters if (offering.getCpu() == null) { - if ((cpuNumber != null) && ((cpuNumber.intValue() <= 0) || (cpuNumber.intValue() > 2147483647))) { + if ((cpuNumber != null) && (cpuNumber <= 0)) { throw new InvalidParameterValueException("Invalid CPU number value, specify a value between 1 and 2147483647"); } } if (offering.getSpeed() == null) { - if ((cpuSpeed != null) && ((cpuSpeed.intValue() <= 0) || (cpuSpeed.intValue() > 2147483647))) { + if ((cpuSpeed != null) && (cpuSpeed <= 0)) { throw new InvalidParameterValueException("Invalid CPU speed value, specify a value between 1 and 2147483647"); } } if (offering.getRamSize() == null) { - if ((memory != null) && ((memory.intValue() < 32) || (memory.intValue() > 2147483647))) { + if ((memory != null) && (memory < 32)) { throw new InvalidParameterValueException("Invalid memory value, specify a value between 32 and 2147483647 MB"); } } From ad0d7f882f001ed6421e4aa40070a215ffb1fd3b Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 7 Nov 2013 14:40:14 +0100 Subject: [PATCH 052/108] Fix CID 1127045 Dead local store Fix CID 1127041,1127040, 1127039, 1127038, 1127037 String concatenation in loop --- .../resource/HypervDirectConnectResource.java | 109 +++++++++--------- 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java index a8a09f6f98a..194ad77b05d 100644 --- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java +++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java @@ -19,7 +19,6 @@ package com.cloud.hypervisor.hyperv.resource; import java.io.File; import java.io.IOException; import java.net.ConnectException; -import java.net.InetSocketAddress; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; @@ -27,16 +26,11 @@ import java.nio.channels.SocketChannel; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Random; import java.util.UUID; import javax.ejb.Local; -import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; -import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; -import org.apache.cloudstack.utils.identity.ManagementServerNode; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.client.ClientProtocolException; @@ -47,6 +41,8 @@ import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; import org.apache.log4j.Logger; +import com.google.gson.Gson; + import com.cloud.agent.api.Answer; import com.cloud.agent.api.CheckRouterAnswer; import com.cloud.agent.api.CheckRouterCommand; @@ -60,7 +56,6 @@ import com.cloud.agent.api.NetworkUsageCommand; import com.cloud.agent.api.PingCommand; import com.cloud.agent.api.PingRoutingCommand; import com.cloud.agent.api.PingTestCommand; -import com.cloud.agent.api.StartCommand; import com.cloud.agent.api.StartupCommand; import com.cloud.agent.api.StartupRoutingCommand; import com.cloud.agent.api.StartupRoutingCommand.VmState; @@ -95,8 +90,6 @@ import com.cloud.agent.api.to.FirewallRuleTO; import com.cloud.agent.api.to.IpAddressTO; import com.cloud.agent.api.to.PortForwardingRuleTO; import com.cloud.agent.api.to.StaticNatRuleTO; -import com.cloud.agent.api.to.VirtualMachineTO; -import com.cloud.configuration.Config; import com.cloud.dc.DataCenter.NetworkType; import com.cloud.host.Host.Type; import com.cloud.hypervisor.Hypervisor; @@ -107,20 +100,11 @@ import com.cloud.network.rules.FirewallRule; import com.cloud.resource.ServerResource; import com.cloud.resource.ServerResourceBase; import com.cloud.serializer.GsonHelper; -import com.cloud.storage.JavaStorageLayer; -import com.cloud.storage.StorageLayer; -import com.cloud.utils.FileUtil; -import com.cloud.utils.NumbersUtil; import com.cloud.utils.Pair; import com.cloud.utils.StringUtils; -import com.cloud.utils.db.GlobalLock; -import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.net.NetUtils; -import com.cloud.utils.script.Script; import com.cloud.utils.ssh.SshHelper; -import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachineName; -import com.google.gson.Gson; /** * Implementation of dummy resource to be returned from discoverer. @@ -164,8 +148,8 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S if (!_configureCalled) { String errMsg = this.getClass().getName() - + " requires configure() be called before" - + " initialize()"; + + " requires configure() be called before" + + " initialize()"; s_logger.error(errMsg); } @@ -220,7 +204,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S "Host %s (IP %s) changed zone/data center. Was " + defaultStartRoutCmd.getDataCenter() + " NOW its " + startCmd.getDataCenter(), - _name, _agentIp); + _name, _agentIp); s_logger.error(errMsg); // TODO: valid to return null, or should we throw? return null; @@ -267,8 +251,8 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S String errMsg = String.format( "Host %s (IP %s) name. Was " + startCmd.getName() - + " NOW its " - + defaultStartRoutCmd.getName(), _name, + + " NOW its " + + defaultStartRoutCmd.getName(), _name, _agentIp); s_logger.error(errMsg); // TODO: valid to return null, or should we throw? @@ -315,7 +299,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S s_logger.debug("Ping host " + _name + " (IP " + _agentIp + ")"); } - Answer pingAns = this.executeRequest(pingCmd); + Answer pingAns = executeRequest(pingCmd); if (pingAns == null || !pingAns.getResult()) { s_logger.info("Cannot ping host " + _name + " (IP " + _agentIp @@ -390,9 +374,9 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S } else if (clazz == GetDomRVersionCmd.class) { answer = execute((GetDomRVersionCmd)cmd); } else if (cmd instanceof NetworkUsageCommand) { - answer = execute((NetworkUsageCommand) cmd); + answer = execute((NetworkUsageCommand) cmd); } else if (clazz == IpAssocCommand.class) { - answer = execute((IpAssocCommand) cmd); + answer = execute((IpAssocCommand) cmd); } else if (clazz == DnsMasqConfigCommand.class) { return execute((DnsMasqConfigCommand) cmd); } else if (clazz == CreateIpAliasCommand.class) { @@ -430,7 +414,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S // Else send the cmd to hyperv agent. String ansStr = postHttpRequest(s_gson.toJson(cmd), agentUri); if (ansStr == null) { - return Answer.createUnsupportedCommandAnswer(cmd); + return Answer.createUnsupportedCommandAnswer(cmd); } // Only Answer instances are returned by remote agents. // E.g. see Response.getAnswers() @@ -498,12 +482,13 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S Pair result; try { String controlIp = getRouterSshControlIp(cmd); - String cmdline = "/opt/cloud/bin/checkbatchs2svpn.sh "; + StringBuilder cmdline = new StringBuilder("/opt/cloud/bin/checkbatchs2svpn.sh "); for (String ip : cmd.getVpnIps()) { - cmdline += " " + ip; + cmdline.append(" "); + cmdline.append(ip); } - result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", getSystemVMKeyFile(), null, cmdline); + result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", getSystemVMKeyFile(), null, cmdline.toString()); if (!result.first()) { s_logger.error("check site-to-site vpn connections command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + " failed, message: " @@ -833,13 +818,23 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S if (s_logger.isInfoEnabled()) { s_logger.info("Executing deleteIpAlias command: " + s_gson.toJson(cmd)); } - String args = ""; + StringBuilder args = new StringBuilder(); for (IpAliasTO ipAliasTO : revokedIpAliasTOs) { - args = args + ipAliasTO.getAlias_count() + ":" + ipAliasTO.getRouterip() + ":" + ipAliasTO.getNetmask() + "-"; + args.append(ipAliasTO.getAlias_count()); + args.append(":"); + args.append(ipAliasTO.getRouterip()); + args.append(":"); + args.append(ipAliasTO.getNetmask()); + args.append("-"); } - args = args + "- "; + args.append("- "); for (IpAliasTO ipAliasTO : activeIpAliasTOs) { - args = args + ipAliasTO.getAlias_count() + ":" + ipAliasTO.getRouterip() + ":" + ipAliasTO.getNetmask() + "-"; + args.append(ipAliasTO.getAlias_count()); + args.append(":"); + args.append(ipAliasTO.getRouterip()); + args.append(":"); + args.append(ipAliasTO.getNetmask()); + args.append("-"); } if (s_logger.isDebugEnabled()) { s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/deleteIpAlias " + args); @@ -887,14 +882,14 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S String[][] rules = cfgtr.generateFwRules(cmd); String tmpCfgFilePath = "/tmp/" + routerIp.replace('.', '_') + ".cfg"; - String tmpCfgFileContents = ""; + StringBuilder tmpCfgFileContents = new StringBuilder(); for (int i = 0; i < config.length; i++) { - tmpCfgFileContents += config[i]; - tmpCfgFileContents += "\n"; + tmpCfgFileContents.append(config[i]); + tmpCfgFileContents.append("\n"); } try { - SshHelper.scpTo(controlIp, DEFAULT_DOMR_SSHPORT, "root", keyFile, null, "/tmp/", tmpCfgFileContents.getBytes(), routerIp.replace('.', '_') + ".cfg", null); + SshHelper.scpTo(controlIp, DEFAULT_DOMR_SSHPORT, "root", keyFile, null, "/tmp/", tmpCfgFileContents.toString().getBytes(), routerIp.replace('.', '_') + ".cfg", null); try { String[] addRules = rules[LoadBalancerConfigurator.ADD]; @@ -1076,7 +1071,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S } catch (Throwable e) { s_logger.error("SetFirewallRulesCommand(args: " + args + ") failed on setting one rule due to " - ,e); + ,e); //FIXME - in the future we have to process each rule separately; now we temporarily set every rule to be false if single rule fails for (int i=0; i < results.length; i++) { results[i] = "Failed"; @@ -1229,9 +1224,14 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S } cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); List ipAliasTOs = cmd.getIpAliasList(); - String args=""; + StringBuilder args = new StringBuilder(); for (IpAliasTO ipaliasto : ipAliasTOs) { - args = args + ipaliasto.getAlias_count()+":"+ipaliasto.getRouterip()+":"+ipaliasto.getNetmask()+"-"; + args.append(ipaliasto.getAlias_count()); + args.append(":"); + args.append(ipaliasto.getRouterip()); + args.append(":"); + args.append(ipaliasto.getNetmask()); + args.append("-"); } if (s_logger.isDebugEnabled()) { s_logger.debug("Run command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + ", /root/createIpAlias " + args); @@ -1271,9 +1271,16 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S assert(controlIp != null); List dhcpTos = cmd.getIps(); - String args =""; + StringBuilder args = new StringBuilder(); for(DhcpTO dhcpTo : dhcpTos) { - args = args + dhcpTo.getRouterIp()+":"+dhcpTo.getGateway()+":"+dhcpTo.getNetmask()+":"+dhcpTo.getStartIpOfSubnet()+"-"; + args.append(dhcpTo.getRouterIp()); + args.append(":"); + args.append(dhcpTo.getGateway()); + args.append(":"); + args.append(dhcpTo.getNetmask()); + args.append(":"); + args.append(dhcpTo.getStartIpOfSubnet()); + args.append("-"); } try { @@ -1320,7 +1327,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S for (; i < cmd.getIpAddresses().length; i++) { results[i++] = IpAssocAnswer.errorResult; } - } catch (Throwable e) { + } catch (Throwable e) { s_logger.error("Unexpected exception: " + e.toString() + " will shortcut rest of IPAssoc commands", e); for (; i < cmd.getIpAddresses().length; i++) { @@ -1335,14 +1342,12 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S final boolean sourceNat, final String vlanId, final String vlanGateway, final String vlanNetmask, final String vifMacAddress) throws Exception { boolean addVif = false; - boolean removeVif = false; if (add) { if (s_logger.isDebugEnabled()) { s_logger.debug("Plug new NIC to associate" + privateIpAddress + " to " + publicIpAddress); } addVif = true; } else if (!add && firstIP) { - removeVif = true; } String args = null; @@ -1448,7 +1453,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S s_logger.info("Executing resource NetworkUsageCommand "+ s_gson.toJson(cmd)); } if(cmd.getOption()!=null && cmd.getOption().equals("create") ){ - String result = networkUsage(cmd.getPrivateIP(), "create", null); + networkUsage(cmd.getPrivateIP(), "create", null); NetworkUsageAnswer answer = new NetworkUsageAnswer(cmd, "true", 0L, 0L); return answer; } @@ -1594,7 +1599,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S // Unsupported commands will not route. if (response.getStatusLine().getStatusCode() - == HttpStatus.SC_NOT_FOUND) { + == HttpStatus.SC_NOT_FOUND) { String errMsg = "Failed to send : HTTP error code : " + response.getStatusLine().getStatusCode(); @@ -1608,11 +1613,11 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S s_logger.error(ans); result = s_gson.toJson(new Answer[] {ans}); } else if (response.getStatusLine().getStatusCode() - != HttpStatus.SC_OK) { + != HttpStatus.SC_OK) { String errMsg = "Failed send to " + agentUri.toString() - + " : HTTP error code : " - + response.getStatusLine().getStatusCode(); + + " : HTTP error code : " + + response.getStatusLine().getStatusCode(); s_logger.error(errMsg); return null; } else { @@ -1707,7 +1712,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S sch.configureBlocking(true); sch.socket().setSoTimeout(5000); // we need to connect to the public ip address to check the status of the VM -/* + /* InetSocketAddress addr = new InetSocketAddress(ipAddress, port); sch.connect(addr);*/ return null; From b736cbd27a3e16011079061cb2ed3136d9a547f7 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 7 Nov 2013 14:57:40 +0100 Subject: [PATCH 053/108] Fix CID 1127024 Various resource leaks --- .../cloud/upgrade/dao/Upgrade420to421.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java index d37c0a1a2c4..d7eccc15efc 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade420to421.java @@ -108,7 +108,15 @@ public class Upgrade420to421 implements DbUpgrade { } catch (SQLException e) { throw new CloudRuntimeException("Unable to update cpu/memory overprovisioning factors", e); } finally { - + try { + if (pstmt1 != null) + pstmt1.close(); + if (pstmt2 != null) + pstmt2.close(); + if (pstmt3 != null) + pstmt3.close(); + } catch (SQLException e) { + } } } @@ -131,9 +139,9 @@ public class Upgrade420to421 implements DbUpgrade { long domain_id = rsAccount.getLong(2); // 1. update cpu,memory for all accounts pstmt2 = conn.prepareStatement( "SELECT SUM(service_offering.cpu), SUM(service_offering.ram_size)" + - " FROM `cloud`.`vm_instance`, `cloud`.`service_offering`" + - " WHERE vm_instance.service_offering_id = service_offering.id AND vm_instance.account_id = ?" + " AND vm_instance.removed is NULL" + - " AND vm_instance.vm_type='User' AND state not in ('Destroyed', 'Error', 'Expunging')"); + " FROM `cloud`.`vm_instance`, `cloud`.`service_offering`" + + " WHERE vm_instance.service_offering_id = service_offering.id AND vm_instance.account_id = ?" + " AND vm_instance.removed is NULL" + + " AND vm_instance.vm_type='User' AND state not in ('Destroyed', 'Error', 'Expunging')"); pstmt2.setLong(1, account_id); rsCount = pstmt2.executeQuery(); if (rsCount.next()) { @@ -172,7 +180,7 @@ public class Upgrade420to421 implements DbUpgrade { totalSnapshotsSize = rsCount.getLong(1); } pstmt4 = conn.prepareStatement("SELECT sum(template_store_ref.size) FROM `cloud`.`template_store_ref`,`cloud`.`vm_template` WHERE account_id = ?" + - " AND template_store_ref.template_id = vm_template.id AND download_state = 'DOWNLOADED' AND destroyed = false AND removed is NULL"); + " AND template_store_ref.template_id = vm_template.id AND download_state = 'DOWNLOADED' AND destroyed = false AND removed is NULL"); pstmt4.setLong(1, account_id); rsCount = pstmt4.executeQuery(); if (rsCount.next()) { @@ -248,7 +256,7 @@ public class Upgrade420to421 implements DbUpgrade { pstmt.executeUpdate(); pstmt.close(); } - + private static void upgradeResourceCountforDomain(Connection conn, Long domain_id, String type, Long resource_count) throws SQLException { //update or insert into resource_count table. PreparedStatement pstmt = null; From f00bfea61eea50d5d9d7669705a934e33f306f64 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 7 Nov 2013 14:59:03 +0100 Subject: [PATCH 054/108] Fix CID 1127030, 1127029 Questionable Boxing of primitive value Fix CID 1127028 Fix Inefficient Map Iterator Fix bug. --- server/src/com/cloud/vm/UserVmManagerImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 2d537bf5f97..ca10b06d768 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -23,6 +23,7 @@ import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.UUID; import java.util.concurrent.Executors; @@ -2282,7 +2283,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir throw new InvalidParameterValueException("Only support one network per VM if security group enabled"); } - NetworkVO network = _networkDao.findById(networkIdList.get(0).longValue()); + NetworkVO network = _networkDao.findById(networkIdList.get(0)); if (network == null) { throw new InvalidParameterValueException( @@ -2549,7 +2550,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, (isIso || diskOfferingId == null ? 1 : 2)); - _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, new Long (size)); + _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, size); // verify security group ids if (securityGroupIdList != null) { @@ -2811,14 +2812,13 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir } } - for (String ntwkDomain : ntwkDomains.keySet()) { - for (Long ntwkId : ntwkDomains.get(ntwkDomain)) { + for (Entry> ntwkDomain : ntwkDomains.entrySet()) { + for (Long ntwkId : ntwkDomain.getValue()) { // * get all vms hostNames in the network List hostNames = _vmInstanceDao.listDistinctHostNames(ntwkId); // * verify that there are no duplicates if (hostNames.contains(hostName)) { - throw new InvalidParameterValueException("The vm with hostName " + hostName - + " already exists in the network domain: " + ntwkDomain + "; network=" + throw new InvalidParameterValueException("The vm with hostName " + hostName + " already exists in the network domain: " + ntwkDomain.getKey() + "; network=" + _networkModel.getNetwork(ntwkId)); } } From 831eeeb42234bc7d87381dcea5afb7d7f664d372 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 7 Nov 2013 14:59:43 +0100 Subject: [PATCH 055/108] Fix CID 1127031 Inefficient Map iterator --- server/src/com/cloud/network/vpc/VpcManagerImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index 11cbd95cbb4..017d38df3bb 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -22,6 +22,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -351,16 +352,16 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis svcProviderMap.put(Service.Gateway, defaultProviders); if (serviceProviders != null) { - for (String serviceStr : serviceProviders.keySet()) { - Network.Service service = Network.Service.getService(serviceStr); + for (Entry> serviceEntry : serviceProviders.entrySet()) { + Network.Service service = Network.Service.getService(serviceEntry.getKey()); if (svcProviderMap.containsKey(service)) { Set providers = new HashSet(); // don't allow to specify more than 1 provider per service - if (serviceProviders.get(serviceStr) != null && serviceProviders.get(serviceStr).size() > 1) { + if (serviceEntry.getValue() != null && serviceEntry.getValue().size() > 1) { throw new InvalidParameterValueException("In the current release only one provider can be " + "specified for the service"); } - for (String prvNameStr : serviceProviders.get(serviceStr)) { + for (String prvNameStr : serviceEntry.getValue()) { // check if provider is supported Network.Provider provider = Network.Provider.getProvider(prvNameStr); if (provider == null) { @@ -371,7 +372,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis } svcProviderMap.put(service, providers); } else { - throw new InvalidParameterValueException("Service " + serviceStr + " is not enabled for the network " + + throw new InvalidParameterValueException("Service " + serviceEntry.getKey() + " is not enabled for the network " + "offering, can't add a provider to it"); } } From 85f38b3e07bf6bb0419392f2b4d4438c796327f9 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 7 Nov 2013 15:01:21 +0100 Subject: [PATCH 056/108] Fix CID 1127051 DLS: Dead local store Fix CID 1127050 WMI: Inefficient Map iterator --- .../ConfigurationManagerImpl.java | 123 +++++++++--------- 1 file changed, 61 insertions(+), 62 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index e4bbe8e5bf7..c3a196f0a63 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -28,6 +28,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.UUID; @@ -35,6 +36,8 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; +import org.apache.log4j.Logger; + import org.apache.cloudstack.acl.SecurityChecker; import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.affinity.AffinityGroupService; @@ -79,10 +82,8 @@ import org.apache.cloudstack.region.Region; import org.apache.cloudstack.region.RegionVO; import org.apache.cloudstack.region.dao.RegionDao; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; -import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailVO; import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; -import org.apache.log4j.Logger; import com.cloud.alert.AlertManager; import com.cloud.api.ApiDBUtils; @@ -95,7 +96,6 @@ import com.cloud.dc.ClusterDetailsVO; import com.cloud.dc.ClusterVO; import com.cloud.dc.DataCenter; import com.cloud.dc.DataCenter.NetworkType; -import com.cloud.dc.DataCenterDetailVO; import com.cloud.dc.DataCenterIpAddressVO; import com.cloud.dc.DataCenterLinkLocalIpAddressVO; import com.cloud.dc.DataCenterVO; @@ -207,7 +207,7 @@ import com.cloud.vm.dao.NicSecondaryIpDao; @Local(value = { ConfigurationManager.class, ConfigurationService.class }) public class - ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, ConfigurationService { +ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, ConfigurationService { public static final Logger s_logger = Logger.getLogger(ConfigurationManagerImpl.class); @Inject @@ -407,16 +407,16 @@ public class _alertMgr.sendAlert(AlertManager.ALERT_TYPE_MANAGMENT_NODE, 0, new Long(0), "Management network CIDR is not configured originally. Set it default to " + localCidrs[0], ""); _configDao - .update(Config.ManagementNetwork.key(), Config.ManagementNetwork.getCategory(), localCidrs[0]); + .update(Config.ManagementNetwork.key(), Config.ManagementNetwork.getCategory(), localCidrs[0]); } else { s_logger.warn("Management network CIDR is not properly configured and we are not able to find a default setting"); _alertMgr - .sendAlert( - AlertManager.ALERT_TYPE_MANAGMENT_NODE, - 0, - new Long(0), - "Management network CIDR is not properly configured and we are not able to find a default setting", - ""); + .sendAlert( + AlertManager.ALERT_TYPE_MANAGMENT_NODE, + 0, + new Long(0), + "Management network CIDR is not properly configured and we are not able to find a default setting", + ""); } } @@ -475,7 +475,7 @@ public class throw new InvalidParameterValueException("unable to find storage pool by id " + resourceId); } _storagePoolDetailsDao.addDetail(resourceId, name, value); - + break; case Account: @@ -1200,7 +1200,7 @@ public class _capacityDao.updateCapacityState(null, pod.getId(), null, null, allocationStateStrFinal); pod.setAllocationState(allocationState); } - + _podDao.update(id, pod); } }); @@ -1679,8 +1679,8 @@ public class boolean checkForDuplicates = !zoneName.equals(oldZoneName); checkZoneParameters(zoneName, dns1, dns2, internalDns1, internalDns2, checkForDuplicates, null, allocationStateStr, ip6Dns1, ip6Dns2);// not allowing updating - // domain associated with - // a zone, once created + // domain associated with + // a zone, once created zone.setName(zoneName); zone.setDns1(dns1); @@ -1712,10 +1712,10 @@ public class } updatedDetails.putAll(newDetails); zone.setDetails(updatedDetails); - + if (allocationStateStr != null && !allocationStateStr.isEmpty()) { Grouping.AllocationState allocationState = Grouping.AllocationState.valueOf(allocationStateStr); - + if (allocationState == Grouping.AllocationState.Enabled) { // check if zone has necessary trafficTypes before enabling try { @@ -1729,7 +1729,7 @@ public class // network with public Thpe _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Public); } - + try { _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Storage); } catch (InvalidParameterValueException noStorage) { @@ -1976,7 +1976,7 @@ public class return createZone(userId, zoneName, dns1, dns2, internalDns1, internalDns2, guestCidr, domainVO != null ? domainVO.getName() : null, domainId, zoneType, allocationState, networkDomain, - isSecurityGroupEnabled, isLocalStorageEnabled, ip6Dns1, ip6Dns2); + isSecurityGroupEnabled, isLocalStorageEnabled, ip6Dns1, ip6Dns2); } @Override @@ -1999,7 +1999,6 @@ public class Integer cpuNumber = cmd.getCpuNumber(); Integer cpuSpeed = cmd.getCpuSpeed(); Integer memory = cmd.getMemory(); - boolean customized = cmd.getCustomized(); if ((cpuNumber != null) && ((cpuNumber.intValue() <=0) || (cpuNumber.intValue() > 2147483647))) { throw new InvalidParameterValueException("Failed to create service offering " + name @@ -2101,10 +2100,10 @@ public class if ((offering = _serviceOfferingDao.persist(offering)) != null) { if (details != null) { List detailsVO = new ArrayList(); - for (String key : details.keySet()) { - detailsVO.add(new ServiceOfferingDetailsVO(offering.getId(), key, details.get(key))); + for (Entry detailEntry : details.entrySet()) { + detailsVO.add(new ServiceOfferingDetailsVO(offering.getId(), detailEntry.getKey(), detailEntry.getValue())); } - + _serviceOfferingDetailsDao.saveDetails(detailsVO); } CallContext.current().setEventDetails("Service offering id=" + offering.getId()); @@ -2187,8 +2186,8 @@ public class } protected DiskOfferingVO createDiskOffering(Long domainId, String name, String description, Long numGibibytes, String tags, boolean isCustomized, - boolean localStorageRequired, boolean isDisplayOfferingEnabled, Boolean isCustomizedIops, Long minIops, Long maxIops, - Long bytesReadRate, Long bytesWriteRate, Long iopsReadRate, Long iopsWriteRate, Integer hypervisorSnapshotReserve) { + boolean localStorageRequired, boolean isDisplayOfferingEnabled, Boolean isCustomizedIops, Long minIops, Long maxIops, + Long bytesReadRate, Long bytesWriteRate, Long iopsReadRate, Long iopsWriteRate, Integer hypervisorSnapshotReserve) { long diskSize = 0;// special case for custom disk offerings if (numGibibytes != null && (numGibibytes <= 0)) { throw new InvalidParameterValueException("Please specify a disk size of at least 1 Gb."); @@ -2211,8 +2210,8 @@ public class iopsWriteRate = null; if (isCustomizedIops) { - minIops = null; - maxIops = null; + minIops = null; + maxIops = null; } else { if (minIops == null && maxIops == null) { @@ -2220,17 +2219,17 @@ public class maxIops = 0L; } else { - if (minIops == null || minIops <= 0) { - throw new InvalidParameterValueException("The min IOPS must be greater than 0."); - } + if (minIops == null || minIops <= 0) { + throw new InvalidParameterValueException("The min IOPS must be greater than 0."); + } - if (maxIops == null) { - maxIops = 0L; - } + if (maxIops == null) { + maxIops = 0L; + } - if (minIops > maxIops) { - throw new InvalidParameterValueException("The min IOPS must be less than or equal to the max IOPS."); - } + if (minIops > maxIops) { + throw new InvalidParameterValueException("The min IOPS must be less than or equal to the max IOPS."); + } } } } @@ -2241,7 +2240,7 @@ public class tags = StringUtils.cleanupTags(tags); DiskOfferingVO newDiskOffering = new DiskOfferingVO(domainId, name, description, diskSize, tags, isCustomized, - isCustomizedIops, minIops, maxIops); + isCustomizedIops, minIops, maxIops); newDiskOffering.setUseLocalStorage(localStorageRequired); newDiskOffering.setDisplayOffering(isDisplayOfferingEnabled); @@ -2278,8 +2277,8 @@ public class Long numGibibytes = cmd.getDiskSize(); boolean isDisplayOfferingEnabled = cmd.getDisplayOffering() != null ? cmd.getDisplayOffering() : true; boolean isCustomized = cmd.isCustomized() != null ? cmd.isCustomized() : false; // false - // by - // default + // by + // default String tags = cmd.getTags(); // Long domainId = cmd.getDomainId() != null ? cmd.getDomainId() : // Long.valueOf(DomainVO.ROOT_DOMAIN); // disk offering @@ -2441,9 +2440,9 @@ public class @Override @DB @ActionEvent(eventType = EventTypes.EVENT_VLAN_IP_RANGE_CREATE, eventDescription = "creating vlan ip range", - async = false) + async = false) public Vlan createVlanAndPublicIpRange(CreateVlanIpRangeCmd cmd) throws InsufficientCapacityException, - ConcurrentOperationException, ResourceUnavailableException, ResourceAllocationException { + ConcurrentOperationException, ResourceUnavailableException, ResourceAllocationException { Long zoneId = cmd.getZoneId(); Long podId = cmd.getPodId(); String startIP = cmd.getStartIp(); @@ -2453,8 +2452,8 @@ public class String vlanId = cmd.getVlan(); // TODO decide if we should be forgiving or demand a valid and complete URI if (!((vlanId == null) - || ("".equals(vlanId)) - || vlanId.startsWith(BroadcastDomainType.Vlan.scheme()))) + || ("".equals(vlanId)) + || vlanId.startsWith(BroadcastDomainType.Vlan.scheme()))) vlanId = BroadcastDomainType.Vlan.toUri(vlanId).toString(); Boolean forVirtualNetwork = cmd.isForVirtualNetwork(); Long networkId = cmd.getNetworkID(); @@ -2690,12 +2689,12 @@ public class public Vlan doInTransaction(TransactionStatus status) { String newVlanNetmask = newVlanNetmaskFinal; String newVlanGateway = newVlanGatewayFinal; - + if ((sameSubnet == null || sameSubnet.first() == false) && (network.getTrafficType()== TrafficType.Guest) && (network.getGuestType() == GuestType.Shared) && (_vlanDao.listVlansByNetworkId(networkId) != null)) { Map dhcpCapabilities = _networkSvc.getNetworkOfferingServiceCapabilities(_networkOfferingDao.findById(network.getNetworkOfferingId()), Service.Dhcp); String supportsMultipleSubnets = dhcpCapabilities.get(Capability.DhcpAccrossMultipleSubnets); if (supportsMultipleSubnets == null || !Boolean.valueOf(supportsMultipleSubnets)) { - throw new InvalidParameterValueException("The Dhcp serivice provider for this network dose not support the dhcp across multiple subnets"); + throw new InvalidParameterValueException("The Dhcp serivice provider for this network dose not support the dhcp across multiple subnets"); } s_logger.info("adding a new subnet to the network " + network.getId()); } else if (sameSubnet != null) { @@ -2776,7 +2775,7 @@ public class sameSubnet = true; //check if the gateway provided by the user is same as that of the subnet. if (newVlanGateway != null && !newVlanGateway.equals(vlanGateway)) { - throw new InvalidParameterValueException("The gateway of the subnet should be unique. The subnet alreaddy has a gateway "+ vlanGateway); + throw new InvalidParameterValueException("The gateway of the subnet should be unique. The subnet alreaddy has a gateway "+ vlanGateway); } break; } @@ -2982,7 +2981,7 @@ public class throw new InvalidParameterValueException("This subnet is overlapped with subnet in other network " + vlan.getNetworkId() + " in zone " + zone.getName() + " . Please specify a different gateway/netmask."); - + } String[] otherVlanIpRange = vlan.getIpRange().split("\\-"); String otherVlanStartIP = otherVlanIpRange[0]; @@ -2999,7 +2998,7 @@ public class } if (NetUtils.ipRangesOverlap(startIP, endIP, otherVlanStartIP, otherVlanEndIP)) { throw new InvalidParameterValueException("The IP range already has IPs that overlap with the new range." + - " Please specify a different start IP/end IP."); + " Please specify a different start IP/end IP."); } } } @@ -3202,7 +3201,7 @@ public class @Override @DB @ActionEvent(eventType = EventTypes.EVENT_VLAN_IP_RANGE_DEDICATE, eventDescription = "dedicating vlan ip range", - async = false) + async = false) public Vlan dedicatePublicIpRange(DedicatePublicIpRangeCmd cmd) throws ResourceAllocationException { Long vlanDbId = cmd.getId(); String accountName = cmd.getAccountName(); @@ -3291,7 +3290,7 @@ public class @Override @ActionEvent(eventType = EventTypes.EVENT_VLAN_IP_RANGE_RELEASE, eventDescription = "releasing a public ip range", - async = false) + async = false) public boolean releasePublicIpRange(ReleasePublicIpRangeCmd cmd) { Long vlanDbId = cmd.getId(); @@ -3425,7 +3424,7 @@ public class } private void checkConflictsWithPortableIpRange(long zoneId, String vlanId, String vlanGateway, String vlanNetmask, - String startIP, String endIP) { + String startIP, String endIP) { // check and throw exception if there is portable IP range that overlaps with public ip range being configured if (checkOverlapPortableIpRange(_regionDao.getRegionId(), startIP, endIP)) { throw new InvalidParameterValueException("Ip range: " + startIP + "-" + endIP @@ -3549,7 +3548,7 @@ public class if (podName.equals("newPod")) { throw new InvalidParameterValueException( "The subnet of the pod you are adding conflicts with the subnet of pod " + otherPodName - + " in zone " + zoneName + ". Please specify a different CIDR."); + + " in zone " + zoneName + ". Please specify a different CIDR."); } else { throw new InvalidParameterValueException("Warning: The pods " + podName + " and " + otherPodName + " in zone " + zoneName @@ -3610,7 +3609,7 @@ public class @Override @ActionEvent(eventType = EventTypes.EVENT_VLAN_IP_RANGE_DELETE, eventDescription = "deleting vlan ip range", - async = false) + async = false) public boolean deleteVlanIpRange(DeleteVlanIpRangeCmd cmd) { Long vlanDbId = cmd.getId(); @@ -3802,7 +3801,7 @@ public class if (provider == Provider.PaloAlto) { firewallProvider = Provider.PaloAlto; } - + if ((service == Service.PortForwarding || service == Service.StaticNat) && provider == Provider.VirtualRouter) { firewallProvider = Provider.VirtualRouter; @@ -3840,7 +3839,7 @@ public class "Capabilities for LB service can be specifed only when LB service is enabled for network offering."); } validateLoadBalancerServiceCapabilities(lbServiceCapabilityMap); - + if (lbServiceCapabilityMap != null && !lbServiceCapabilityMap.isEmpty()) { maxconn = cmd.getMaxconnections(); if (maxconn == null) { @@ -3850,7 +3849,7 @@ public class if(cmd.getKeepAliveEnabled() != null && cmd.getKeepAliveEnabled()) { enableKeepAlive = true; } - + // validate the Source NAT service capabilities specified in the network // offering Map sourceNatServiceCapabilityMap = cmd.getServiceCapabilities(Service.SourceNat); @@ -4164,7 +4163,7 @@ public class } } } - + if (serviceProviderMap != null && serviceProviderMap.containsKey(Service.Lb) && !internalLb && !publicLb) { //if not specified, default public lb to true publicLb = true; @@ -4626,7 +4625,7 @@ public class } if (_ntwkOffServiceMapDao.areServicesSupportedByNetworkOffering(offering.getId(), Service.Lb)){ if (maxconn != null) { - offering.setConcurrentConnections(maxconn); + offering.setConcurrentConnections(maxconn); } } @@ -4845,7 +4844,7 @@ public class @Override @DB @ActionEvent(eventType = EventTypes.EVENT_PORTABLE_IP_RANGE_CREATE, - eventDescription = "creating portable ip range", async = false) + eventDescription = "creating portable ip range", async = false) public PortableIpRange createPortableIpRange(CreatePortableIpRangeCmd cmd) throws ConcurrentOperationException { final Integer regionId = cmd.getRegionId(); final String startIP = cmd.getStartIp(); @@ -4920,7 +4919,7 @@ public class // implicitly enable portable IP service for the region region.setPortableipEnabled(true); _regionDao.update(region.getId(), region); - + return portableIpRange; } }); @@ -4932,7 +4931,7 @@ public class @Override @DB @ActionEvent(eventType = EventTypes.EVENT_PORTABLE_IP_RANGE_DELETE, - eventDescription = "deleting portable ip range", async = false) + eventDescription = "deleting portable ip range", async = false) public boolean deletePortableIpRange(DeletePortableIpRangeCmd cmd) { long rangeId = cmd.getId(); @@ -5032,7 +5031,7 @@ public class @Inject public void setSecChecker(List secChecker) { - this._secChecker = secChecker; + _secChecker = secChecker; } From 3f5b8f70630e8415a611984ccde2e1f631e96bc9 Mon Sep 17 00:00:00 2001 From: Kishan Kavala Date: Thu, 7 Nov 2013 19:42:19 +0530 Subject: [PATCH 057/108] CLOUDSTACK-4793 : Added UpgradeRouterTemplate API. Added filters to listRouters API. listRouters response includes verion and required upgrade flag. Min VR version is checked before sending commands to router --- .../VirtualNetworkApplianceService.java | 6 + .../cloud/network/router/VirtualRouter.java | 1 + .../apache/cloudstack/api/ApiConstants.java | 1 + .../cloudstack/api/ResponseGenerator.java | 4 + .../command/admin/router/ListRoutersCmd.java | 11 +- .../router/UpgradeRouterTemplateCmd.java | 143 ++++++++++++++++++ .../api/response/DomainRouterResponse.java | 23 ++- .../UpgradeRouterTemplateResponse.java | 45 ++++++ client/tomcatconf/commands.properties.in | 1 + .../src/com/cloud/vm/dao/DomainRouterDao.java | 3 +- .../com/cloud/vm/dao/DomainRouterDaoImpl.java | 7 + .../src/com/cloud/api/ApiResponseHelper.java | 17 +++ .../com/cloud/api/query/QueryManagerImpl.java | 12 +- .../cloud/api/query/ViewResponseHelper.java | 2 + .../query/dao/DomainRouterJoinDaoImpl.java | 7 + .../VirtualNetworkApplianceManagerImpl.java | 109 ++++++++++++- .../cloud/server/ManagementServerImpl.java | 2 + ...MockVpcVirtualNetworkApplianceManager.java | 7 +- utils/src/com/cloud/maint/Version.java | 8 + 19 files changed, 394 insertions(+), 15 deletions(-) create mode 100644 api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterTemplateCmd.java create mode 100644 api/src/org/apache/cloudstack/api/response/UpgradeRouterTemplateResponse.java diff --git a/api/src/com/cloud/network/VirtualNetworkApplianceService.java b/api/src/com/cloud/network/VirtualNetworkApplianceService.java index 58eead2af07..fb5d12aed99 100644 --- a/api/src/com/cloud/network/VirtualNetworkApplianceService.java +++ b/api/src/com/cloud/network/VirtualNetworkApplianceService.java @@ -23,6 +23,9 @@ import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.router.VirtualRouter; import com.cloud.user.Account; +import org.apache.cloudstack.api.command.admin.router.UpgradeRouterTemplateCmd; + +import java.util.List; public interface VirtualNetworkApplianceService { /** @@ -66,4 +69,7 @@ public interface VirtualNetworkApplianceService { VirtualRouter findRouter(long routerId); + List upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd); + + public static final String _minVRVersion = "4.2.0"; } diff --git a/api/src/com/cloud/network/router/VirtualRouter.java b/api/src/com/cloud/network/router/VirtualRouter.java index 9e90e8e262f..a87521876fc 100755 --- a/api/src/com/cloud/network/router/VirtualRouter.java +++ b/api/src/com/cloud/network/router/VirtualRouter.java @@ -41,4 +41,5 @@ public interface VirtualRouter extends VirtualMachine { * @return */ Long getVpcId(); + String getTemplateVersion(); } diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 20e848db287..bd525937ce7 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -528,6 +528,7 @@ public class ApiConstants { public static final String EXPUNGE = "expunge"; public static final String FOR_DISPLAY = "fordisplay"; public static final String PASSIVE = "passive"; + public static final String VERSION = "version"; public enum HostDetails { all, capacity, events, stats, min; diff --git a/api/src/org/apache/cloudstack/api/ResponseGenerator.java b/api/src/org/apache/cloudstack/api/ResponseGenerator.java index a8de31d8c2d..832f6e3a010 100644 --- a/api/src/org/apache/cloudstack/api/ResponseGenerator.java +++ b/api/src/org/apache/cloudstack/api/ResponseGenerator.java @@ -60,6 +60,7 @@ import org.apache.cloudstack.api.response.IpForwardingRuleResponse; import org.apache.cloudstack.api.response.IsolationMethodResponse; import org.apache.cloudstack.api.response.LBHealthCheckResponse; import org.apache.cloudstack.api.response.LBStickinessResponse; +import org.apache.cloudstack.api.response.ListResponse; import org.apache.cloudstack.api.response.LoadBalancerResponse; import org.apache.cloudstack.api.response.NetworkACLItemResponse; import org.apache.cloudstack.api.response.NetworkACLResponse; @@ -99,6 +100,7 @@ import org.apache.cloudstack.api.response.TemplatePermissionsResponse; import org.apache.cloudstack.api.response.TemplateResponse; import org.apache.cloudstack.api.response.TrafficMonitorResponse; import org.apache.cloudstack.api.response.TrafficTypeResponse; +import org.apache.cloudstack.api.response.UpgradeRouterTemplateResponse; import org.apache.cloudstack.api.response.UsageRecordResponse; import org.apache.cloudstack.api.response.UserResponse; import org.apache.cloudstack.api.response.UserVmResponse; @@ -446,4 +448,6 @@ public interface ResponseGenerator { IsolationMethodResponse createIsolationMethodResponse(IsolationType method); + ListResponse createUpgradeRouterTemplateResponse(List jobIds); + } diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java index d7f59b96e63..2752a13b176 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java @@ -75,7 +75,10 @@ public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd { @Parameter(name=ApiConstants.FOR_VPC, type=CommandType.BOOLEAN, description="if true is passed for this parameter, list only VPC routers") private Boolean forVpc; - + + @Parameter(name=ApiConstants.VERSION, type=CommandType.STRING, description="list virtual router elements by version") + private String version; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -115,7 +118,11 @@ public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd { public Boolean getForVpc() { return forVpc; } - + + public String getVersion() { + return version; + } + public String getRole() { return Role.VIRTUAL_ROUTER.toString(); } diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterTemplateCmd.java new file mode 100644 index 00000000000..1db22bc0842 --- /dev/null +++ b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterTemplateCmd.java @@ -0,0 +1,143 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.admin.router; + + +import com.cloud.event.EventTypes; +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.network.router.VirtualRouter; +import com.cloud.user.Account; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiCommandJobType; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseResponse; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.AccountResponse; +import org.apache.cloudstack.api.response.ClusterResponse; +import org.apache.cloudstack.api.response.DomainResponse; +import org.apache.cloudstack.api.response.DomainRouterResponse; +import org.apache.cloudstack.api.response.ListResponse; +import org.apache.cloudstack.api.response.PodResponse; +import org.apache.cloudstack.api.response.SuccessResponse; +import org.apache.cloudstack.api.response.UpgradeRouterTemplateResponse; +import org.apache.cloudstack.api.response.ZoneResponse; +import org.apache.cloudstack.context.CallContext; + +import java.util.List; +import java.util.logging.Logger; + +@APICommand(name = "upgradeRouterTemplate", description="Upgrades router to use newer template", responseObject=BaseResponse.class) +public class UpgradeRouterTemplateCmd extends org.apache.cloudstack.api.BaseCmd { + public static final Logger s_logger = Logger.getLogger(UpgradeRouterTemplateCmd.class.getName()); + private static final String s_name = "upgraderoutertemplateresponse"; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name= ApiConstants.ID, type=CommandType.UUID, entityType = DomainRouterResponse.class, + description="upgrades router with the specified Id") + private Long id; + + @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType= ClusterResponse.class, + description="upgrades all routers within the specified cluster") + private Long clusterId; + + @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class, + description="upgrades all routers within the specified pod") + private Long podId; + + @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class, + description="upgrades all routers within the specified zone") + private Long zoneId; + + @Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType = AccountResponse.class, + description="upgrades all routers owned by the specified account") + private Long accountId; + + @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class, + description="upgrades all routers owned by the specified domain") + private Long domainId; + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getId() { + return id; + } + + public Long getClusterId() { + return clusterId; + } + + public Long getPodId() { + return podId; + } + + public Long getZoneId() { + return zoneId; + } + + public Long getAccountId() { + return accountId; + } + + public Long getDomainId() { + return domainId; + } + + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked + } + + public ApiCommandJobType getInstanceType() { + return ApiCommandJobType.DomainRouter; + } + + public Long getInstanceId() { + return getId(); + } + + @Override + public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { + CallContext.current().setEventDetails("Upgrading router template"); + List result = _routerService.upgradeRouterTemplate(this); + if (result != null){ + ListResponse response = _responseGenerator.createUpgradeRouterTemplateResponse(result); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to upgrade router template"); + } + } +} diff --git a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java b/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java index 1d31b58a481..5ea28b95a2a 100644 --- a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java +++ b/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java @@ -144,8 +144,8 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView @SerializedName("redundantstate") @Param(description="the state of redundant virtual router") private String redundantState; - @SerializedName("templateversion") @Param(description="the version of template") - private String templateVersion; + @SerializedName("version") @Param(description="the version of template") + private String version; @SerializedName("scriptsversion") @Param(description="the version of scripts") private String scriptsVersion; @@ -160,6 +160,9 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView responseObject = NicResponse.class, since="4.0") private Set nics; + @SerializedName("requiresupgrade") @Param(description="true if the router template requires upgrader") + private boolean requiresUpgrade; + public DomainRouterResponse(){ nics = new LinkedHashSet(); } @@ -308,12 +311,12 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView this.isRedundantRouter = isRedundantRouter; } - public String getTemplateVersion() { - return this.templateVersion; + public String getVersion() { + return this.version; } - public void setTemplateVersion(String templateVersion) { - this.templateVersion = templateVersion; + public void setVersion(String version) { + this.version = version; } public String getScriptsVersion() { @@ -364,4 +367,12 @@ public class DomainRouterResponse extends BaseResponse implements ControlledView public void setRole(String role) { this.role = role; } + + public boolean requiresUpgrade() { + return requiresUpgrade; + } + + public void setRequiresUpgrade(boolean requiresUpgrade) { + this.requiresUpgrade = requiresUpgrade; + } } diff --git a/api/src/org/apache/cloudstack/api/response/UpgradeRouterTemplateResponse.java b/api/src/org/apache/cloudstack/api/response/UpgradeRouterTemplateResponse.java new file mode 100644 index 00000000000..ba0049bbaa1 --- /dev/null +++ b/api/src/org/apache/cloudstack/api/response/UpgradeRouterTemplateResponse.java @@ -0,0 +1,45 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.response; + +import com.cloud.serializer.Param; +import com.cloud.vm.VirtualMachine; +import com.cloud.vm.VirtualMachine.State; +import com.google.gson.annotations.SerializedName; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseResponse; +import org.apache.cloudstack.api.EntityReference; +import org.apache.cloudstack.jobs.JobInfo; + +import java.util.Date; +import java.util.LinkedHashSet; +import java.util.Set; + +@EntityReference(value = JobInfo.class) +@SuppressWarnings("unused") +public class UpgradeRouterTemplateResponse extends BaseResponse { + @SerializedName(ApiConstants.JOB_ID) @Param(description="the id of AsyncJob") + private String asyncJobId; + + public String getAsyncJobId() { + return asyncJobId; + } + + public void setAsyncJobId(String asyncJobId) { + this.asyncJobId = asyncJobId; + } +} diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 087d8b9490b..68d7303d0a7 100644 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -197,6 +197,7 @@ listRouters=7 listVirtualRouterElements=7 configureVirtualRouterElement=7 createVirtualRouterElement=7 +upgradeRouterTemplate=1 #### system vm commands startSystemVm=1 diff --git a/engine/schema/src/com/cloud/vm/dao/DomainRouterDao.java b/engine/schema/src/com/cloud/vm/dao/DomainRouterDao.java index 95d1ea6ca14..f1912b5d06e 100755 --- a/engine/schema/src/com/cloud/vm/dao/DomainRouterDao.java +++ b/engine/schema/src/com/cloud/vm/dao/DomainRouterDao.java @@ -145,5 +145,6 @@ public interface DomainRouterDao extends GenericDao { * @param guestNetworkId */ void removeRouterFromGuestNetwork(long routerId, long guestNetworkId); - + + List listByClusterId(Long clusterId); } diff --git a/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java index 7676e2daf8d..5158e9857cd 100755 --- a/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/DomainRouterDaoImpl.java @@ -203,6 +203,13 @@ public class DomainRouterDaoImpl extends GenericDaoBase im return listBy(sc); } + @Override + public List listByClusterId(Long clusterId) { + SearchCriteria sc = AllFieldsSearch.create(); + //ToDo: Add cluster criteria + return listBy(sc); + } + @Override public List listByPodIdAndStates(Long podId, State... states) { SearchCriteria sc = AllFieldsSearch.create(); diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 36ef4bd9dc0..e1c48cf8294 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -79,6 +79,7 @@ import org.apache.cloudstack.api.response.LBHealthCheckPolicyResponse; import org.apache.cloudstack.api.response.LBHealthCheckResponse; import org.apache.cloudstack.api.response.LBStickinessPolicyResponse; import org.apache.cloudstack.api.response.LBStickinessResponse; +import org.apache.cloudstack.api.response.ListResponse; import org.apache.cloudstack.api.response.LoadBalancerResponse; import org.apache.cloudstack.api.response.NetworkACLItemResponse; import org.apache.cloudstack.api.response.NetworkACLResponse; @@ -119,6 +120,7 @@ import org.apache.cloudstack.api.response.TemplatePermissionsResponse; import org.apache.cloudstack.api.response.TemplateResponse; import org.apache.cloudstack.api.response.TrafficMonitorResponse; import org.apache.cloudstack.api.response.TrafficTypeResponse; +import org.apache.cloudstack.api.response.UpgradeRouterTemplateResponse; import org.apache.cloudstack.api.response.UsageRecordResponse; import org.apache.cloudstack.api.response.UserResponse; import org.apache.cloudstack.api.response.UserVmResponse; @@ -3793,4 +3795,19 @@ public class ApiResponseHelper implements ResponseGenerator { response.setObjectName("networkacllist"); return response; } + + @Override + public ListResponse createUpgradeRouterTemplateResponse(List jobIds){ + ListResponse response = new ListResponse(); + List responses = new ArrayList(); + for(Long jobId : jobIds){ + UpgradeRouterTemplateResponse routerResponse = new UpgradeRouterTemplateResponse(); + AsyncJob job = _entityMgr.findById(AsyncJob.class, jobId); + routerResponse.setAsyncJobId((job.getUuid())); + routerResponse.setObjectName("asyncjobs"); + responses.add(routerResponse); + } + response.setResponses(responses); + return response; + } } diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index 29346419eac..2b5b81d3eb5 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -1090,7 +1090,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { public ListResponse searchForRouters(ListRoutersCmd cmd) { Pair, Integer> result = searchForRoutersInternal(cmd, cmd.getId(), cmd.getRouterName(), cmd.getState(), cmd.getZoneId(), cmd.getPodId(), cmd.getHostId(), cmd.getKeyword(), cmd.getNetworkId(), - cmd.getVpcId(), cmd.getForVpc(), cmd.getRole()); + cmd.getVpcId(), cmd.getForVpc(), cmd.getRole(), cmd.getVersion()); ListResponse response = new ListResponse(); List routerResponses = ViewResponseHelper.createDomainRouterResponse(result.first() @@ -1103,7 +1103,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { public ListResponse searchForInternalLbVms(ListInternalLBVMsCmd cmd) { Pair, Integer> result = searchForRoutersInternal(cmd, cmd.getId(), cmd.getRouterName(), cmd.getState(), cmd.getZoneId(), cmd.getPodId(), cmd.getHostId(), cmd.getKeyword(), cmd.getNetworkId(), - cmd.getVpcId(), cmd.getForVpc(), cmd.getRole()); + cmd.getVpcId(), cmd.getForVpc(), cmd.getRole(), null); ListResponse response = new ListResponse(); List routerResponses = ViewResponseHelper.createDomainRouterResponse(result.first() @@ -1113,7 +1113,8 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { } private Pair, Integer> searchForRoutersInternal(BaseListProjectAndAccountResourcesCmd cmd, Long id, - String name, String state, Long zoneId, Long podId, Long hostId, String keyword, Long networkId, Long vpcId, Boolean forVpc, String role) { + String name, String state, Long zoneId, Long podId, Long hostId, String keyword, Long networkId, Long vpcId, Boolean forVpc, + String role, String version) { Account caller = CallContext.current().getCallingAccount(); List permittedAccounts = new ArrayList(); @@ -1147,6 +1148,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { sb.and("hostId", sb.entity().getHostId(), SearchCriteria.Op.EQ); sb.and("vpcId", sb.entity().getVpcId(), SearchCriteria.Op.EQ); sb.and("role", sb.entity().getRole(), SearchCriteria.Op.EQ); + sb.and("version", sb.entity().getTemplateVersion(), SearchCriteria.Op.EQ); if (forVpc != null) { if (forVpc) { @@ -1210,6 +1212,10 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { sc.setParameters("role", role); } + if(version != null){ + sc.setParameters("version", "Cloudstack Release "+version + "%"); + } + // search VR details by ids Pair, Integer> uniqueVrPair = _routerJoinDao.searchAndCount(sc, searchFilter); Integer count = uniqueVrPair.second(); diff --git a/server/src/com/cloud/api/query/ViewResponseHelper.java b/server/src/com/cloud/api/query/ViewResponseHelper.java index 4051f09c627..e4be3110dd4 100644 --- a/server/src/com/cloud/api/query/ViewResponseHelper.java +++ b/server/src/com/cloud/api/query/ViewResponseHelper.java @@ -58,6 +58,7 @@ import org.apache.cloudstack.api.response.SecurityGroupResponse; import org.apache.cloudstack.api.response.ServiceOfferingResponse; import org.apache.cloudstack.api.response.StoragePoolResponse; import org.apache.cloudstack.api.response.TemplateResponse; +import org.apache.cloudstack.api.response.UpgradeRouterTemplateResponse; import org.apache.cloudstack.api.response.UserResponse; import org.apache.cloudstack.api.response.UserVmResponse; import org.apache.cloudstack.api.response.VolumeResponse; @@ -440,4 +441,5 @@ public class ViewResponseHelper { } return new ArrayList(vrDataList.values()); } + } diff --git a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java index 42965bca3e7..f1930317fb1 100644 --- a/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/DomainRouterJoinDaoImpl.java @@ -22,6 +22,8 @@ import java.util.List; import javax.ejb.Local; import javax.inject.Inject; +import com.cloud.maint.Version; +import com.cloud.network.VirtualNetworkApplianceService; import org.apache.cloudstack.api.response.DomainRouterResponse; import org.apache.cloudstack.api.response.NicResponse; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; @@ -76,6 +78,11 @@ public class DomainRouterJoinDaoImpl extends GenericDaoBase upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd){ + + List routers = new ArrayList(); + int params = 0; + + Long routerId = cmd.getId(); + if(routerId != null) { + params++; + DomainRouterVO router = _routerDao.findById(routerId); + if(router != null){ + routers.add(router); + } + } + + Long accountId = cmd.getAccountId(); + if(accountId != null){ + params++; + routers = _routerDao.listBy(accountId); + } + + Long domainId = cmd.getDomainId(); + if(domainId != null){ + params++; + routers = _routerDao.listByDomain(domainId); + } + + Long clusterId = cmd.getClusterId(); + if(clusterId != null){ + params++; + routers = _routerDao.listByClusterId(clusterId); + } + + Long podId = cmd.getPodId(); + if(podId != null){ + params++; + routers = _routerDao.listByPodId(podId); + } + + Long zoneId = cmd.getZoneId(); + if(zoneId != null){ + params++; + routers = _routerDao.listByDataCenter(zoneId); + } + + if(params > 1){ + throw new InvalidParameterValueException("Multiple parameters not supported. Specify only one among routerId/zoneId/podId/clusterId/accountId/domainId"); + } + + if(routers != null){ + return rebootRouters(routers); + } + + return null; + } + + //Checks if the router is at the required version + // Compares MS version and router version + private boolean checkRouterVersion(VirtualRouter router){ + String trimmedVersion = Version.trimRouterVersion(router.getTemplateVersion()); + return (Version.compare(trimmedVersion, _minVRVersion) >= 0); + } + + private List rebootRouters(List routers){ + List jobIds = new ArrayList(); + for(DomainRouterVO router: routers){ + if(!checkRouterVersion(router)){ + s_logger.debug("Upgrading template for router: "+router.getId()); + ApiDispatcher.getInstance(); + Map params = new HashMap(); + params.put("ctxUserId", "1"); + params.put("ctxAccountId", "" + router.getAccountId()); + + RebootRouterCmd cmd = new RebootRouterCmd(); + ComponentContext.inject(cmd); + params.put("id", ""+router.getId()); + params.put("ctxStartEventId", "1"); + AsyncJobVO job = new AsyncJobVO(UUID.randomUUID().toString(), User.UID_SYSTEM, router.getAccountId(), RebootRouterCmd.class.getName(), + ApiGsonHelper.getBuilder().create().toJson(params), router.getId(), + cmd.getInstanceType() != null ? cmd.getInstanceType().toString() : null); + job.setDispatcher(_asyncDispatcher.getName()); + long jobId = _asyncMgr.submitAsyncJob(job); + jobIds.add(jobId); + } else { + s_logger.debug("Router: "+router.getId()+" is already at the latest version. No upgrade required" ); + } + } + return jobIds; + } } diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 79b20d008b6..35bc6813c03 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -42,6 +42,7 @@ import javax.crypto.spec.SecretKeySpec; import javax.inject.Inject; import javax.naming.ConfigurationException; +import org.apache.cloudstack.api.command.admin.router.UpgradeRouterTemplateCmd; import org.apache.commons.codec.binary.Base64; import org.apache.log4j.Logger; @@ -2874,6 +2875,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe cmdList.add(ReplaceNetworkACLListCmd.class); cmdList.add(UpdateNetworkACLItemCmd.class); cmdList.add(CleanVMReservationsCmd.class); + cmdList.add(UpgradeRouterTemplateCmd.class); return cmdList; } diff --git a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java index acdd9dc8750..5c216c8f19f 100644 --- a/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java +++ b/server/test/com/cloud/vpc/MockVpcVirtualNetworkApplianceManager.java @@ -24,7 +24,7 @@ import javax.ejb.Local; import javax.naming.ConfigurationException; import com.cloud.network.vpc.NetworkACLItem; -import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd; +import org.apache.cloudstack.api.command.admin.router.*; import org.springframework.stereotype.Component; import com.cloud.deploy.DeployDestination; @@ -420,6 +420,11 @@ VpcVirtualNetworkApplianceService { return null; } + @Override + public List upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd) { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + @Override public boolean setupDhcpForPvlan(boolean add, DomainRouterVO router, Long hostId, NicProfile nic) { diff --git a/utils/src/com/cloud/maint/Version.java b/utils/src/com/cloud/maint/Version.java index 73175474edc..f900b56b4c5 100644 --- a/utils/src/com/cloud/maint/Version.java +++ b/utils/src/com/cloud/maint/Version.java @@ -58,6 +58,14 @@ public class Version { return "0"; return tokens[0] + "." + tokens[1]+ "." + tokens[2]; } + + public static String trimRouterVersion(String version){ + String[] tokens = version.split(" "); + if(tokens.length >= 3){ + return tokens[2]; + } + return "0"; + } public static void main(String[] args) { System.out.println("Result is " + compare(args[0], args[1])); From 5cb3cd64e5661b55fca2f22f6bfc77b84f35ab13 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Thu, 7 Nov 2013 16:15:34 +0100 Subject: [PATCH 058/108] Fix CID 1116741,1116742 Resource leak --- .../config/dao/ConfigurationDaoImpl.java | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java index 8804740a7af..2934b018474 100644 --- a/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java +++ b/framework/config/src/org/apache/cloudstack/framework/config/dao/ConfigurationDaoImpl.java @@ -17,6 +17,7 @@ package org.apache.cloudstack.framework.config.dao; import java.sql.PreparedStatement; +import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -26,9 +27,10 @@ import javax.ejb.Local; import javax.naming.ConfigurationException; import org.apache.log4j.Logger; -import org.apache.cloudstack.framework.config.impl.ConfigurationVO; import org.springframework.stereotype.Component; +import org.apache.cloudstack.framework.config.impl.ConfigurationVO; + import com.cloud.utils.component.ComponentLifecycle; import com.cloud.utils.crypt.DBEncryptionUtil; import com.cloud.utils.db.DB; @@ -142,14 +144,21 @@ public class ConfigurationDaoImpl extends GenericDaoBase Date: Thu, 7 Nov 2013 16:22:53 +0100 Subject: [PATCH 059/108] Fix CID 1116743 Resource leak --- .../storage/image/db/SnapshotDataStoreDaoImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java index ee00dd5d0e9..7b9cf957a07 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java @@ -203,12 +203,17 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase Date: Mon, 4 Nov 2013 21:50:14 -0700 Subject: [PATCH 060/108] CLOUDSTACK-5039 bugfix: live migration failure in KVM env. Signed-off-by: ynojima --- .../hypervisor/kvm/resource/LibvirtComputingResource.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 570eae60078..00412d2efca 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -2910,8 +2910,7 @@ ServerResource { try { conn = LibvirtConnection.getConnectionByVmName(cmd.getVmName()); ifaces = getInterfaces(conn, vmName); - dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName - .getBytes())); + dm = conn.domainLookupByName(vmName); /* We replace the private IP address with the address of the destination host. This is because the VNC listens on the private IP address of the hypervisor, From 62286fcc6df5e9284a7ee5fff2bdae5ab14a67fd Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Thu, 7 Nov 2013 10:44:45 -0800 Subject: [PATCH 061/108] Fix Palo Alto Firewall RAT issue --- .../cloud/network/utils/HttpClientWrapper.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/network-elements/palo-alto/src/com/cloud/network/utils/HttpClientWrapper.java b/plugins/network-elements/palo-alto/src/com/cloud/network/utils/HttpClientWrapper.java index 7e4057005cb..7dfec92cbe6 100644 --- a/plugins/network-elements/palo-alto/src/com/cloud/network/utils/HttpClientWrapper.java +++ b/plugins/network-elements/palo-alto/src/com/cloud/network/utils/HttpClientWrapper.java @@ -1,3 +1,19 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. package com.cloud.network.utils; import java.security.cert.CertificateException; @@ -66,4 +82,4 @@ public class HttpClientWrapper { return null; } } -} \ No newline at end of file +} From 6a396a90576c7e29bb3cfa00957fe06b96319d2b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 7 Nov 2013 11:45:53 -0800 Subject: [PATCH 062/108] CLOUDSTACK-4793: UI > Infrastructure > Virtual Routers > listView > implement Advanced Search by name/zone/pod/domain/account. --- ui/scripts/system.js | 176 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 148 insertions(+), 28 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index e568a6d79f1..8c03e75e6f8 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -7394,41 +7394,57 @@ }, virtualRouters: function() { var listView = $.extend(true, {}, cloudStack.sections.system.subsections.virtualRouters.listView, { - dataProvider: function(args) { - var searchByArgs = args.filterBy.search.value.length ? - '&keyword=' + args.filterBy.search.value : ''; - + dataProvider: function(args) { + var data = {}; + listViewDataProvider(args, data); + var routers = []; + + //get account-owned routers $.ajax({ - url: createURL("listRouters&listAll=true&page=" + args.page + "&pagesize=" + pageSize + searchByArgs), - async: true, + url: createURL('listRouters'), + data: $.extend(data,{ + listAll: true + }), + async: false, success: function(json) { - var items = json.listroutersresponse.router ? - json.listroutersresponse.router : []; - + var items = json.listroutersresponse.router ? json.listroutersresponse.router : []; $(items).map(function(index, item) { routers.push(item); }); - - // Get project routers - $.ajax({ - url: createURL("listRouters&listAll=true&page=" + args.page + "&pagesize=" + pageSize + "&projectid=-1"), - async: true, - success: function(json) { - var items = json.listroutersresponse.router ? - json.listroutersresponse.router : []; - - $(items).map(function(index, item) { - routers.push(item); - }); - args.response.success({ - actionFilter: routerActionfilter, - data: $(routers).map(mapRouterType) - }); - } - }); + + //get project-owned routers + var toSearchByProjectid = true; + if (args.filterBy != null) { + if (args.filterBy.advSearch != null && typeof(args.filterBy.advSearch) == "object") { //advanced search + if ('account' in args.filterBy.advSearch && args.filterBy.advSearch.account.length > 0) { //if account is specified in advanced search, don't search project-owned routers + toSearchByProjectid = false; //since account and projectid can't be specified together + } + } + } + if (toSearchByProjectid) { + $.ajax({ + url: createURL('listRouters'), + data: $.extend(data,{ + listAll: true, + projectid: -1 + }), + async: false, + success: function(json) { + var items = json.listroutersresponse.router ? json.listroutersresponse.router : []; + $(items).map(function(index, item) { + routers.push(item); + }); + } + }); + } } - }); + }); + + args.response.success({ + actionFilter: routerActionfilter, + data: $(routers).map(mapRouterType) + }); }, detailView: { @@ -7558,6 +7574,110 @@ } } }, + + advSearchFields: { + name: { + label: 'Name' + }, + zoneid: { + label: 'Zone', + select: function(args) { + $.ajax({ + url: createURL('listZones'), + data: { + listAll: true + }, + success: function(json) { + var zones = json.listzonesresponse.zone ? json.listzonesresponse.zone : []; + + args.response.success({ + data: $.map(zones, function(zone) { + return { + id: zone.id, + description: zone.name + }; + }) + }); + } + }); + } + }, + podid: { + label: 'Pod', + dependsOn: 'zoneid', + select: function (args) { + $.ajax({ + url: createURL("listPods&zoneid=" + args.zoneid), + dataType: "json", + async: true, + success: function (json) { + var pods = json.listpodsresponse.pod ? json.listpodsresponse.pod : []; + args.response.success({ + data: $.map(pods, function(pod) { + return { + id: pod.id, + description: pod.name + }; + }) + }); + } + }); + } + }, + domainid: { + label: 'Domain', + select: function(args) { + if (isAdmin() || isDomainAdmin()) { + $.ajax({ + url: createURL('listDomains'), + data: { + listAll: true, + details: 'min' + }, + success: function(json) { + var array1 = [{ + id: '', + description: '' + }]; + var domains = json.listdomainsresponse.domain; + if (domains != null && domains.length > 0) { + for (var i = 0; i < domains.length; i++) { + array1.push({ + id: domains[i].id, + description: domains[i].path + }); + } + } + args.response.success({ + data: array1 + }); + } + }); + } else { + args.response.success({ + data: null + }); + } + }, + isHidden: function(args) { + if (isAdmin() || isDomainAdmin()) + return false; + else + return true; + } + }, + + account: { + label: 'Account', + isHidden: function(args) { + if (isAdmin() || isDomainAdmin()) + return false; + else + return true; + } + } + }, + dataProvider: function(args) { var array1 = []; if (args.filterBy != null) { From 336eb48f9b6769355da46888922fe51e8195f208 Mon Sep 17 00:00:00 2001 From: Laszlo Hornyak Date: Fri, 11 Oct 2013 20:29:45 +0200 Subject: [PATCH 063/108] fixed Rules it was no longer working, it must be fixed for those who want to read it. Signed-off-by: Laszlo Hornyak --- .../src/org/apache/cloudstack/engine/Rules.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/engine/api/src/org/apache/cloudstack/engine/Rules.java b/engine/api/src/org/apache/cloudstack/engine/Rules.java index b700fa5fcb7..04b17a2c410 100755 --- a/engine/api/src/org/apache/cloudstack/engine/Rules.java +++ b/engine/api/src/org/apache/cloudstack/engine/Rules.java @@ -21,7 +21,6 @@ package org.apache.cloudstack.engine; import java.util.ArrayList; import java.util.List; -import com.cloud.utils.StringUtils; /** * Rules specifies all rules about developing and using CloudStack Orchestration @@ -55,18 +54,7 @@ public class Rules { private static void printRule(String rule) { System.out.print("API Rule: "); - String skip = ""; - int brk = 0; - while (true) { - int stop = StringUtils.formatForOutput(rule, brk, 75 - skip.length(), ' '); - if (stop < 0) { - break; - } - System.out.print(skip); - skip = " "; - System.out.println(rule.substring(brk, stop).trim()); - brk = stop; - } + System.out.println(rule); } public static void main(String[] args) { From 465dee01594c5683e9c5bb8a0a69b20864ba030e Mon Sep 17 00:00:00 2001 From: Laszlo Hornyak Date: Fri, 11 Oct 2013 20:34:17 +0200 Subject: [PATCH 064/108] Removing coded documentation This is the output of the program, the developer documentation may be a better place ----- When developing against the CloudStack Orchestration Platform, you must following the following rules: API Rule: Always be prepared to handle RuntimeExceptions. When writing APIs, you must follow these rules: API Rule: You may think you're the greatest developer in the world but every change to the API must be reviewed and approved. API Rule: Every API must have unit tests written against it. And not it's unit tests API Rule: ----- Signed-off-by: Laszlo Hornyak --- .../org/apache/cloudstack/engine/Rules.java | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100755 engine/api/src/org/apache/cloudstack/engine/Rules.java diff --git a/engine/api/src/org/apache/cloudstack/engine/Rules.java b/engine/api/src/org/apache/cloudstack/engine/Rules.java deleted file mode 100755 index 04b17a2c410..00000000000 --- a/engine/api/src/org/apache/cloudstack/engine/Rules.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.cloudstack.engine; - -import java.util.ArrayList; -import java.util.List; - - -/** - * Rules specifies all rules about developing and using CloudStack Orchestration - * Platforms APIs. This class is not actually used in CloudStack Orchestration - * Platform but must be read by all who wants to use and develop against - * CloudStack Orchestration Platform. - * - * Make sure to make changes here when there are changes to how the APIs should - * be used and developed. - * - * Changes to this class must be approved by the maintainer of this project. - * - */ -public class Rules { - public static List whenUsing() { - List rules = new ArrayList(); - rules.add("Always be prepared to handle RuntimeExceptions."); - return rules; - } - - public static List whenWritingNewApis() { - List rules = new ArrayList(); - rules.add("You may think you're the greatest developer in the " + - "world but every change to the API must be reviewed and approved. "); - rules.add("Every API must have unit tests written against it. And not it's unit tests"); - rules.add(""); - - - return rules; - } - - private static void printRule(String rule) { - System.out.print("API Rule: "); - System.out.println(rule); - } - - public static void main(String[] args) { - System.out.println("When developing against the CloudStack Orchestration Platform, you must following the following rules:"); - for (String rule : whenUsing()) { - printRule(rule); - } - System.out.println(""); - System.out.println("When writing APIs, you must follow these rules:"); - for (String rule : whenWritingNewApis()) { - printRule(rule); - } - } - -} - From 7ba55723bbf607fc4c97b847aac5c9059fa2074f Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 7 Nov 2013 13:28:48 -0800 Subject: [PATCH 065/108] CLOUDSTACK-4058: UI > Host detail page > (1) Add Hypervisor, HypervisorVersion field. (2) Remove CloudstackVersion field. --- ui/scripts/system.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 8c03e75e6f8..8f943e2e751 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -13078,6 +13078,12 @@ }, type: { label: 'label.type' + }, + hypervisor: { + label: 'label.hypervisor' + }, + hypervisorversion: { + label: 'label.hypervisor.version' }, hosttags: { label: 'label.host.tags', @@ -13125,10 +13131,7 @@ }, ipaddress: { label: 'label.ip.address' - }, - version: { - label: 'label.version' - }, + }, disconnected: { label: 'label.last.disconnected' } From cff5ea0949e65836b7961004aff959aacd79ea82 Mon Sep 17 00:00:00 2001 From: Laszlo Hornyak Date: Thu, 7 Nov 2013 21:44:11 +0100 Subject: [PATCH 066/108] FileUtil: use commons-io FileUtils - removed the method body ot FileUtil.copyFile and replaced with FleUtils.copyFile Signed-off-by: Laszlo Hornyak --- utils/src/com/cloud/utils/FileUtil.java | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/utils/src/com/cloud/utils/FileUtil.java b/utils/src/com/cloud/utils/FileUtil.java index a6f0c9167ef..96ad3afe8c3 100644 --- a/utils/src/com/cloud/utils/FileUtil.java +++ b/utils/src/com/cloud/utils/FileUtil.java @@ -17,28 +17,14 @@ package com.cloud.utils; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; + +import org.apache.commons.io.FileUtils; public class FileUtil { - public static void copyfile(File f1, File f2) throws IOException { - InputStream in = new FileInputStream(f1); - OutputStream out = new FileOutputStream(f2); - - try { - byte[] buf = new byte[1024]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); - } - } finally { - in.close(); - out.close(); - } + public static void copyfile(File source, File destination) throws IOException { + FileUtils.copyFile(source, destination); } } From 99acb97854c3bbad50a524bcc60ce8e441865c1d Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 7 Nov 2013 13:34:31 -0800 Subject: [PATCH 067/108] CLOUDSTACK-5089: fixed VPCDao to set the accountId field correctly --- engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java index ba030e9a44a..74d37876263 100644 --- a/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java +++ b/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java @@ -68,7 +68,7 @@ public class VpcDaoImpl extends GenericDaoBase implements VpcDao{ CountByAccountId = createSearchBuilder(Long.class); CountByAccountId.select(null, Func.COUNT, CountByAccountId.entity().getId()); - CountByAccountId.and("offeringId", CountByAccountId.entity().getAccountId(), Op.EQ); + CountByAccountId.and("accountId", CountByAccountId.entity().getAccountId(), Op.EQ); CountByAccountId.and("removed", CountByAccountId.entity().getRemoved(), Op.NULL); CountByAccountId.done(); } From d0123f9594b1a3604fc7acf50dc71e56d906aaa0 Mon Sep 17 00:00:00 2001 From: Chris Suich Date: Thu, 7 Nov 2013 15:55:11 -0500 Subject: [PATCH 068/108] Added option to reload VM during in RevertToVMSnapshotCommand (only in VMWare as I don't believe that XenServer supports anything similar) Signed-off-by: Edison Su --- .../agent/api/RevertToVMSnapshotCommand.java | 15 ++++++- .../manager/VmwareStorageManagerImpl.java | 40 ++++++++++--------- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java b/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java index 1e5fd6c9a68..b744ced57e3 100644 --- a/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java +++ b/core/src/com/cloud/agent/api/RevertToVMSnapshotCommand.java @@ -18,7 +18,6 @@ package com.cloud.agent.api; import java.util.List; -import com.cloud.agent.api.to.VolumeTO; import org.apache.cloudstack.storage.to.VolumeObjectTO; public class RevertToVMSnapshotCommand extends VMSnapshotBaseCommand { @@ -27,4 +26,18 @@ public class RevertToVMSnapshotCommand extends VMSnapshotBaseCommand { super(vmName, snapshot, volumeTOs, guestOSType); } + public RevertToVMSnapshotCommand(String vmName, VMSnapshotTO snapshot, List volumeTOs, String guestOSType, boolean reloadVm) { + this(vmName, snapshot, volumeTOs, guestOSType); + setReloadVm(reloadVm); + } + + private boolean reloadVm = false; + + public boolean isReloadVm() { + return reloadVm; + } + + public void setReloadVm(boolean reloadVm) { + this.reloadVm = reloadVm; + } } diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java index 0e2423e483b..b2be93079fb 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java @@ -16,6 +16,23 @@ // under the License. package com.cloud.hypervisor.vmware.manager; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.rmi.RemoteException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.UUID; + +import org.apache.cloudstack.storage.to.TemplateObjectTO; +import org.apache.cloudstack.storage.to.VolumeObjectTO; +import org.apache.log4j.Logger; + import com.cloud.agent.api.Answer; import com.cloud.agent.api.BackupSnapshotAnswer; import com.cloud.agent.api.BackupSnapshotCommand; @@ -70,22 +87,6 @@ import com.vmware.vim25.HostDatastoreBrowserSearchSpec; import com.vmware.vim25.ManagedObjectReference; import com.vmware.vim25.TaskInfo; import com.vmware.vim25.VirtualDisk; -import org.apache.cloudstack.storage.to.TemplateObjectTO; -import org.apache.cloudstack.storage.to.VolumeObjectTO; -import org.apache.log4j.Logger; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.OutputStreamWriter; -import java.rmi.RemoteException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.UUID; public class VmwareStorageManagerImpl implements VmwareStorageManager { @Override @@ -332,7 +333,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { workerVMName = hostService.getWorkerName(context, cmd, 0); vmMo = HypervisorHostHelper.createWorkerVM(hyperHost, dsMo, workerVMName); - + if (vmMo == null) { throw new Exception("Failed to find the newly create or relocated VM. vmName: " + workerVMName); } @@ -1056,7 +1057,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { // create a dummy worker vm for attaching the volume DatastoreMO dsMo = new DatastoreMO(hyperHost.getContext(), morDs); workerVm = HypervisorHostHelper.createWorkerVM(hyperHost, dsMo, workerVmName); - + if (workerVm == null) { String msg = "Unable to create worker VM to execute CopyVolumeCommand"; s_logger.error(msg); @@ -1449,6 +1450,9 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { s_logger.debug(msg); return new RevertToVMSnapshotAnswer(cmd, false, msg); } else { + if (cmd.isReloadVm()) { + vmMo.reload(); + } boolean result = false; if (snapshotName != null) { ManagedObjectReference morSnapshot = vmMo.getSnapshotMor(snapshotName); From aef633f2033703a712afd9e8f523bb9e85829635 Mon Sep 17 00:00:00 2001 From: Chris Suich Date: Thu, 7 Nov 2013 10:23:21 -0500 Subject: [PATCH 069/108] Updated VMSnapshotDetails* to match *Details* pattern (e.g. UserVMDetails*) Signed-off-by: Edison Su --- .../vm/snapshot/VMSnapshotDetailsVO.java | 62 +++++++++---------- .../vm/snapshot/dao/VMSnapshotDetailsDao.java | 7 +-- .../dao/VMSnapshotDetailsDaoImpl.java | 31 ++-------- .../vm/snapshot/dao/VmSnapshotDaoTest.java | 11 ++-- 4 files changed, 43 insertions(+), 68 deletions(-) diff --git a/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotDetailsVO.java b/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotDetailsVO.java index 934dd92cca3..ee8765b4ee4 100644 --- a/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotDetailsVO.java +++ b/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotDetailsVO.java @@ -18,27 +18,25 @@ */ package com.cloud.vm.snapshot; -import org.apache.cloudstack.api.InternalIdentity; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; -import javax.persistence.TableGenerator; + +import org.apache.cloudstack.api.ResourceDetail; @Entity @Table(name = "vm_snapshot_details") -public class VMSnapshotDetailsVO implements InternalIdentity { +public class VMSnapshotDetailsVO implements ResourceDetail { @Id - @TableGenerator(name = "vm_snapshot_details_seq", table = "sequence", pkColumnName = "name", valueColumnName = "value", pkColumnValue = "vm_snapshot_details_seq", allocationSize = 1) - @GeneratedValue(strategy = GenerationType.TABLE) + @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "id") private long id; @Column(name = "vm_snapshot_id") - Long vmSnapshotId; + private long resourceId; @Column(name = "name") String name; @@ -50,38 +48,34 @@ public class VMSnapshotDetailsVO implements InternalIdentity { } - public VMSnapshotDetailsVO(Long vmSnapshotId, String name, String value) { - this.vmSnapshotId = vmSnapshotId; + public VMSnapshotDetailsVO(long vmSnapshotId, String name, String value) { + this.resourceId = vmSnapshotId; this.name = name; this.value = value; } - public Long getVmSnapshotId() { - return this.vmSnapshotId; - } - - public void setVmSnapshotId(Long vmSnapshotId) { - this.vmSnapshotId = vmSnapshotId; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return this.value; - } - - public void setValue(String value) { - this.value = value; - } - + @Override + public String getName() { + return this.name; + } + + @Override + public String getValue() { + return this.value; + } + @Override public long getId() { - return id; + return id; + } + + @Override + public long getResourceId() { + return resourceId; + } + + @Override + public boolean isDisplay() { + return false; } } diff --git a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDetailsDao.java b/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDetailsDao.java index e84178cc4fd..ba2c52cc6be 100644 --- a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDetailsDao.java +++ b/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDetailsDao.java @@ -18,11 +18,10 @@ */ package com.cloud.vm.snapshot.dao; +import org.apache.cloudstack.resourcedetail.ResourceDetailsDao; + import com.cloud.utils.db.GenericDao; import com.cloud.vm.snapshot.VMSnapshotDetailsVO; -import java.util.Map; - -public interface VMSnapshotDetailsDao extends GenericDao { - Map getDetails(Long vmSnapshotId); +public interface VMSnapshotDetailsDao extends GenericDao, ResourceDetailsDao { } diff --git a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDetailsDaoImpl.java b/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDetailsDaoImpl.java index b528b39290f..bfa912d0327 100644 --- a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDetailsDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDetailsDaoImpl.java @@ -18,35 +18,14 @@ */ package com.cloud.vm.snapshot.dao; -import com.cloud.utils.db.GenericDaoBase; -import com.cloud.utils.db.SearchBuilder; -import com.cloud.utils.db.SearchCriteria; +import org.apache.cloudstack.resourcedetail.ResourceDetailsDaoBase; + import com.cloud.vm.snapshot.VMSnapshotDetailsVO; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +public class VMSnapshotDetailsDaoImpl extends ResourceDetailsDaoBase implements VMSnapshotDetailsDao { -public class VMSnapshotDetailsDaoImpl extends GenericDaoBase implements VMSnapshotDetailsDao { - protected final SearchBuilder searchDetails; - - protected VMSnapshotDetailsDaoImpl() { - super(); - searchDetails = createSearchBuilder(); - searchDetails.and("vmsnapshotId", searchDetails.entity().getVmSnapshotId(), SearchCriteria.Op.EQ); - searchDetails.done(); - } @Override - public Map getDetails(Long vmSnapshotId) { - SearchCriteria sc = searchDetails.create(); - sc.setParameters("vmsnapshotId", vmSnapshotId); - - List details = listBy(sc); - Map detailsMap = new HashMap(); - for (VMSnapshotDetailsVO detail : details) { - detailsMap.put(detail.getName(), detail.getValue()); - } - - return detailsMap; + public void addDetail(long resourceId, String key, String value) { + super.addDetail(new VMSnapshotDetailsVO(resourceId, key, value)); } } diff --git a/engine/storage/integration-test/test/com/cloud/vm/snapshot/dao/VmSnapshotDaoTest.java b/engine/storage/integration-test/test/com/cloud/vm/snapshot/dao/VmSnapshotDaoTest.java index fc52f89f5d0..2a2ef9c201a 100644 --- a/engine/storage/integration-test/test/com/cloud/vm/snapshot/dao/VmSnapshotDaoTest.java +++ b/engine/storage/integration-test/test/com/cloud/vm/snapshot/dao/VmSnapshotDaoTest.java @@ -18,16 +18,19 @@ */ package com.cloud.vm.snapshot.dao; -import com.cloud.vm.snapshot.VMSnapshotDetailsVO; +import java.util.Map; + +import javax.inject.Inject; + import junit.framework.Assert; + import org.apache.cloudstack.storage.test.CloudStackTestNGBase; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import javax.inject.Inject; -import java.util.Map; +import com.cloud.vm.snapshot.VMSnapshotDetailsVO; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "classpath:/storageContext.xml") @@ -39,7 +42,7 @@ public class VmSnapshotDaoTest extends CloudStackTestNGBase { public void testVmSnapshotDetails() { VMSnapshotDetailsVO detailsVO = new VMSnapshotDetailsVO(1L, "test", "foo"); vmsnapshotDetailsDao.persist(detailsVO); - Map details = vmsnapshotDetailsDao.getDetails(1L); + Map details = vmsnapshotDetailsDao.listDetailsKeyPairs(1L); Assert.assertTrue(details.containsKey("test")); } From f826dfb91807546ac3e8d0a0347ccd57d9f3a985 Mon Sep 17 00:00:00 2001 From: Chris Suich Date: Thu, 7 Nov 2013 10:21:55 -0500 Subject: [PATCH 070/108] Fixed bug with deleting VMWare VM Snapshots Signed-off-by: Edison Su --- .../hypervisor/vmware/manager/VmwareStorageManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java index b2be93079fb..4c34ebc365b 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java @@ -1402,7 +1402,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { baseName + "*.vmdk", store.getUuid(), newPath); if(volumeTo.getVolumeType()== Volume.Type.ROOT){ // add memory snapshot size - size = size + getVMSnapshotChainSize(context,hyperHost,cmd.getVmName()+"*.vmsn",volumeTo.getUuid(),null); + size = size + getVMSnapshotChainSize(context,hyperHost,cmd.getVmName()+"*.vmsn",store.getUuid(),null); } volumeTo.setSize(size); volumeTo.setPath(newPath); From 2014866afa8ed23ffae956becee2056d9ad926c8 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 7 Nov 2013 14:31:29 -0800 Subject: [PATCH 071/108] Fix project view colors --- ui/css/cloudstack3.css | 58 ++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 2135e8e0dc7..2acc6b44043 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -63,7 +63,7 @@ body.install-wizard { #main-area { width: 1024px; - height: 700px; + height: 729px; margin: auto; border: 1px solid #D4D4D4; /*+box-shadow:0px -5px 11px #B7B7B7;*/ @@ -76,7 +76,7 @@ body.install-wizard { #container { /*[empty]width:;*/ - height: 700px; + height: 100%; margin: auto; position: relative; } @@ -1671,19 +1671,18 @@ div.list-view td.state.off span { .project-view .ui-tabs ul li.ui-state-default a { background: #6D747D; - border-top: 1px solid #90969E; - /*+box-shadow:inset -1px 1px 1px #575D64;*/ - -moz-box-shadow: inset -1px 1px 1px #575D64; - -webkit-box-shadow: inset -1px 1px 1px #575D64; - -o-box-shadow: inset -1px 1px 1px #575D64; - box-shadow: inset -1px 1px 1px #575D64; - border-right: 1px solid #90969E; + /*+box-shadow:inset -1px -2px 12px #596066;*/ + -moz-box-shadow: inset -1px -2px 12px #596066; + -webkit-box-shadow: inset -1px -2px 12px #596066; + -o-box-shadow: inset -1px -2px 12px #596066; + box-shadow: inset -1px -2px 12px #596066; color: #FFFFFF; - /*+text-shadow:0px 1px 1px #000000;*/ - -moz-text-shadow: 0px 1px 1px #000000; - -webkit-text-shadow: 0px 1px 1px #000000; - -o-text-shadow: 0px 1px 1px #000000; - text-shadow: 0px 1px 1px #000000; + font-weight: bold; + /*+text-shadow:0px -1px 1px #3A3E42;*/ + -moz-text-shadow: 0px -1px 1px #3A3E42; + -webkit-text-shadow: 0px -1px 1px #3A3E42; + -o-text-shadow: 0px -1px 1px #3A3E42; + text-shadow: 0px -1px 1px #3A3E42; } .ui-tabs ul li.ui-state-hover a { @@ -2461,7 +2460,6 @@ div.detail-group.actions td { /*Navigation*/ #navigation, #browser { - height: 728px; } #navigation { @@ -2495,6 +2493,7 @@ div.detail-group.actions td { .project-view #navigation ul { border-right: 1px solid #464C53; + background: #6D747D; } #navigation ul li { @@ -2506,6 +2505,7 @@ div.detail-group.actions td { .project-view #navigation ul li { background-image: url(../images/bg-nav-item-project-view.png); background-position: 0px 0px; + border: none; } .project-view #navigation ul li span { @@ -2701,11 +2701,10 @@ div.detail-group.actions td { /*Browser*/ #browser { width: 794px; - height: 700px; + height: 100%; max-width: 794px; position: relative; float: left; - background: #FFFFFF; overflow: hidden; } @@ -2718,7 +2717,6 @@ div.detail-group.actions td { #browser div.panel { height: 100%; - background: #FFFFFF; border-right: 1px solid #A5A5A5; overflow: visible; background-color: #F7F7F7; @@ -2758,7 +2756,6 @@ div.detail-group.actions td { } .ui-tabs div.ui-tabs-panel { - background: #FFFFFF; position: relative; } @@ -3397,7 +3394,7 @@ div.toolbar div.filters select { } .project-view #breadcrumbs ul li { - background: url(../images/bg-breadcrumb-project-view.png) 0px -2px; + color: #FFFFFF !important; } #breadcrumbs ul li, @@ -8668,6 +8665,21 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t box-shadow: 0px 0px 1px #FFFFFF; } +.project-view .system-dashboard .head { + color: #FFFFFF; + /*+text-shadow:0px -1px #000000;*/ + -moz-text-shadow: 0px -1px #000000; + -webkit-text-shadow: 0px -1px #000000; + -o-text-shadow: 0px -1px #000000; + text-shadow: 0px -1px #000000; + /*+box-shadow:none;*/ + -moz-box-shadow: none; + -webkit-box-shadow: none; + -o-box-shadow: none; + box-shadow: none; + padding-top: 14px; +} + .system-dashboard .view-more, .system-dashboard .view-all { float: right; @@ -9429,6 +9441,7 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t width: 510px; height: 230px; float: left; + background: #777E88; } .project-dashboard-view .compute-and-storage .system-dashboard ul, @@ -9439,9 +9452,10 @@ div.ui-dialog div.multi-edit-add-list div.view div.data-table table.body tbody t .project-dashboard-view .compute-and-storage .system-dashboard li, .project-dashboard-view .users .system-dashboard li { - width: 159px; + width: 156px; height: 161px; - background-position: 300px -1018px; + background: #3D4045; + color: #FFFFFF; } .project-dashboard-view .compute-and-storage .system-dashboard li .icon, From c233492bfcf26c3a5c3781ae412b3381c24a6597 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Thu, 7 Nov 2013 14:56:51 -0800 Subject: [PATCH 072/108] Add quiencevm option on createsnapshotcmd --- api/src/com/cloud/storage/VolumeApiService.java | 2 +- .../org/apache/cloudstack/api/ApiConstants.java | 1 + .../command/user/snapshot/CreateSnapshotCmd.java | 10 ++++++++++ .../cloudstack/storage/to/SnapshotObjectTO.java | 10 ++++++++++ .../subsystem/api/storage/SnapshotInfo.java | 1 + .../storage/snapshot/SnapshotObject.java | 7 +++++++ .../CloudStackPrimaryDataStoreDriverImpl.java | 15 ++++++++------- .../com/cloud/storage/CreateSnapshotPayload.java | 9 +++++++++ .../com/cloud/storage/VolumeApiServiceImpl.java | 3 ++- .../storage/snapshot/SnapshotManagerImpl.java | 2 +- 10 files changed, 50 insertions(+), 10 deletions(-) diff --git a/api/src/com/cloud/storage/VolumeApiService.java b/api/src/com/cloud/storage/VolumeApiService.java index 4806ae7c06f..28656281236 100644 --- a/api/src/com/cloud/storage/VolumeApiService.java +++ b/api/src/com/cloud/storage/VolumeApiService.java @@ -79,7 +79,7 @@ public interface VolumeApiService { Volume detachVolumeFromVM(DetachVolumeCmd cmmd); - Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account account) + Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account account, boolean quiescevm) throws ResourceAllocationException; Snapshot allocSnapshot(Long volumeId, Long policyId) diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index bd525937ce7..a348684f18f 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -210,6 +210,7 @@ public class ApiConstants { public static final String SNAPSHOT_ID = "snapshotid"; public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid"; public static final String SNAPSHOT_TYPE = "snapshottype"; + public static final String SNAPSHOT_QUIESCEVM = "quiescevm"; public static final String SOURCE_ZONE_ID = "sourcezoneid"; public static final String START_DATE = "startdate"; public static final String START_IP = "startip"; diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java index 9fe5ffe1956..64b3772705d 100644 --- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java @@ -65,12 +65,22 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd { description = "policy id of the snapshot, if this is null, then use MANUAL_POLICY.") private Long policyId; + @Parameter(name = ApiConstants.SNAPSHOT_QUIESCEVM, type = CommandType.BOOLEAN, required = false, description = "quiesce vm if true") + private Boolean quiescevm; + private String syncObjectType = BaseAsyncCmd.snapshotHostSyncObject; // /////////////////////////////////////////////////// // ///////////////// Accessors /////////////////////// // /////////////////////////////////////////////////// + public Boolean getQuiescevm() { + if (quiescevm == null) { + return false; + } else { + return quiescevm; + } + } public String getAccountName() { return accountName; diff --git a/core/src/org/apache/cloudstack/storage/to/SnapshotObjectTO.java b/core/src/org/apache/cloudstack/storage/to/SnapshotObjectTO.java index bacc0f9e5d0..34e977c6421 100644 --- a/core/src/org/apache/cloudstack/storage/to/SnapshotObjectTO.java +++ b/core/src/org/apache/cloudstack/storage/to/SnapshotObjectTO.java @@ -33,6 +33,7 @@ public class SnapshotObjectTO implements DataTO { private String name; private HypervisorType hypervisorType; private long id; + private boolean quiescevm; public SnapshotObjectTO() { @@ -54,6 +55,7 @@ public class SnapshotObjectTO implements DataTO { this.dataStore = snapshot.getDataStore().getTO(); this.setName(snapshot.getName()); this.hypervisorType = snapshot.getHypervisorType(); + this.quiescevm = false; } @Override @@ -129,6 +131,14 @@ public class SnapshotObjectTO implements DataTO { this.hypervisorType = hypervisorType; } + public boolean getquiescevm() { + return this.quiescevm; + } + + public void setQuiescevm(boolean quiescevm) { + this.quiescevm = quiescevm; + } + @Override public String toString() { return new StringBuilder("SnapshotTO[datastore=").append(dataStore).append("|volume=").append(volume).append("|path") diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java index a0ef7dd1273..c0043341b61 100644 --- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java +++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/SnapshotInfo.java @@ -28,6 +28,7 @@ public interface SnapshotInfo extends DataObject, Snapshot { VolumeInfo getBaseVolume(); void addPayload(Object data); + Object getPayload(); Long getDataCenterId(); diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java index daf6477be02..ee02eed8f6c 100644 --- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java +++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java @@ -62,6 +62,7 @@ public class SnapshotObject implements SnapshotInfo { private static final Logger s_logger = Logger.getLogger(SnapshotObject.class); private SnapshotVO snapshot; private DataStore store; + private Object payload; @Inject protected SnapshotDao snapshotDao; @Inject @@ -358,6 +359,12 @@ public class SnapshotObject implements SnapshotInfo { @Override public void addPayload(Object data) { + this.payload = data; + } + + @Override + public Object getPayload() { + return this.payload; } @Override diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java index 2db0a0879f1..327d87c6722 100644 --- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java +++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java @@ -22,6 +22,8 @@ import java.util.UUID; import javax.inject.Inject; +import com.cloud.storage.*; +import org.apache.cloudstack.storage.to.SnapshotObjectTO; import org.apache.log4j.Logger; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; @@ -58,11 +60,6 @@ import com.cloud.agent.api.to.StorageFilerTO; import com.cloud.configuration.Config; import com.cloud.exception.StorageUnavailableException; import com.cloud.host.dao.HostDao; -import com.cloud.storage.DataStoreRole; -import com.cloud.storage.ResizeVolumePayload; -import com.cloud.storage.Storage; -import com.cloud.storage.StorageManager; -import com.cloud.storage.StoragePool; import com.cloud.storage.dao.DiskOfferingDao; import com.cloud.storage.dao.SnapshotDao; import com.cloud.storage.dao.VMTemplateDao; @@ -249,8 +246,12 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback callback) { CreateCmdResult result = null; try { - DataTO snapshotTO = snapshot.getTO(); - + SnapshotObjectTO snapshotTO = (SnapshotObjectTO)snapshot.getTO(); + Object payload = snapshot.getPayload(); + if (payload != null && payload instanceof CreateSnapshotPayload) { + CreateSnapshotPayload snapshotPayload = (CreateSnapshotPayload)payload; + snapshotTO.setQuiescevm(snapshotPayload.getQuiescevm()); + } CreateObjectCommand cmd = new CreateObjectCommand(snapshotTO); EndPoint ep = epSelector.select(snapshot); diff --git a/server/src/com/cloud/storage/CreateSnapshotPayload.java b/server/src/com/cloud/storage/CreateSnapshotPayload.java index 5adc7462ffe..3bc571ef742 100644 --- a/server/src/com/cloud/storage/CreateSnapshotPayload.java +++ b/server/src/com/cloud/storage/CreateSnapshotPayload.java @@ -22,6 +22,7 @@ public class CreateSnapshotPayload { private Long snapshotPolicyId; private Long snapshotId; private Account account; + private boolean quiescevm; public Long getSnapshotPolicyId() { return snapshotPolicyId; @@ -47,4 +48,12 @@ public class CreateSnapshotPayload { this.account = account; } + public void setQuiescevm(boolean quiescevm) { + this.quiescevm = quiescevm; + } + + public boolean getQuiescevm() { + return this.quiescevm; + } + } diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 28df21935f8..c830e3d64f6 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -1383,7 +1383,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic } @Override - public Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account account) throws ResourceAllocationException { + public Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account account, boolean quiescevm) throws ResourceAllocationException { VolumeInfo volume = volFactory.getVolume(volumeId); if (volume == null) { throw new InvalidParameterValueException("Creating snapshot failed due to volume:" + volumeId + " doesn't exist"); @@ -1397,6 +1397,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic payload.setSnapshotId(snapshotId); payload.setSnapshotPolicyId(policyId); payload.setAccount(account); + payload.setQuiescevm(quiescevm); volume.addPayload(payload); return volService.takeSnapshot(volume); } diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index 9888c7697dc..4f6a4558cd1 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -940,7 +940,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager, Long snapshotId = payload.getSnapshotId(); Account snapshotOwner = payload.getAccount(); SnapshotInfo snapshot = snapshotFactory.getSnapshot(snapshotId, volume.getDataStore()); - + snapshot.addPayload(payload); try { SnapshotStrategy snapshotStrategy = _storageStrategyFactory.getSnapshotStrategy(snapshot, SnapshotOperation.TAKE); From dc3d279272d8499fc590e4fbe5b5d115ef704c5d Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 7 Nov 2013 15:12:43 -0800 Subject: [PATCH 073/108] CLOUDSTACK-4833:[Automation][BVT] Template and ISO test cases failing from BVT suite, during LIST api call. --- framework/db/src/com/cloud/dao/EntityManagerImpl.java | 3 ++- server/src/com/cloud/api/ApiDispatcher.java | 6 +++--- utils/src/com/cloud/utils/db/EntityManager.java | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/framework/db/src/com/cloud/dao/EntityManagerImpl.java b/framework/db/src/com/cloud/dao/EntityManagerImpl.java index bb493c0b795..74be13c041b 100644 --- a/framework/db/src/com/cloud/dao/EntityManagerImpl.java +++ b/framework/db/src/com/cloud/dao/EntityManagerImpl.java @@ -57,6 +57,7 @@ public class EntityManagerImpl extends ManagerBase implements EntityManager { return dao.findByUuid(uuid); } + @Override public T findByUuidIncludingRemoved(Class entityType, String uuid) { // Finds and returns a unique VO using uuid, null if entity not found in db GenericDao dao = (GenericDao)GenericDaoBase.getDao(entityType); @@ -94,7 +95,7 @@ public class EntityManagerImpl extends ManagerBase implements EntityManager { _name = name; return true; - } + } @Override public boolean start() { diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 9672ef1e837..44fb6765a34 100755 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -33,6 +33,8 @@ import java.util.regex.Matcher; import javax.annotation.PostConstruct; import javax.inject.Inject; +import org.apache.log4j.Logger; + import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.acl.InfrastructureEntity; import org.apache.cloudstack.acl.RoleType; @@ -49,7 +51,6 @@ import org.apache.cloudstack.api.EntityReference; import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; -import org.apache.cloudstack.api.Validate; import org.apache.cloudstack.api.command.admin.resource.ArchiveAlertsCmd; import org.apache.cloudstack.api.command.admin.resource.DeleteAlertsCmd; import org.apache.cloudstack.api.command.user.event.ArchiveEventsCmd; @@ -58,7 +59,6 @@ import org.apache.cloudstack.api.command.user.event.ListEventsCmd; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.framework.jobs.AsyncJob; import org.apache.cloudstack.framework.jobs.AsyncJobManager; -import org.apache.log4j.Logger; import com.cloud.exception.InvalidParameterValueException; import com.cloud.user.Account; @@ -369,7 +369,7 @@ public class ApiDispatcher { for (Class entity : entities) { // For backward compatibility, we search within removed entities and let service layer deal // with removed ones, return empty response or error - Object objVO = s_instance._entityMgr.findByUuid(entity, uuid); + Object objVO = s_instance._entityMgr.findByUuidIncludingRemoved(entity, uuid); if (objVO == null) { continue; } diff --git a/utils/src/com/cloud/utils/db/EntityManager.java b/utils/src/com/cloud/utils/db/EntityManager.java index 49f4f720698..d613d7d5f9a 100644 --- a/utils/src/com/cloud/utils/db/EntityManager.java +++ b/utils/src/com/cloud/utils/db/EntityManager.java @@ -43,6 +43,15 @@ public interface EntityManager { */ public T findByUuid(Class entityType, String uuid); + /** + * Finds a unique entity by uuid string, including those removed entries + * @param entity class + * @param entityType type of entity you're looking for. + * @param uuid the unique id + * @return T if found, null if not. + */ + public T findByUuidIncludingRemoved(Class entityType, String uuid); + /** * Finds an entity by external id which is always String * @param entity class From 0997ccac22f2edaa456865a977186254b98e56be Mon Sep 17 00:00:00 2001 From: Edison Su Date: Thu, 7 Nov 2013 16:56:29 -0800 Subject: [PATCH 074/108] fix compile --- .../cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java index 64b3772705d..fc40fb2b72b 100644 --- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java @@ -178,7 +178,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd { CallContext.current().setEventDetails("Volume Id: "+getVolumeId()); Snapshot snapshot; try { - snapshot = _volumeService.takeSnapshot(this.getVolumeId(), this.getPolicyId(), this.getEntityId(), _accountService.getAccount(getEntityOwnerId())); + snapshot = _volumeService.takeSnapshot(this.getVolumeId(), this.getPolicyId(), this.getEntityId(), _accountService.getAccount(getEntityOwnerId()), getQuiescevm()); if (snapshot != null) { SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot); response.setResponseName(getCommandName()); From af8eb63dc6a8be8e47ecb86d1e50b6931e9b0231 Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Wed, 6 Nov 2013 02:51:07 +0530 Subject: [PATCH 075/108] Renamed modules with same name to avoid confusion There were two module files with same name and is creating confusion while reporting the test results. Renamed them prefixing them with mem\cpu Signed-off-by: Santhosh Edukulla Signed-off-by: SrikanteswaraRao Talluri --- .../{test_project_limits.py => test_cpu_project_limits.py} | 0 .../{test_project_limits.py => test_mem_project_limits.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/integration/component/cpu_limits/{test_project_limits.py => test_cpu_project_limits.py} (100%) rename test/integration/component/memory_limits/{test_project_limits.py => test_mem_project_limits.py} (100%) diff --git a/test/integration/component/cpu_limits/test_project_limits.py b/test/integration/component/cpu_limits/test_cpu_project_limits.py similarity index 100% rename from test/integration/component/cpu_limits/test_project_limits.py rename to test/integration/component/cpu_limits/test_cpu_project_limits.py diff --git a/test/integration/component/memory_limits/test_project_limits.py b/test/integration/component/memory_limits/test_mem_project_limits.py similarity index 100% rename from test/integration/component/memory_limits/test_project_limits.py rename to test/integration/component/memory_limits/test_mem_project_limits.py From db3252645d8a9d773b19b2dcea077b89f507e83f Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Fri, 8 Nov 2013 10:22:59 +0530 Subject: [PATCH 076/108] Revert "Renamed modules with same name to avoid confusion" This reverts commit af8eb63dc6a8be8e47ecb86d1e50b6931e9b0231. --- .../{test_cpu_project_limits.py => test_project_limits.py} | 0 .../{test_mem_project_limits.py => test_project_limits.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/integration/component/cpu_limits/{test_cpu_project_limits.py => test_project_limits.py} (100%) rename test/integration/component/memory_limits/{test_mem_project_limits.py => test_project_limits.py} (100%) diff --git a/test/integration/component/cpu_limits/test_cpu_project_limits.py b/test/integration/component/cpu_limits/test_project_limits.py similarity index 100% rename from test/integration/component/cpu_limits/test_cpu_project_limits.py rename to test/integration/component/cpu_limits/test_project_limits.py diff --git a/test/integration/component/memory_limits/test_mem_project_limits.py b/test/integration/component/memory_limits/test_project_limits.py similarity index 100% rename from test/integration/component/memory_limits/test_mem_project_limits.py rename to test/integration/component/memory_limits/test_project_limits.py From 5d6d14bc1f1579006406a68cd069fba14ba3fa0c Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Tue, 22 Oct 2013 21:35:17 -0400 Subject: [PATCH 077/108] CLOUDSTACK-4934: Rename Limit resources tests so that they have unique names. Signed-off-by: SrikanteswaraRao Talluri --- .../test_domain_limits.py => test_cpu_domain_limits.py} | 0 test/integration/component/{cpu_limits => }/test_cpu_limits.py | 0 .../{cpu_limits/test_maximum_limits.py => test_cpu_max_limits.py} | 0 .../test_project_limits.py => test_cpu_project_limits.py} | 0 .../component/{memory_limits => }/test_memory_limits.py | 0 .../test_domain_limits.py => test_mm_domain_limits.py} | 0 .../test_maximum_limits.py => test_mm_max_limits.py} | 0 .../test_project_limits.py => test_mm_project_limits.py} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename test/integration/component/{cpu_limits/test_domain_limits.py => test_cpu_domain_limits.py} (100%) rename test/integration/component/{cpu_limits => }/test_cpu_limits.py (100%) rename test/integration/component/{cpu_limits/test_maximum_limits.py => test_cpu_max_limits.py} (100%) rename test/integration/component/{cpu_limits/test_project_limits.py => test_cpu_project_limits.py} (100%) rename test/integration/component/{memory_limits => }/test_memory_limits.py (100%) rename test/integration/component/{memory_limits/test_domain_limits.py => test_mm_domain_limits.py} (100%) rename test/integration/component/{memory_limits/test_maximum_limits.py => test_mm_max_limits.py} (100%) rename test/integration/component/{memory_limits/test_project_limits.py => test_mm_project_limits.py} (100%) diff --git a/test/integration/component/cpu_limits/test_domain_limits.py b/test/integration/component/test_cpu_domain_limits.py similarity index 100% rename from test/integration/component/cpu_limits/test_domain_limits.py rename to test/integration/component/test_cpu_domain_limits.py diff --git a/test/integration/component/cpu_limits/test_cpu_limits.py b/test/integration/component/test_cpu_limits.py similarity index 100% rename from test/integration/component/cpu_limits/test_cpu_limits.py rename to test/integration/component/test_cpu_limits.py diff --git a/test/integration/component/cpu_limits/test_maximum_limits.py b/test/integration/component/test_cpu_max_limits.py similarity index 100% rename from test/integration/component/cpu_limits/test_maximum_limits.py rename to test/integration/component/test_cpu_max_limits.py diff --git a/test/integration/component/cpu_limits/test_project_limits.py b/test/integration/component/test_cpu_project_limits.py similarity index 100% rename from test/integration/component/cpu_limits/test_project_limits.py rename to test/integration/component/test_cpu_project_limits.py diff --git a/test/integration/component/memory_limits/test_memory_limits.py b/test/integration/component/test_memory_limits.py similarity index 100% rename from test/integration/component/memory_limits/test_memory_limits.py rename to test/integration/component/test_memory_limits.py diff --git a/test/integration/component/memory_limits/test_domain_limits.py b/test/integration/component/test_mm_domain_limits.py similarity index 100% rename from test/integration/component/memory_limits/test_domain_limits.py rename to test/integration/component/test_mm_domain_limits.py diff --git a/test/integration/component/memory_limits/test_maximum_limits.py b/test/integration/component/test_mm_max_limits.py similarity index 100% rename from test/integration/component/memory_limits/test_maximum_limits.py rename to test/integration/component/test_mm_max_limits.py diff --git a/test/integration/component/memory_limits/test_project_limits.py b/test/integration/component/test_mm_project_limits.py similarity index 100% rename from test/integration/component/memory_limits/test_project_limits.py rename to test/integration/component/test_mm_project_limits.py From 1047a5398d417f791513f3e892b05c22944bed10 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Thu, 7 Nov 2013 16:22:18 -0800 Subject: [PATCH 078/108] CLOUDSTACK-5045 - [Automation][BVT] Affinity group type is missing "create affinity group page" and failed to create Affinity group Changes: - Refer the injected list of AffinityGroupProcessor --- .../affinity/AffinityGroupServiceImpl.java | 1108 ++++++++--------- 1 file changed, 545 insertions(+), 563 deletions(-) diff --git a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java index b7b51c9c29f..1ac9dcc2a03 100644 --- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java +++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java @@ -1,563 +1,545 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package org.apache.cloudstack.affinity; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; - -import javax.ejb.Local; -import javax.inject.Inject; -import javax.naming.ConfigurationException; - -import org.apache.cloudstack.acl.ControlledEntity; -import org.apache.cloudstack.acl.ControlledEntity.ACLType; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; -import org.apache.cloudstack.affinity.dao.AffinityGroupDao; -import org.apache.cloudstack.affinity.dao.AffinityGroupDomainMapDao; -import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; -import org.apache.cloudstack.context.CallContext; -import org.apache.log4j.Logger; -import org.springframework.context.annotation.Primary; - - - - - - - - -import com.cloud.deploy.DeploymentPlanner; -import com.cloud.domain.DomainVO; -import com.cloud.domain.dao.DomainDao; -import com.cloud.event.ActionEvent; -import com.cloud.event.EventTypes; -import com.cloud.exception.InvalidParameterValueException; -import com.cloud.exception.PermissionDeniedException; -import com.cloud.exception.ResourceInUseException; -import com.cloud.network.Network; -import com.cloud.network.dao.NetworkDomainVO; -import com.cloud.network.security.SecurityGroup; -import com.cloud.user.Account; -import com.cloud.user.AccountManager; -import com.cloud.user.DomainManager; -import com.cloud.uservm.UserVm; -import com.cloud.utils.Pair; -import com.cloud.utils.component.ComponentContext; -import com.cloud.utils.component.Manager; -import com.cloud.utils.component.ManagerBase; -import com.cloud.utils.db.DB; -import com.cloud.utils.db.Filter; -import com.cloud.utils.db.JoinBuilder; -import com.cloud.utils.db.SearchBuilder; -import com.cloud.utils.db.SearchCriteria; -import com.cloud.utils.db.Transaction; -import com.cloud.utils.db.TransactionCallback; -import com.cloud.utils.db.TransactionCallbackNoReturn; -import com.cloud.utils.db.TransactionStatus; -import com.cloud.utils.exception.CloudRuntimeException; -import com.cloud.utils.fsm.StateListener; -import com.cloud.vm.UserVmVO; -import com.cloud.vm.VirtualMachine; -import com.cloud.vm.VirtualMachine.Event; -import com.cloud.vm.VirtualMachine.State; -import com.cloud.vm.dao.UserVmDao; - -@Local(value = { AffinityGroupService.class }) -public class AffinityGroupServiceImpl extends ManagerBase implements AffinityGroupService, Manager, - StateListener { - - public static final Logger s_logger = Logger.getLogger(AffinityGroupServiceImpl.class); - private String _name; - - @Inject - AccountManager _accountMgr; - - @Inject - AffinityGroupDao _affinityGroupDao; - - @Inject - AffinityGroupVMMapDao _affinityGroupVMMapDao; - - @Inject - AffinityGroupDomainMapDao _affinityGroupDomainMapDao; - - @Inject - private UserVmDao _userVmDao; - - @Inject - DomainDao _domainDao; - - @Inject - DomainManager _domainMgr; - - protected List _affinityProcessors; - - public List getAffinityGroupProcessors() { - return _affinityProcessors; - } - - public void setAffinityGroupProcessors(List affinityProcessors) { - this._affinityProcessors = affinityProcessors; - } - - @DB - @Override - @ActionEvent(eventType = EventTypes.EVENT_AFFINITY_GROUP_CREATE, eventDescription = "Creating Affinity Group", create = true) - public AffinityGroup createAffinityGroup(String account, Long domainId, String affinityGroupName, - String affinityGroupType, String description) { - - Account caller = CallContext.current().getCallingAccount(); - - //validate the affinityGroupType - Map typeProcessorMap = getAffinityTypeToProcessorMap(); - if (typeProcessorMap != null && !typeProcessorMap.isEmpty()) { - if (!typeProcessorMap.containsKey(affinityGroupType)) { - throw new InvalidParameterValueException("Unable to create affinity group, invalid affinity group type" - + affinityGroupType); - } - } else { - throw new InvalidParameterValueException( - "Unable to create affinity group, no Affinity Group Types configured"); - } - - AffinityGroupProcessor processor = typeProcessorMap.get(affinityGroupType); - - if (processor.isAdminControlledGroup()) { - throw new PermissionDeniedException("Cannot create the affinity group"); - } - - return createAffinityGroupInternal(account, domainId, affinityGroupName, affinityGroupType, description); - } - - @DB - @Override - public AffinityGroup createAffinityGroupInternal(String account, final Long domainId, final String affinityGroupName, - final String affinityGroupType, final String description) { - - Account caller = CallContext.current().getCallingAccount(); - - // validate the affinityGroupType - Map typeProcessorMap = getAffinityTypeToProcessorMap(); - if (typeProcessorMap != null && !typeProcessorMap.isEmpty()) { - if (!typeProcessorMap.containsKey(affinityGroupType)) { - throw new InvalidParameterValueException("Unable to create affinity group, invalid affinity group type" - + affinityGroupType); - } - } else { - throw new InvalidParameterValueException( - "Unable to create affinity group, no Affinity Group Types configured"); - } - - final AffinityGroupProcessor processor = typeProcessorMap.get(affinityGroupType); - - if (processor.isAdminControlledGroup() && !_accountMgr.isRootAdmin(caller.getType())) { - throw new PermissionDeniedException("Cannot create the affinity group"); - } - - ControlledEntity.ACLType aclType = null; - Account owner = null; - boolean domainLevel = false; - - if (account != null && domainId != null) { - - owner = _accountMgr.finalizeOwner(caller, account, domainId, null); - aclType = ControlledEntity.ACLType.Account; - - } else if (domainId != null && account == null) { - - if (!_accountMgr.isRootAdmin(caller.getType())) { - // non root admin need to pass both account and domain - throw new InvalidParameterValueException( - "Unable to create affinity group, account name must be passed with the domainId"); - } else if (!processor.canBeSharedDomainWide()) { - // cannot be domain level - throw new InvalidParameterValueException("Unable to create affinity group, account name is needed"); - } - - DomainVO domain = _domainDao.findById(domainId); - if (domain == null) { - throw new InvalidParameterValueException("Unable to find domain by specified id"); - } - _accountMgr.checkAccess(caller, domain); - - // domain level group, owner is SYSTEM. - owner = _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM); - aclType = ControlledEntity.ACLType.Domain; - domainLevel = true; - - } else { - owner = caller; - aclType = ControlledEntity.ACLType.Account; - } - - if (_affinityGroupDao.isNameInUse(owner.getAccountId(), owner.getDomainId(), affinityGroupName)) { - throw new InvalidParameterValueException("Unable to create affinity group, a group with name " - + affinityGroupName + " already exisits."); - } - if (domainLevel && _affinityGroupDao.findDomainLevelGroupByName(domainId, affinityGroupName) != null) { - throw new InvalidParameterValueException("Unable to create affinity group, a group with name " - + affinityGroupName + " already exisits under the domain."); - } - - final Account ownerFinal = owner; - final ControlledEntity.ACLType aclTypeFinal = aclType; - AffinityGroupVO group = Transaction.execute(new TransactionCallback() { - @Override - public AffinityGroupVO doInTransaction(TransactionStatus status) { - AffinityGroupVO group = new AffinityGroupVO(affinityGroupName, affinityGroupType, description, ownerFinal.getDomainId(), - ownerFinal.getId(), aclTypeFinal); - _affinityGroupDao.persist(group); - - if (domainId != null && aclTypeFinal == ACLType.Domain) { - boolean subDomainAccess = false; - subDomainAccess = processor.subDomainAccess(); - AffinityGroupDomainMapVO domainMap = new AffinityGroupDomainMapVO(group.getId(), domainId, subDomainAccess); - _affinityGroupDomainMapDao.persist(domainMap); - } - - return group; - } - }); - - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Created affinity group =" + affinityGroupName); - } - - return group; - } - - - @DB - @Override - @ActionEvent(eventType = EventTypes.EVENT_AFFINITY_GROUP_DELETE, eventDescription = "Deleting affinity group") - public boolean deleteAffinityGroup(Long affinityGroupId, String account, Long domainId, String affinityGroupName) { - - Account caller = CallContext.current().getCallingAccount(); - Account owner = _accountMgr.finalizeOwner(caller, account, domainId, null); - - AffinityGroupVO group = null; - if (affinityGroupId != null) { - group = _affinityGroupDao.findById(affinityGroupId); - if (group == null) { - throw new InvalidParameterValueException("Unable to find affinity group: " + affinityGroupId - + "; failed to delete group."); - } - } else if (affinityGroupName != null) { - group = _affinityGroupDao.findByAccountAndName(owner.getAccountId(), affinityGroupName); - if (group == null) { - throw new InvalidParameterValueException("Unable to find affinity group: " + affinityGroupName - + "; failed to delete group."); - } - } else { - throw new InvalidParameterValueException( - "Either the affinity group Id or group name must be specified to delete the group"); - } - if (affinityGroupId == null) { - affinityGroupId = group.getId(); - } - // check permissions - _accountMgr.checkAccess(caller, AccessType.ModifyEntry, true, group); - - final Long affinityGroupIdFinal = affinityGroupId; - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - - AffinityGroupVO group = _affinityGroupDao.lockRow(affinityGroupIdFinal, true); - if (group == null) { - throw new InvalidParameterValueException("Unable to find affinity group by id " + affinityGroupIdFinal); - } - - List affinityGroupVmMap = _affinityGroupVMMapDao.listByAffinityGroup(affinityGroupIdFinal); - if (!affinityGroupVmMap.isEmpty()) { - SearchBuilder listByAffinityGroup = _affinityGroupVMMapDao.createSearchBuilder(); - listByAffinityGroup.and("affinityGroupId", listByAffinityGroup.entity().getAffinityGroupId(), - SearchCriteria.Op.EQ); - listByAffinityGroup.done(); - SearchCriteria sc = listByAffinityGroup.create(); - sc.setParameters("affinityGroupId", affinityGroupIdFinal); - - _affinityGroupVMMapDao.lockRows(sc, null, true); - _affinityGroupVMMapDao.remove(sc); - } - - // call processor to handle the group delete - AffinityGroupProcessor processor = getAffinityGroupProcessorForType(group.getType()); - if (processor != null) { - processor.handleDeleteGroup(group); - } - - _affinityGroupDao.expunge(affinityGroupIdFinal); - } - }); - - if (s_logger.isDebugEnabled()) { - s_logger.debug("Deleted affinity group id=" + affinityGroupId); - } - return true; - } - - @Override - public Pair, Integer> listAffinityGroups(Long affinityGroupId, String affinityGroupName, String affinityGroupType, Long vmId, Long startIndex, Long pageSize) { - Filter searchFilter = new Filter(AffinityGroupVO.class, "id", Boolean.TRUE, startIndex, pageSize); - - Account caller = CallContext.current().getCallingAccount(); - - Long accountId = caller.getAccountId(); - Long domainId = caller.getDomainId(); - - SearchBuilder vmInstanceSearch = _affinityGroupVMMapDao.createSearchBuilder(); - vmInstanceSearch.and("instanceId", vmInstanceSearch.entity().getInstanceId(), SearchCriteria.Op.EQ); - - SearchBuilder groupSearch = _affinityGroupDao.createSearchBuilder(); - - SearchCriteria sc = groupSearch.create(); - - if (accountId != null) { - sc.addAnd("accountId", SearchCriteria.Op.EQ, accountId); - } - - if (domainId != null) { - sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); - } - - if (affinityGroupId != null) { - sc.addAnd("id", SearchCriteria.Op.EQ, affinityGroupId); - } - - if (affinityGroupName != null) { - sc.addAnd("name", SearchCriteria.Op.EQ, affinityGroupName); - } - - if (affinityGroupType != null) { - sc.addAnd("type", SearchCriteria.Op.EQ, affinityGroupType); - } - - if (vmId != null) { - UserVmVO userVM = _userVmDao.findById(vmId); - if (userVM == null) { - throw new InvalidParameterValueException("Unable to list affinity groups for virtual machine instance " - + vmId + "; instance not found."); - } - _accountMgr.checkAccess(caller, null, true, userVM); - // add join to affinity_groups_vm_map - groupSearch.join("vmInstanceSearch", vmInstanceSearch, groupSearch.entity().getId(), vmInstanceSearch - .entity().getAffinityGroupId(), JoinBuilder.JoinType.INNER); - sc.setJoinParameters("vmInstanceSearch", "instanceId", vmId); - } - - Pair, Integer> result = _affinityGroupDao.searchAndCount(sc, searchFilter); - return new Pair, Integer>(result.first(), result.second()); - } - - - @Override - public List listAffinityGroupTypes() { - Account caller = CallContext.current().getCallingAccount(); - - List types = new ArrayList(); - Map componentMap = ComponentContext.getComponentsOfType(AffinityGroupProcessor.class); - - if (componentMap.size() > 0) { - for (Entry entry : componentMap.entrySet()) { - AffinityGroupProcessor processor = entry.getValue(); - if (processor.isAdminControlledGroup()) { - continue; // we dont list the type if this group can be - // created only as an admin/system operation. - } - types.add(processor.getType()); - } - - } - return types; - } - - protected Map getAffinityTypeToProcessorMap() { - Map typeProcessorMap = new HashMap(); - Map componentMap = ComponentContext - .getComponentsOfType(AffinityGroupProcessor.class); - - if (componentMap.size() > 0) { - for (Entry entry : componentMap.entrySet()) { - typeProcessorMap.put(entry.getValue().getType(), entry.getValue()); - } - } - return typeProcessorMap; - } - - @Override - public boolean isAdminControlledGroup(AffinityGroup group) { - - if (group != null) { - String affinityGroupType = group.getType(); - Map typeProcessorMap = getAffinityTypeToProcessorMap(); - if (typeProcessorMap != null && !typeProcessorMap.isEmpty()) { - AffinityGroupProcessor processor = typeProcessorMap.get(affinityGroupType); - if (processor != null) { - return processor.isAdminControlledGroup(); - } - } - } - return false; - - } - - @Override - public boolean configure(final String name, final Map params) throws ConfigurationException { - _name = name; - VirtualMachine.State.getStateMachine().registerListener(this); - return true; - } - - @Override - public boolean start() { - return true; - } - - @Override - public boolean stop() { - return true; - } - - @Override - public String getName() { - return _name; - } - - @Override - public AffinityGroup getAffinityGroup(Long groupId) { - return _affinityGroupDao.findById(groupId); - } - - @Override - public boolean preStateTransitionEvent(State oldState, Event event, State newState, VirtualMachine vo, - boolean status, Object opaque) { - return true; - } - - @Override - public boolean postStateTransitionEvent(State oldState, Event event, State newState, VirtualMachine vo, - boolean status, Object opaque) { - if (!status) { - return false; - } - if ((newState == State.Expunging) || (newState == State.Error)) { - // cleanup all affinity groups associations of the Expunged VM - SearchCriteria sc = _affinityGroupVMMapDao.createSearchCriteria(); - sc.addAnd("instanceId", SearchCriteria.Op.EQ, vo.getId()); - _affinityGroupVMMapDao.expunge(sc); - } - return true; - } - - @Override - public UserVm updateVMAffinityGroups(Long vmId, List affinityGroupIds) { - // Verify input parameters - UserVmVO vmInstance = _userVmDao.findById(vmId); - if (vmInstance == null) { - throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); - } - - // Check that the VM is stopped - if (!vmInstance.getState().equals(State.Stopped)) { - s_logger.warn("Unable to update affinity groups of the virtual machine " + vmInstance.toString() - + " in state " + vmInstance.getState()); - throw new InvalidParameterValueException("Unable update affinity groups of the virtual machine " - + vmInstance.toString() + " " + "in state " + vmInstance.getState() - + "; make sure the virtual machine is stopped and not in an error state before updating."); - } - - Account caller = CallContext.current().getCallingAccount(); - Account owner = _accountMgr.getAccount(vmInstance.getAccountId()); - - // check that the affinity groups exist - for (Long affinityGroupId : affinityGroupIds) { - AffinityGroupVO ag = _affinityGroupDao.findById(affinityGroupId); - if (ag == null) { - throw new InvalidParameterValueException("Unable to find affinity group by id " + affinityGroupId); - } else { - // verify permissions - _accountMgr.checkAccess(caller, null, true, owner, ag); - // Root admin has access to both VM and AG by default, but make sure the - // owner of these entities is same - if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getType())) { - if (ag.getAccountId() != owner.getAccountId()) { - throw new PermissionDeniedException("Affinity Group " + ag - + " does not belong to the VM's account"); - } - } - } - } - _affinityGroupVMMapDao.updateMap(vmId, affinityGroupIds); - if (s_logger.isDebugEnabled()) { - s_logger.debug("Updated VM :" + vmId + " affinity groups to =" + affinityGroupIds); - } - // APIResponseHelper will pull out the updated affinitygroups. - return vmInstance; - - } - - @Override - public boolean isAffinityGroupProcessorAvailable(String affinityGroupType) { - for (AffinityGroupProcessor processor : _affinityProcessors) { - if (affinityGroupType != null && affinityGroupType.equals(processor.getType())) { - return true; - } - } - return false; - } - - private AffinityGroupProcessor getAffinityGroupProcessorForType(String affinityGroupType) { - for (AffinityGroupProcessor processor : _affinityProcessors) { - if (affinityGroupType != null && affinityGroupType.equals(processor.getType())) { - return processor; - } - } - return null; - } - - @Override - public boolean isAffinityGroupAvailableInDomain(long affinityGroupId, long domainId) { - Long groupDomainId = null; - - AffinityGroupDomainMapVO domainMap = _affinityGroupDomainMapDao.findByAffinityGroup(affinityGroupId); - if (domainMap == null) { - return false; - } else { - groupDomainId = domainMap.getDomainId(); - } - - if (domainId == groupDomainId.longValue()) { - return true; - } - - if (domainMap.subdomainAccess) { - Set parentDomains = _domainMgr.getDomainParentIds(domainId); - if (parentDomains.contains(groupDomainId)) { - return true; - } - } - - return false; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.affinity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + +import javax.ejb.Local; +import javax.inject.Inject; +import javax.naming.ConfigurationException; + +import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.acl.ControlledEntity.ACLType; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; +import org.apache.cloudstack.affinity.dao.AffinityGroupDao; +import org.apache.cloudstack.affinity.dao.AffinityGroupDomainMapDao; +import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; +import org.springframework.context.annotation.Primary; +import com.cloud.deploy.DeploymentPlanner; +import com.cloud.domain.DomainVO; +import com.cloud.domain.dao.DomainDao; +import com.cloud.event.ActionEvent; +import com.cloud.event.EventTypes; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.exception.PermissionDeniedException; +import com.cloud.exception.ResourceInUseException; +import com.cloud.network.Network; +import com.cloud.network.dao.NetworkDomainVO; +import com.cloud.network.security.SecurityGroup; +import com.cloud.user.Account; +import com.cloud.user.AccountManager; +import com.cloud.user.DomainManager; +import com.cloud.uservm.UserVm; +import com.cloud.utils.Pair; +import com.cloud.utils.component.Manager; +import com.cloud.utils.component.ManagerBase; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.JoinBuilder; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; +import com.cloud.utils.db.TransactionCallback; +import com.cloud.utils.db.TransactionCallbackNoReturn; +import com.cloud.utils.db.TransactionStatus; +import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.utils.fsm.StateListener; +import com.cloud.vm.UserVmVO; +import com.cloud.vm.VirtualMachine; +import com.cloud.vm.VirtualMachine.Event; +import com.cloud.vm.VirtualMachine.State; +import com.cloud.vm.dao.UserVmDao; + +@Local(value = { AffinityGroupService.class }) +public class AffinityGroupServiceImpl extends ManagerBase implements AffinityGroupService, Manager, + StateListener { + + public static final Logger s_logger = Logger.getLogger(AffinityGroupServiceImpl.class); + private String _name; + + @Inject + AccountManager _accountMgr; + + @Inject + AffinityGroupDao _affinityGroupDao; + + @Inject + AffinityGroupVMMapDao _affinityGroupVMMapDao; + + @Inject + AffinityGroupDomainMapDao _affinityGroupDomainMapDao; + + @Inject + private UserVmDao _userVmDao; + + @Inject + DomainDao _domainDao; + + @Inject + DomainManager _domainMgr; + + protected List _affinityProcessors; + + public List getAffinityGroupProcessors() { + return _affinityProcessors; + } + + public void setAffinityGroupProcessors(List affinityProcessors) { + this._affinityProcessors = affinityProcessors; + } + + @DB + @Override + @ActionEvent(eventType = EventTypes.EVENT_AFFINITY_GROUP_CREATE, eventDescription = "Creating Affinity Group", create = true) + public AffinityGroup createAffinityGroup(String account, Long domainId, String affinityGroupName, + String affinityGroupType, String description) { + + Account caller = CallContext.current().getCallingAccount(); + + //validate the affinityGroupType + Map typeProcessorMap = getAffinityTypeToProcessorMap(); + if (typeProcessorMap != null && !typeProcessorMap.isEmpty()) { + if (!typeProcessorMap.containsKey(affinityGroupType)) { + throw new InvalidParameterValueException("Unable to create affinity group, invalid affinity group type" + + affinityGroupType); + } + } else { + throw new InvalidParameterValueException( + "Unable to create affinity group, no Affinity Group Types configured"); + } + + AffinityGroupProcessor processor = typeProcessorMap.get(affinityGroupType); + + if (processor.isAdminControlledGroup()) { + throw new PermissionDeniedException("Cannot create the affinity group"); + } + + return createAffinityGroupInternal(account, domainId, affinityGroupName, affinityGroupType, description); + } + + @DB + @Override + public AffinityGroup createAffinityGroupInternal(String account, final Long domainId, final String affinityGroupName, + final String affinityGroupType, final String description) { + + Account caller = CallContext.current().getCallingAccount(); + + // validate the affinityGroupType + Map typeProcessorMap = getAffinityTypeToProcessorMap(); + if (typeProcessorMap != null && !typeProcessorMap.isEmpty()) { + if (!typeProcessorMap.containsKey(affinityGroupType)) { + throw new InvalidParameterValueException("Unable to create affinity group, invalid affinity group type" + + affinityGroupType); + } + } else { + throw new InvalidParameterValueException( + "Unable to create affinity group, no Affinity Group Types configured"); + } + + final AffinityGroupProcessor processor = typeProcessorMap.get(affinityGroupType); + + if (processor.isAdminControlledGroup() && !_accountMgr.isRootAdmin(caller.getType())) { + throw new PermissionDeniedException("Cannot create the affinity group"); + } + + ControlledEntity.ACLType aclType = null; + Account owner = null; + boolean domainLevel = false; + + if (account != null && domainId != null) { + + owner = _accountMgr.finalizeOwner(caller, account, domainId, null); + aclType = ControlledEntity.ACLType.Account; + + } else if (domainId != null && account == null) { + + if (!_accountMgr.isRootAdmin(caller.getType())) { + // non root admin need to pass both account and domain + throw new InvalidParameterValueException( + "Unable to create affinity group, account name must be passed with the domainId"); + } else if (!processor.canBeSharedDomainWide()) { + // cannot be domain level + throw new InvalidParameterValueException("Unable to create affinity group, account name is needed"); + } + + DomainVO domain = _domainDao.findById(domainId); + if (domain == null) { + throw new InvalidParameterValueException("Unable to find domain by specified id"); + } + _accountMgr.checkAccess(caller, domain); + + // domain level group, owner is SYSTEM. + owner = _accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM); + aclType = ControlledEntity.ACLType.Domain; + domainLevel = true; + + } else { + owner = caller; + aclType = ControlledEntity.ACLType.Account; + } + + if (_affinityGroupDao.isNameInUse(owner.getAccountId(), owner.getDomainId(), affinityGroupName)) { + throw new InvalidParameterValueException("Unable to create affinity group, a group with name " + + affinityGroupName + " already exisits."); + } + if (domainLevel && _affinityGroupDao.findDomainLevelGroupByName(domainId, affinityGroupName) != null) { + throw new InvalidParameterValueException("Unable to create affinity group, a group with name " + + affinityGroupName + " already exisits under the domain."); + } + + final Account ownerFinal = owner; + final ControlledEntity.ACLType aclTypeFinal = aclType; + AffinityGroupVO group = Transaction.execute(new TransactionCallback() { + @Override + public AffinityGroupVO doInTransaction(TransactionStatus status) { + AffinityGroupVO group = new AffinityGroupVO(affinityGroupName, affinityGroupType, description, ownerFinal.getDomainId(), + ownerFinal.getId(), aclTypeFinal); + _affinityGroupDao.persist(group); + + if (domainId != null && aclTypeFinal == ACLType.Domain) { + boolean subDomainAccess = false; + subDomainAccess = processor.subDomainAccess(); + AffinityGroupDomainMapVO domainMap = new AffinityGroupDomainMapVO(group.getId(), domainId, subDomainAccess); + _affinityGroupDomainMapDao.persist(domainMap); + } + + return group; + } + }); + + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Created affinity group =" + affinityGroupName); + } + + return group; + } + + + @DB + @Override + @ActionEvent(eventType = EventTypes.EVENT_AFFINITY_GROUP_DELETE, eventDescription = "Deleting affinity group") + public boolean deleteAffinityGroup(Long affinityGroupId, String account, Long domainId, String affinityGroupName) { + + Account caller = CallContext.current().getCallingAccount(); + Account owner = _accountMgr.finalizeOwner(caller, account, domainId, null); + + AffinityGroupVO group = null; + if (affinityGroupId != null) { + group = _affinityGroupDao.findById(affinityGroupId); + if (group == null) { + throw new InvalidParameterValueException("Unable to find affinity group: " + affinityGroupId + + "; failed to delete group."); + } + } else if (affinityGroupName != null) { + group = _affinityGroupDao.findByAccountAndName(owner.getAccountId(), affinityGroupName); + if (group == null) { + throw new InvalidParameterValueException("Unable to find affinity group: " + affinityGroupName + + "; failed to delete group."); + } + } else { + throw new InvalidParameterValueException( + "Either the affinity group Id or group name must be specified to delete the group"); + } + if (affinityGroupId == null) { + affinityGroupId = group.getId(); + } + // check permissions + _accountMgr.checkAccess(caller, AccessType.ModifyEntry, true, group); + + final Long affinityGroupIdFinal = affinityGroupId; + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + + AffinityGroupVO group = _affinityGroupDao.lockRow(affinityGroupIdFinal, true); + if (group == null) { + throw new InvalidParameterValueException("Unable to find affinity group by id " + affinityGroupIdFinal); + } + + List affinityGroupVmMap = _affinityGroupVMMapDao.listByAffinityGroup(affinityGroupIdFinal); + if (!affinityGroupVmMap.isEmpty()) { + SearchBuilder listByAffinityGroup = _affinityGroupVMMapDao.createSearchBuilder(); + listByAffinityGroup.and("affinityGroupId", listByAffinityGroup.entity().getAffinityGroupId(), + SearchCriteria.Op.EQ); + listByAffinityGroup.done(); + SearchCriteria sc = listByAffinityGroup.create(); + sc.setParameters("affinityGroupId", affinityGroupIdFinal); + + _affinityGroupVMMapDao.lockRows(sc, null, true); + _affinityGroupVMMapDao.remove(sc); + } + + // call processor to handle the group delete + AffinityGroupProcessor processor = getAffinityGroupProcessorForType(group.getType()); + if (processor != null) { + processor.handleDeleteGroup(group); + } + + _affinityGroupDao.expunge(affinityGroupIdFinal); + } + }); + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Deleted affinity group id=" + affinityGroupId); + } + return true; + } + + @Override + public Pair, Integer> listAffinityGroups(Long affinityGroupId, String affinityGroupName, String affinityGroupType, Long vmId, Long startIndex, Long pageSize) { + Filter searchFilter = new Filter(AffinityGroupVO.class, "id", Boolean.TRUE, startIndex, pageSize); + + Account caller = CallContext.current().getCallingAccount(); + + Long accountId = caller.getAccountId(); + Long domainId = caller.getDomainId(); + + SearchBuilder vmInstanceSearch = _affinityGroupVMMapDao.createSearchBuilder(); + vmInstanceSearch.and("instanceId", vmInstanceSearch.entity().getInstanceId(), SearchCriteria.Op.EQ); + + SearchBuilder groupSearch = _affinityGroupDao.createSearchBuilder(); + + SearchCriteria sc = groupSearch.create(); + + if (accountId != null) { + sc.addAnd("accountId", SearchCriteria.Op.EQ, accountId); + } + + if (domainId != null) { + sc.addAnd("domainId", SearchCriteria.Op.EQ, domainId); + } + + if (affinityGroupId != null) { + sc.addAnd("id", SearchCriteria.Op.EQ, affinityGroupId); + } + + if (affinityGroupName != null) { + sc.addAnd("name", SearchCriteria.Op.EQ, affinityGroupName); + } + + if (affinityGroupType != null) { + sc.addAnd("type", SearchCriteria.Op.EQ, affinityGroupType); + } + + if (vmId != null) { + UserVmVO userVM = _userVmDao.findById(vmId); + if (userVM == null) { + throw new InvalidParameterValueException("Unable to list affinity groups for virtual machine instance " + + vmId + "; instance not found."); + } + _accountMgr.checkAccess(caller, null, true, userVM); + // add join to affinity_groups_vm_map + groupSearch.join("vmInstanceSearch", vmInstanceSearch, groupSearch.entity().getId(), vmInstanceSearch + .entity().getAffinityGroupId(), JoinBuilder.JoinType.INNER); + sc.setJoinParameters("vmInstanceSearch", "instanceId", vmId); + } + + Pair, Integer> result = _affinityGroupDao.searchAndCount(sc, searchFilter); + return new Pair, Integer>(result.first(), result.second()); + } + + + @Override + public List listAffinityGroupTypes() { + List types = new ArrayList(); + + for (AffinityGroupProcessor processor : _affinityProcessors) { + if (processor.isAdminControlledGroup()) { + continue; // we dont list the type if this group can be + // created only as an admin/system operation. + } + types.add(processor.getType()); + } + + return types; + } + + protected Map getAffinityTypeToProcessorMap() { + Map typeProcessorMap = new HashMap(); + + for (AffinityGroupProcessor processor : _affinityProcessors) { + typeProcessorMap.put(processor.getType(), processor); + } + + return typeProcessorMap; + } + + @Override + public boolean isAdminControlledGroup(AffinityGroup group) { + + if (group != null) { + String affinityGroupType = group.getType(); + Map typeProcessorMap = getAffinityTypeToProcessorMap(); + if (typeProcessorMap != null && !typeProcessorMap.isEmpty()) { + AffinityGroupProcessor processor = typeProcessorMap.get(affinityGroupType); + if (processor != null) { + return processor.isAdminControlledGroup(); + } + } + } + return false; + + } + + @Override + public boolean configure(final String name, final Map params) throws ConfigurationException { + _name = name; + VirtualMachine.State.getStateMachine().registerListener(this); + return true; + } + + @Override + public boolean start() { + return true; + } + + @Override + public boolean stop() { + return true; + } + + @Override + public String getName() { + return _name; + } + + @Override + public AffinityGroup getAffinityGroup(Long groupId) { + return _affinityGroupDao.findById(groupId); + } + + @Override + public boolean preStateTransitionEvent(State oldState, Event event, State newState, VirtualMachine vo, + boolean status, Object opaque) { + return true; + } + + @Override + public boolean postStateTransitionEvent(State oldState, Event event, State newState, VirtualMachine vo, + boolean status, Object opaque) { + if (!status) { + return false; + } + if ((newState == State.Expunging) || (newState == State.Error)) { + // cleanup all affinity groups associations of the Expunged VM + SearchCriteria sc = _affinityGroupVMMapDao.createSearchCriteria(); + sc.addAnd("instanceId", SearchCriteria.Op.EQ, vo.getId()); + _affinityGroupVMMapDao.expunge(sc); + } + return true; + } + + @Override + public UserVm updateVMAffinityGroups(Long vmId, List affinityGroupIds) { + // Verify input parameters + UserVmVO vmInstance = _userVmDao.findById(vmId); + if (vmInstance == null) { + throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); + } + + // Check that the VM is stopped + if (!vmInstance.getState().equals(State.Stopped)) { + s_logger.warn("Unable to update affinity groups of the virtual machine " + vmInstance.toString() + + " in state " + vmInstance.getState()); + throw new InvalidParameterValueException("Unable update affinity groups of the virtual machine " + + vmInstance.toString() + " " + "in state " + vmInstance.getState() + + "; make sure the virtual machine is stopped and not in an error state before updating."); + } + + Account caller = CallContext.current().getCallingAccount(); + Account owner = _accountMgr.getAccount(vmInstance.getAccountId()); + + // check that the affinity groups exist + for (Long affinityGroupId : affinityGroupIds) { + AffinityGroupVO ag = _affinityGroupDao.findById(affinityGroupId); + if (ag == null) { + throw new InvalidParameterValueException("Unable to find affinity group by id " + affinityGroupId); + } else { + // verify permissions + _accountMgr.checkAccess(caller, null, true, owner, ag); + // Root admin has access to both VM and AG by default, but make sure the + // owner of these entities is same + if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getType())) { + if (ag.getAccountId() != owner.getAccountId()) { + throw new PermissionDeniedException("Affinity Group " + ag + + " does not belong to the VM's account"); + } + } + } + } + _affinityGroupVMMapDao.updateMap(vmId, affinityGroupIds); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Updated VM :" + vmId + " affinity groups to =" + affinityGroupIds); + } + // APIResponseHelper will pull out the updated affinitygroups. + return vmInstance; + + } + + @Override + public boolean isAffinityGroupProcessorAvailable(String affinityGroupType) { + for (AffinityGroupProcessor processor : _affinityProcessors) { + if (affinityGroupType != null && affinityGroupType.equals(processor.getType())) { + return true; + } + } + return false; + } + + private AffinityGroupProcessor getAffinityGroupProcessorForType(String affinityGroupType) { + for (AffinityGroupProcessor processor : _affinityProcessors) { + if (affinityGroupType != null && affinityGroupType.equals(processor.getType())) { + return processor; + } + } + return null; + } + + @Override + public boolean isAffinityGroupAvailableInDomain(long affinityGroupId, long domainId) { + Long groupDomainId = null; + + AffinityGroupDomainMapVO domainMap = _affinityGroupDomainMapDao.findByAffinityGroup(affinityGroupId); + if (domainMap == null) { + return false; + } else { + groupDomainId = domainMap.getDomainId(); + } + + if (domainId == groupDomainId.longValue()) { + return true; + } + + if (domainMap.subdomainAccess) { + Set parentDomains = _domainMgr.getDomainParentIds(domainId); + if (parentDomains.contains(groupDomainId)) { + return true; + } + } + + return false; + } + +} From cb6d8d01901c00134d63d4a39172128582d378fc Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Thu, 7 Nov 2013 21:22:03 -0800 Subject: [PATCH 079/108] CLOUDSTACK-5045 [Automation][BVT] Affinity group type is missing "create affinity group page" and failed to create Affinity group Changes: - Changes to Unit tests needed after this fix. --- .../apache/cloudstack/affinity/AffinityApiUnitTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java b/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java index 97e093ff415..91d6958ff61 100644 --- a/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java +++ b/server/test/org/apache/cloudstack/affinity/AffinityApiUnitTest.java @@ -63,6 +63,7 @@ import org.apache.cloudstack.test.utils.SpringUtils; import com.cloud.dc.dao.DedicatedResourceDao; import com.cloud.event.ActionEventUtils; import com.cloud.dc.dao.DedicatedResourceDao; +import com.cloud.deploy.DeploymentPlanner; import com.cloud.domain.dao.DomainDao; import com.cloud.event.ActionEventUtils; import com.cloud.event.EventVO; @@ -88,7 +89,7 @@ import com.cloud.vm.dao.UserVmDao; public class AffinityApiUnitTest { @Inject - AffinityGroupService _affinityService; + AffinityGroupServiceImpl _affinityService; @Inject AccountManager _acctMgr; @@ -144,6 +145,10 @@ public class AffinityApiUnitTest { when(_processor.getType()).thenReturn("mock"); when(_accountDao.findByIdIncludingRemoved(0L)).thenReturn(acct); + List affinityProcessors = new ArrayList(); + affinityProcessors.add(_processor); + _affinityService.setAffinityGroupProcessors(affinityProcessors); + AffinityGroupVO group = new AffinityGroupVO("group1", "mock", "mock group", domainId, 200L, ControlledEntity.ACLType.Account); Mockito.when(_affinityGroupDao.persist(Mockito.any(AffinityGroupVO.class))).thenReturn(group); From 3c350ab0b8ce1687a8f7e27e9e2f8e8d0fa68c47 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Fri, 8 Nov 2013 12:48:37 +0530 Subject: [PATCH 080/108] CLOUDSTACK-4648: Fixed Snapshots test cases Fixed following test cases: 1) test_01_volume_from_snapshot 2) test_03_snapshot_detachedDisk 3) test_07_template_from_snapshot All three test cases are running successfully on XenServer but test cases (01 and 07) failing on KVM due to a common issue. Product defect logged for this: https://issues.apache.org/jira/browse/CLOUDSTACK-5097 test_03 is running ok on KVM too, the problem was - disk was not getting detached because it was not unmounted before detaching. Added code to unmount the disk. Signed-off-by: Girish Shilamkar --- test/integration/component/test_snapshots.py | 158 +++++++++++++----- tools/marvin/marvin/integration/lib/common.py | 13 ++ 2 files changed, 126 insertions(+), 45 deletions(-) diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index 1c2537c8e3a..0a82fc10600 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -17,13 +17,35 @@ """ P1 tests for Snapshots """ #Import Local Modules -from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from marvin.integration.lib.utils import * -from marvin.integration.lib.base import * -from marvin.integration.lib.common import * -from marvin.integration.lib.utils import is_snapshot_on_nfs +from nose.plugins.attrib import attr +from marvin.cloudstackTestCase import cloudstackTestCase, unittest + +from marvin.integration.lib.base import (Snapshot, + Template, + VirtualMachine, + Account, + ServiceOffering, + DiskOffering, + Volume) + +from marvin.integration.lib.common import (get_domain, + get_zone, + get_template, + list_events, + list_volumes, + list_snapshots, + list_templates, + list_virtual_machines, + get_hypervisor_type) + +from marvin.integration.lib.utils import (cleanup_resources, + format_volume_to_ext3, + random_gen, + is_snapshot_on_nfs) + +from marvin.cloudstackAPI import detachVolume +import time + class Services: @@ -104,7 +126,18 @@ class Services: "volume": { "diskname": "APP Data Volume", "size": 1, # in GBs - "diskdevice": ['/dev/xvdb', '/dev/sdb', '/dev/hdb', '/dev/vdb' ], # Data Disk + "xenserver": {"rootdiskdevice":"/dev/xvda", + "datadiskdevice_1": '/dev/xvdb', + "datadiskdevice_2": '/dev/xvdc', # Data Disk + }, + "kvm": {"rootdiskdevice": "/dev/vda", + "datadiskdevice_1": "/dev/vdb", + "datadiskdevice_2": "/dev/vdc" + }, + "vmware": {"rootdiskdevice": "/dev/hda", + "datadiskdevice_1": "/dev/hdb", + "datadiskdevice_2": "/dev/hdc" + } }, "paths": { "mount_dir": "/mnt/tmp", @@ -139,7 +172,7 @@ class TestSnapshots(cloudstackTestCase): cls.zone.id, cls.services["ostype"] ) - + cls.services["domainid"] = cls.domain.id cls.services["volume"]["zoneid"] = cls.services["server_with_disk"]["zoneid"] = cls.zone.id cls.services["server_with_disk"]["diskoffering"] = cls.disk_offering.id @@ -174,6 +207,9 @@ class TestSnapshots(cloudstackTestCase): mode=cls.services["mode"] ) + # Get Hypervisor Type + cls.hypervisor = (get_hypervisor_type(cls.api_client)).lower() + cls._cleanup = [ cls.service_offering, cls.disk_offering, @@ -259,15 +295,24 @@ class TestSnapshots(cloudstackTestCase): # Validate the following #1. Create a virtual machine and data volume #2. Attach data volume to VM - #3. Login to machine; create temp/test directories on data volume + #3. Login to machine; create temp/test directories on data volume and write some random data #4. Snapshot the Volume #5. Create another Volume from snapshot - #6. Mount/Attach volume to another server - #7. Compare data + #6. Mount/Attach volume to another virtual machine + #7. Compare data, data should match random_data_0 = random_gen(size=100) random_data_1 = random_gen(size=100) + self.debug("random_data_0 : %s" % random_data_0) + self.debug("random_data_1: %s" % random_data_1) + + try: + ssh_client = self.virtual_machine.get_ssh_client() + except Exception as e: + self.fail("SSH failed for VM: %s" % + self.virtual_machine.ipaddress) + volume = Volume.create( self.apiclient, self.services["volume"], @@ -285,22 +330,18 @@ class TestSnapshots(cloudstackTestCase): (volume.id, self.virtual_machine.id)) - try: - ssh_client = self.virtual_machine.get_ssh_client() - except Exception as e: - self.fail("SSH failed for VM: %s" % - self.virtual_machine.ipaddress) - self.debug("Formatting volume: %s to ext3" % volume.id) #Format partition using ext3 + # Note that this is the second data disk partition of virtual machine as it was already containing + # data disk before attaching the new volume, Hence datadiskdevice_2 format_volume_to_ext3( ssh_client, - self.services["volume"]["diskdevice"] + self.services["volume"][self.hypervisor]["datadiskdevice_2"] ) - cmds = [ + cmds = [ "fdisk -l", "mkdir -p %s" % self.services["paths"]["mount_dir"], - "mount %s1 %s" % ( - self.services["volume"]["diskdevice"], + "mount -t ext3 %s1 %s" % ( + self.services["volume"][self.hypervisor]["datadiskdevice_2"], self.services["paths"]["mount_dir"] ), "mkdir -p %s/%s/{%s,%s} " % ( @@ -323,10 +364,17 @@ class TestSnapshots(cloudstackTestCase): self.services["paths"]["sub_lvl_dir2"], self.services["paths"]["random_data"] ), + "cat %s/%s/%s/%s" % ( + self.services["paths"]["mount_dir"], + self.services["paths"]["sub_dir"], + self.services["paths"]["sub_lvl_dir1"], + self.services["paths"]["random_data"] + ) ] for c in cmds: self.debug("Command: %s" % c) - ssh_client.execute(c) + result = ssh_client.execute(c) + self.debug(result) # Unmount the Sec Storage cmds = [ @@ -340,7 +388,7 @@ class TestSnapshots(cloudstackTestCase): self.apiclient, virtualmachineid=self.virtual_machine.id, type='DATADISK', - listall=True + id=volume.id ) self.assertEqual( @@ -365,6 +413,15 @@ class TestSnapshots(cloudstackTestCase): account=self.account.name, domainid=self.account.domainid ) + + # Detach the volume from virtual machine + self.virtual_machine.detach_volume( + self.apiclient, + volume + ) + self.debug("Detached volume: %s from VM: %s" % + (volume.id, self.virtual_machine.id)) + self.debug("Created Volume: %s from Snapshot: %s" % ( volume_from_snapshot.id, snapshot.id)) @@ -399,7 +456,7 @@ class TestSnapshots(cloudstackTestCase): mode=self.services["mode"] ) self.debug("Deployed new VM for account: %s" % self.account.name) - self.cleanup.append(new_virtual_machine) + #self.cleanup.append(new_virtual_machine) self.debug("Attaching volume: %s to VM: %s" % ( volume_from_snapshot.id, @@ -411,21 +468,28 @@ class TestSnapshots(cloudstackTestCase): volume_from_snapshot ) + # Rebooting is required so that newly attached disks are detected + self.debug("Rebooting : %s" % new_virtual_machine.id) + + new_virtual_machine.reboot(self.apiclient) + try: #Login to VM to verify test directories and files ssh = new_virtual_machine.get_ssh_client() - cmds = [ + # Mount datadiskdevice_1 because this is the first data disk of the new virtual machine + cmds = ["fdisk -l", "mkdir -p %s" % self.services["paths"]["mount_dir"], - "mount %s1 %s" % ( - self.services["volume"]["diskdevice"], + "mount -t ext3 %s1 %s" % ( + self.services["volume"][self.hypervisor]["datadiskdevice_1"], self.services["paths"]["mount_dir"] ), ] for c in cmds: self.debug("Command: %s" % c) - ssh.execute(c) + result = ssh.execute(c) + self.debug(result) returned_data_0 = ssh.execute( "cat %s/%s/%s/%s" % ( @@ -442,8 +506,12 @@ class TestSnapshots(cloudstackTestCase): self.services["paths"]["random_data"] )) except Exception as e: - self.fail("SSH access failed for VM: %s" % - new_virtual_machine.ipaddress) + self.fail("SSH access failed for VM: %s, Exception: %s" % + (new_virtual_machine.ipaddress, e)) + + self.debug("returned_data_0: %s" % returned_data_0[0]) + self.debug("returned_data_1: %s" % returned_data_1[0]) + #Verify returned data self.assertEqual( random_data_0, @@ -512,7 +580,7 @@ class TestSnapshots(cloudstackTestCase): """ # Validate the following # 1. login in VM and write some data on data disk(use fdisk to - # partition datadisk,fdisk /dev/sdb, and make filesystem using + # partition datadisk,fdisk, and make filesystem using # mkfs.ext3) # 2. Detach the data disk and write some data on data disk # 3. perform the snapshot on the detached volume @@ -540,12 +608,12 @@ class TestSnapshots(cloudstackTestCase): #Format partition using ext3 format_volume_to_ext3( ssh_client, - self.services["volume"]["diskdevice"] + self.services["volume"][self.hypervisor]["datadiskdevice_1"] ) cmds = [ "mkdir -p %s" % self.services["paths"]["mount_dir"], "mount %s1 %s" % ( - self.services["volume"]["diskdevice"], + self.services["volume"][self.hypervisor]["datadiskdevice_1"], self.services["paths"]["mount_dir"] ), "pushd %s" % self.services["paths"]["mount_dir"], @@ -567,6 +635,7 @@ class TestSnapshots(cloudstackTestCase): self.services["paths"]["random_data"] ), "sync", + "umount %s" % (self.services["paths"]["mount_dir"]), ] for c in cmds: self.debug(ssh_client.execute(c)) @@ -641,7 +710,7 @@ class TestSnapshots(cloudstackTestCase): #3. Create Template from snapshot #4. Deploy Virtual machine using this template #5. Login to newly created virtual machine - #6. Compare data + #6. Compare data in the root disk with the one that was written on the volume, it should match random_data_0 = random_gen(size=100) random_data_1 = random_gen(size=100) @@ -653,7 +722,7 @@ class TestSnapshots(cloudstackTestCase): cmds = [ "mkdir -p %s" % self.services["paths"]["mount_dir"], "mount %s1 %s" % ( - self.services["volume"]["diskdevice"], + self.services["volume"][self.hypervisor]["rootdiskdevice"], self.services["paths"]["mount_dir"] ), "mkdir -p %s/%s/{%s,%s} " % ( @@ -767,7 +836,7 @@ class TestSnapshots(cloudstackTestCase): cmds = [ "mkdir -p %s" % self.services["paths"]["mount_dir"], "mount %s1 %s" % ( - self.services["volume"]["diskdevice"], + self.services["volume"][self.hypervisor]["rootdiskdevice"], self.services["paths"]["mount_dir"] ) ] @@ -813,8 +882,8 @@ class TestSnapshots(cloudstackTestCase): ssh_client.execute(c) except Exception as e: - self.fail("SSH failed for VM with IP address: %s" % - new_virtual_machine.ipaddress) + self.fail("SSH failed for VM with IP address: %s, Exception: %s" % + (new_virtual_machine.ipaddress, e)) return @@ -920,7 +989,7 @@ class TestCreateVMSnapshotTemplate(cloudstackTestCase): volume = volumes[0] # Create a snapshot from the ROOTDISK - snapshot = Snapshot.create(self.apiclient, volumes[0].id) + snapshot = Snapshot.create(self.apiclient, volume.id) self.debug("Snapshot created: ID - %s" % snapshot.id) self.cleanup.append(snapshot) @@ -1016,7 +1085,6 @@ class TestCreateVMSnapshotTemplate(cloudstackTestCase): self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, snapshot_uuid)) return - class TestSnapshotEvents(cloudstackTestCase): @classmethod @@ -1087,7 +1155,7 @@ class TestSnapshotEvents(cloudstackTestCase): except Exception as e: raise Exception("Warning: Exception during cleanup : %s" % e) return - + @attr(speed = "slow") @attr(tags = ["advanced", "advancedns"]) def test_05_snapshot_events(self): @@ -1113,7 +1181,7 @@ class TestSnapshotEvents(cloudstackTestCase): volume = volumes[0] # Create a snapshot from the ROOTDISK - snapshot = Snapshot.create(self.apiclient, volumes[0].id) + snapshot = Snapshot.create(self.apiclient, volume.id) self.debug("Snapshot created with ID: %s" % snapshot.id) snapshots = list_snapshots( diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py index 164ef2052dd..1386eaf7d96 100644 --- a/tools/marvin/marvin/integration/lib/common.py +++ b/tools/marvin/marvin/integration/lib/common.py @@ -22,6 +22,7 @@ from marvin.cloudstackAPI import * from marvin.remoteSSHClient import remoteSSHClient from utils import * from base import * +from marvin.codes import PASS #Import System modules import time @@ -198,6 +199,18 @@ def get_template(apiclient, zoneid, ostype, services=None): ostypeid) return +def get_hypervisor_type(apiclient): + + """Return the hypervisor type of the hosts in setup""" + + hosts = list_hosts(apiclient, type='Routing', listall=True) + + hosts_list_validation_result = validateList(hosts) + + assert hosts_list_validation_result[0] == PASS, "host list validation failed" + + return hosts_list_validation_result[1].hypervisor + def download_systemplates_sec_storage(server, services): """Download System templates on sec storage""" From 63b23bb341e86daf3b6407a1710c1b2a113b9088 Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Fri, 8 Nov 2013 13:11:32 +0530 Subject: [PATCH 081/108] Fixed VmSync issues in HyperV. --- .../HypervResource/CloudStackTypes.cs | 14 ++++++++++++++ .../HypervResource/HypervResourceController.cs | 4 ++++ .../ServerResource/HypervResource/IWmiCallsV2.cs | 1 + .../DotNet/ServerResource/HypervResource/Utils.cs | 10 ++++++++++ .../ServerResource/HypervResource/WmiCallsV2.cs | 13 +++++++++++++ 5 files changed, 42 insertions(+) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs index 41b2bac81b3..dfc3e206f06 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs @@ -396,6 +396,20 @@ namespace HypervResource } } + public class VmState + { + [JsonProperty("state")] + public String state; + [JsonProperty("host")] + String host; + public VmState() { } + public VmState(String vmState, String host) + { + this.state = vmState; + this.host = host; + } + } + public struct StoragePoolInfo { [JsonProperty("uuid")] diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs index 43b44dfa00b..6d5c599c2a3 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs @@ -31,6 +31,7 @@ using System.Net.Http; using System.Security.Cryptography; using System.Security.Principal; using System.Web.Http; +using CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2; namespace HypervResource { @@ -1449,6 +1450,9 @@ namespace HypervResource logger.Debug(CloudStackTypes.StartupStorageCommand + " set available bytes to " + available); string ipAddr = strtRouteCmd.privateIpAddress; + var vmStates = wmiCallsV2.GetVmSync(config.PrivateIpAddress); + strtRouteCmd.vms = Utils.CreateCloudStackMapObject(vmStates); + StoragePoolInfo pi = new StoragePoolInfo( poolGuid.ToString(), ipAddr, diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/IWmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/IWmiCallsV2.cs index 125c53ec384..223f7481071 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/IWmiCallsV2.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/IWmiCallsV2.cs @@ -63,5 +63,6 @@ namespace HypervResource VirtualSystemSettingData GetVmSettings(ComputerSystem vm); void patchSystemVmIso(string vmName, string systemVmIso); void SetState(ComputerSystem vm, ushort requiredState); + Dictionary GetVmSync(String privateIpAddress); } } diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs index 631a7bd2cf4..cc2b6673fd6 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs @@ -45,6 +45,16 @@ namespace HypervResource return new JObject(objTypeValuePairing); } + /// + /// serialize dictonary to map json type + /// + /// Object's data, can be an anonymous object, e.g. + /// + public static JToken CreateCloudStackMapObject(object objValue) + { + JToken objContent = JToken.FromObject(objValue); + return objContent; + } /// /// Copy file on network share to local volume. diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs index 547a6b7cdfd..0a5813128c2 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs @@ -1549,6 +1549,19 @@ namespace HypervResource return null; } + public Dictionary GetVmSync(String privateIpAddress) + { + List vms = GetVmElementNames(); + Dictionary vmSyncStates = new Dictionary(); + String vmState; + foreach (String vm in vms) + { + vmState = EnabledState.ToCloudStackState(GetComputerSystem(vm).EnabledState); + vmSyncStates.Add(vm, new VmState(vmState, privateIpAddress)); + } + return vmSyncStates; + } + public List GetVmElementNames() { List result = new List(); From c2fc6e69b5eabcd706879f1b0df30ff19669c584 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 7 Nov 2013 11:06:42 +0100 Subject: [PATCH 082/108] check Linux bridge status before remove it (Cherry-picked from commit a33f0e7bdd3bc359e483eca36cf9faf1f2c7c521) --- .../com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java index 84743ec124e..b400fd25032 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java @@ -205,7 +205,11 @@ public class BridgeVifDriver extends VifDriverBase { private void deleteVnetBr(String brName) { synchronized (_vnetBridgeMonitor) { - String cmdout = Script.runSimpleBashScript("ls /sys/class/net/" + brName + "/brif | tr '\n' ' '"); + String cmdout = Script.runSimpleBashScript("ls /sys/class/net/" + brName); + if (cmdout == null) + // Bridge does not exist + return; + cmdout = Script.runSimpleBashScript("ls /sys/class/net/" + brName + "/brif | tr '\n' ' '"); if (cmdout != null && cmdout.contains("vnet")) { // Active VM remains on that bridge return; From 958312de4cdf1c6e79f9b1f119b91568baf7ba90 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 7 Nov 2013 11:07:24 +0100 Subject: [PATCH 083/108] CLOUDSTACK-5042: fix NPE error as BroadcastUri is NULL in shared network after upgrade from 2.2.14 (Cherry-picked from commit 09e7ab9750df27d96159bbcf3f41bafc33ac6fbe) --- server/src/com/cloud/network/IpAddressManagerImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/IpAddressManagerImpl.java b/server/src/com/cloud/network/IpAddressManagerImpl.java index 8619ae178cd..2c54137adcd 100644 --- a/server/src/com/cloud/network/IpAddressManagerImpl.java +++ b/server/src/com/cloud/network/IpAddressManagerImpl.java @@ -1892,7 +1892,10 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage //nic.setBroadcastType(BroadcastDomainType.Vlan); //nic.setBroadcastUri(BroadcastDomainType.Vlan.toUri(ip.getVlanTag())); nic.setBroadcastType(network.getBroadcastDomainType()); - nic.setBroadcastUri(network.getBroadcastUri()); + if (network.getBroadcastUri() != null) + nic.setBroadcastUri(network.getBroadcastUri()); + else + nic.setBroadcastUri(BroadcastDomainType.Vlan.toUri(ip.getVlanTag())); nic.setFormat(AddressFormat.Ip4); nic.setReservationId(String.valueOf(ip.getVlanTag())); nic.setMacAddress(ip.getMacAddress()); From edf04a33c1a3b04869130b30ec0216ae658777fb Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 7 Nov 2013 11:07:48 +0100 Subject: [PATCH 084/108] remove network limitation of nics on systemvms (cherry picked from commit 0227e0013ad90bb66a29e0852d9a114951b8f6fc) --- server/src/com/cloud/network/NetworkModelImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java index df9f651b8f2..c8733b0cc8d 100755 --- a/server/src/com/cloud/network/NetworkModelImpl.java +++ b/server/src/com/cloud/network/NetworkModelImpl.java @@ -941,16 +941,21 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel { // from the network offering boolean isUserVmsDefaultNetwork = false; boolean isDomRGuestOrPublicNetwork = false; + boolean isSystemVmNetwork = false; if (vm != null) { Nic nic = _nicDao.findByNtwkIdAndInstanceId(networkId, vmId); if (vm.getType() == Type.User && nic != null && nic.isDefaultNic()) { isUserVmsDefaultNetwork = true; } else if (vm.getType() == Type.DomainRouter && ntwkOff != null && (ntwkOff.getTrafficType() == TrafficType.Public || ntwkOff.getTrafficType() == TrafficType.Guest)) { isDomRGuestOrPublicNetwork = true; + } else if (vm.getType() == Type.ConsoleProxy || vm.getType() == Type.SecondaryStorageVm) { + isSystemVmNetwork = true; } } if (isUserVmsDefaultNetwork || isDomRGuestOrPublicNetwork) { return _configMgr.getServiceOfferingNetworkRate(vm.getServiceOfferingId(), network.getDataCenterId()); + } else if (isSystemVmNetwork) { + return -1; } else { return _configMgr.getNetworkOfferingNetworkRate(ntwkOff.getId(), network.getDataCenterId()); } From 57ba367f3c985e80ea1b34267e298b481a353298 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 7 Nov 2013 11:09:06 +0100 Subject: [PATCH 085/108] CLOUDSTACK-5042: change cloud.keystore to cloudmanagementserver.keystore and install it (cherry picked from commit de448ec4792eda5b47d79b26e9cb8ce96a2b22f4) --- ...r.keystore => cloudmanagementserver.keystore.in} | Bin debian/cloudstack-management.postinst | 5 ++++- packaging/centos63/cloud.spec | 10 +++++++++- .../com/cloud/server/ConfigurationServerImpl.java | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) rename client/tomcatconf/{cloudmanagementserver.keystore => cloudmanagementserver.keystore.in} (100%) diff --git a/client/tomcatconf/cloudmanagementserver.keystore b/client/tomcatconf/cloudmanagementserver.keystore.in similarity index 100% rename from client/tomcatconf/cloudmanagementserver.keystore rename to client/tomcatconf/cloudmanagementserver.keystore.in diff --git a/debian/cloudstack-management.postinst b/debian/cloudstack-management.postinst index a1219cc789f..8d99f6a1cce 100644 --- a/debian/cloudstack-management.postinst +++ b/debian/cloudstack-management.postinst @@ -35,7 +35,7 @@ if [ "$1" = configure ]; then OLDCONFDIR="/etc/cloud/management" NEWCONFDIR="/etc/cloudstack/management" - CONFFILES="db.properties cloud.keystore key" + CONFFILES="db.properties key" # Copy old configuration so the admin doesn't have to do that # Only do so when we are installing for the first time @@ -45,6 +45,9 @@ if [ "$1" = configure ]; then cp -a $OLDCONFDIR/$FILE $NEWCONFDIR/$FILE fi done + if [ -f "$OLDCONFDIR/cloud.keystore" ]; then + cp -a $OLDCONFDIR/cloud.keystore $NEWCONFDIR/cloudmanagementserver.keystore + fi fi chmod 0640 /etc/cloudstack/management/db.properties diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec index ebe45113eb1..cd6ff4bfbe2 100644 --- a/packaging/centos63/cloud.spec +++ b/packaging/centos63/cloud.spec @@ -252,7 +252,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/cl rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/vms for name in db.properties log4j-cloud.xml tomcat6-nonssl.conf tomcat6-ssl.conf server-ssl.xml server-nonssl.xml \ - catalina.policy catalina.properties classpath.conf tomcat-users.xml web.xml environment.properties ; do + catalina.policy catalina.properties classpath.conf tomcat-users.xml web.xml environment.properties cloudmanagementserver.keystore ; do mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/webapps/client/WEB-INF/classes/$name \ ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management/$name done @@ -450,6 +450,13 @@ else echo "Unable to determine ssl settings for tomcat.conf, please run cloudstack-setup-management manually" fi +if [ -f "%{_sysconfdir}/cloud.rpmsave/management/cloud.keystore" ]; then + mv %{_sysconfdir}/%{name}/management/cloudmanagementserver.keystore %{_sysconfdir}/%{name}/management/cloudmanagementserver.keystore.rpmnew + cp -p %{_sysconfdir}/cloud.rpmsave/management/cloud.keystore %{_sysconfdir}/%{name}/management/cloudmanagementserver.keystore + # make sure we only do this on the first install of this RPM, don't want to overwrite on a reinstall + mv %{_sysconfdir}/cloud.rpmsave/management/cloud.keystore %{_sysconfdir}/cloud.rpmsave/management/cloud.keystore.rpmsave +fi + %preun agent /sbin/service cloudstack-agent stop || true if [ "$1" == "0" ] ; then @@ -539,6 +546,7 @@ fi %config(noreplace) %{_sysconfdir}/%{name}/management/cloud-bridge.properties %config(noreplace) %{_sysconfdir}/%{name}/management/commons-logging.properties %config(noreplace) %{_sysconfdir}/%{name}/management/ec2-service.properties +%config(noreplace) %{_sysconfdir}/%{name}/management/cloudmanagementserver.keystore %attr(0755,root,root) %{_initrddir}/%{name}-management %attr(0755,root,root) %{_bindir}/%{name}-setup-management %attr(0755,root,root) %{_bindir}/%{name}-update-xenserver-licenses diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 0676db8ca18..8459adafb13 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -584,7 +584,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio File confFile = PropertiesUtil.findConfigFile("db.properties"); /* This line may throw a NPE, but that's due to fail to find db.properities, meant some bugs in the other places */ String confPath = confFile.getParent(); - String keystorePath = confPath + "/cloud.keystore"; + String keystorePath = confPath + "/cloudmanagementserver.keystore"; File keystoreFile = new File(keystorePath); boolean dbExisted = (dbString != null && !dbString.isEmpty()); From a98c473dca9ff2af1275f6c9afda773fc416a727 Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Fri, 8 Nov 2013 13:16:44 +0530 Subject: [PATCH 086/108] Remote Desktop Protocol(RDP) client that is suitable for including in the console VM. The client renders RDP to a window created by Java. It is important for Hyper-V support, because Hyper-V provides access to the consoles of VMs that it is running over RDP. --- .../console-proxy-rdp/rdpconsole/README.txt | 50 + services/console-proxy-rdp/rdpconsole/pom.xml | 49 + .../rdpconsole/rdp-config.bat | 42 + .../src/main/java/common/AwtBellAdapter.java | 76 ++ .../main/java/common/AwtCanvasAdapter.java | 164 +++ .../main/java/common/AwtClipboardAdapter.java | 55 + .../main/java/common/AwtKeyEventSource.java | 53 + .../main/java/common/AwtMouseEventSource.java | 71 ++ .../src/main/java/common/BitmapOrder.java | 48 + .../src/main/java/common/BitmapRectangle.java | 74 ++ .../main/java/common/BufferedImageCanvas.java | 79 ++ .../common/BufferedImageCopyRectAdapter.java | 124 ++ .../common/BufferedImagePixelsAdapter.java | 147 +++ .../src/main/java/common/Client.java | 137 ++ .../src/main/java/common/CopyRectOrder.java | 39 + .../src/main/java/common/KeyOrder.java | 45 + .../src/main/java/common/MouseOrder.java | 41 + .../src/main/java/common/OrderType.java | 22 + .../main/java/common/ScreenDescription.java | 168 +++ .../main/java/common/SizeChangeListener.java | 22 + .../java/rdpclient/AwtRdpKeyboardAdapter.java | 351 +++++ .../java/rdpclient/AwtRdpMouseAdapter.java | 180 +++ .../rdpclient/ClientConfirmActivePDU.java | 1132 +++++++++++++++++ .../java/rdpclient/ClientFastPathPDU.java | 55 + .../main/java/rdpclient/ClientInfoPDU.java | 456 +++++++ .../rdpclient/ClientMCSAttachUserRequest.java | 102 ++ ...inRequest_ServerMCSChannelConfirmPDUs.java | 222 ++++ .../rdpclient/ClientMCSConnectInitial.java | 669 ++++++++++ .../ClientMCSErectDomainRequest.java | 190 +++ .../java/rdpclient/ClientPacketSniffer.java | 50 + .../java/rdpclient/ClientSynchronizePDU.java | 248 ++++ .../src/main/java/rdpclient/ClientTpkt.java | 54 + .../ClientX224ConnectionRequestPDU.java | 156 +++ .../java/rdpclient/ClientX224DataPdu.java | 54 + .../src/main/java/rdpclient/HandshakeEnd.java | 27 + .../src/main/java/rdpclient/MockServer.java | 197 +++ .../main/java/rdpclient/PacketSniffer.java | 75 ++ .../rdpclient/RLEBitmapDecompression.java | 1014 +++++++++++++++ .../src/main/java/rdpclient/RdpClient.java | 214 ++++ .../src/main/java/rdpclient/RdpConstants.java | 74 ++ .../src/main/java/rdpclient/RdpState.java | 33 + .../java/rdpclient/ServerBitmapUpdate.java | 201 +++ .../rdpclient/ServerChannel1003Router.java | 530 ++++++++ .../rdpclient/ServerControlPDUCooperate.java | 117 ++ .../ServerControlPDUGrantedControl.java | 114 ++ .../java/rdpclient/ServerDemandActivePDU.java | 661 ++++++++++ .../main/java/rdpclient/ServerFastPath.java | 259 ++++ .../ServerLicenseErrorPDUValidClient.java | 121 ++ .../ServerMCSAttachUserConfirmPDU.java | 133 ++ .../ServerMCSChannelJoinConfirmPDU.java | 89 ++ .../rdpclient/ServerMCSConnectResponse.java | 283 +++++ .../src/main/java/rdpclient/ServerMCSPDU.java | 149 +++ .../java/rdpclient/ServerPacketSniffer.java | 52 + .../java/rdpclient/ServerPaletteUpdate.java | 78 ++ .../java/rdpclient/ServerSynchronizePDU.java | 115 ++ .../src/main/java/rdpclient/ServerTpkt.java | 70 + .../ServerX224ConnectionConfirmPDU.java | 237 ++++ .../java/rdpclient/ServerX224DataPdu.java | 64 + .../rdpclient/TrustAllX509TrustManager.java | 40 + .../java/rdpclient/UpgradeSocketToSSL.java | 44 + .../java/streamer/AssertingByteBuffer.java | 107 ++ .../src/main/java/streamer/BaseElement.java | 417 ++++++ .../src/main/java/streamer/BufferPool.java | 36 + .../src/main/java/streamer/ByteBuffer.java | 826 ++++++++++++ .../src/main/java/streamer/DataSink.java | 24 + .../src/main/java/streamer/DataSource.java | 60 + .../src/main/java/streamer/Direction.java | 21 + .../src/main/java/streamer/Element.java | 120 ++ .../src/main/java/streamer/Event.java | 33 + .../src/main/java/streamer/FakeSink.java | 69 + .../src/main/java/streamer/FakeSource.java | 125 ++ .../main/java/streamer/InputStreamSource.java | 194 +++ .../src/main/java/streamer/Link.java | 66 + .../src/main/java/streamer/MockSink.java | 111 ++ .../src/main/java/streamer/MockSource.java | 88 ++ .../src/main/java/streamer/OneTimeSwitch.java | 133 ++ .../src/main/java/streamer/Order.java | 23 + .../main/java/streamer/OutputStreamSink.java | 153 +++ .../src/main/java/streamer/Pipeline.java | 91 ++ .../src/main/java/streamer/PipelineImpl.java | 309 +++++ .../src/main/java/streamer/Queue.java | 136 ++ .../src/main/java/streamer/SocketWrapper.java | 239 ++++ .../src/main/java/streamer/SyncLink.java | 402 ++++++ .../AwtKeyboardEventToVncAdapter.java | 369 ++++++ .../vncclient/AwtMouseEventToVncAdapter.java | 71 ++ .../main/java/vncclient/EncodingsMessage.java | 63 + .../vncclient/FrameBufferUpdateRequest.java | 127 ++ .../RGB888LE32PixelFormatRequest.java | 90 ++ .../src/main/java/vncclient/RfbConstants.java | 85 ++ .../src/main/java/vncclient/VncClient.java | 107 ++ .../main/java/vncclient/VncInitializer.java | 244 ++++ .../java/vncclient/VncMessageHandler.java | 419 ++++++ .../vncclient/Vnc_3_3_Authentication.java | 291 +++++ .../main/java/vncclient/Vnc_3_3_Hello.java | 115 ++ .../rdpconsole/src/test/doc/README.txt | 32 + .../src/test/doc/dev-rdp-config.bat | 126 ++ .../rdpconsole/src/test/doc/rdp-key.pem | 23 + .../test/java/rdpclient/MockServerTest.java | 189 +++ 98 files changed, 16550 insertions(+) create mode 100644 services/console-proxy-rdp/rdpconsole/README.txt create mode 100644 services/console-proxy-rdp/rdpconsole/pom.xml create mode 100644 services/console-proxy-rdp/rdpconsole/rdp-config.bat create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtBellAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtCanvasAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtClipboardAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtKeyEventSource.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtMouseEventSource.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/BitmapOrder.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/BitmapRectangle.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImageCanvas.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImageCopyRectAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImagePixelsAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/Client.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/CopyRectOrder.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/KeyOrder.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/MouseOrder.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/OrderType.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/ScreenDescription.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/common/SizeChangeListener.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/AwtRdpKeyboardAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/AwtRdpMouseAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientConfirmActivePDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientFastPathPDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientInfoPDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSAttachUserRequest.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSChannelJoinRequest_ServerMCSChannelConfirmPDUs.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSConnectInitial.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSErectDomainRequest.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientPacketSniffer.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientSynchronizePDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientTpkt.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientX224ConnectionRequestPDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientX224DataPdu.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/HandshakeEnd.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/MockServer.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/PacketSniffer.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RLEBitmapDecompression.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpClient.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpConstants.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpState.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerBitmapUpdate.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerChannel1003Router.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerControlPDUCooperate.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerControlPDUGrantedControl.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerDemandActivePDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerFastPath.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerLicenseErrorPDUValidClient.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSAttachUserConfirmPDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSChannelJoinConfirmPDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSConnectResponse.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSPDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerPacketSniffer.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerPaletteUpdate.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerSynchronizePDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerTpkt.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerX224ConnectionConfirmPDU.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerX224DataPdu.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/TrustAllX509TrustManager.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/UpgradeSocketToSSL.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/AssertingByteBuffer.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/BaseElement.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/BufferPool.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/ByteBuffer.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/DataSink.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/DataSource.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Direction.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Element.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Event.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/FakeSink.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/FakeSource.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/InputStreamSource.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Link.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/MockSink.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/MockSource.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/OneTimeSwitch.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Order.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/OutputStreamSink.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Pipeline.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/PipelineImpl.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Queue.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/SocketWrapper.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/streamer/SyncLink.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/AwtKeyboardEventToVncAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/AwtMouseEventToVncAdapter.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/EncodingsMessage.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/FrameBufferUpdateRequest.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/RGB888LE32PixelFormatRequest.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/RfbConstants.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncClient.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncInitializer.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncMessageHandler.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/Vnc_3_3_Authentication.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/Vnc_3_3_Hello.java create mode 100644 services/console-proxy-rdp/rdpconsole/src/test/doc/README.txt create mode 100644 services/console-proxy-rdp/rdpconsole/src/test/doc/dev-rdp-config.bat create mode 100644 services/console-proxy-rdp/rdpconsole/src/test/doc/rdp-key.pem create mode 100644 services/console-proxy-rdp/rdpconsole/src/test/java/rdpclient/MockServerTest.java diff --git a/services/console-proxy-rdp/rdpconsole/README.txt b/services/console-proxy-rdp/rdpconsole/README.txt new file mode 100644 index 00000000000..15029d43287 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/README.txt @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +This project contains code for basic VNC and RDP clients. + +VNC client can be invoked using following command: + + mvn exec:java -Dexec.mainClass="common.Client" -Dexec.args="vnc 192.168.0.101 5901 password" + +where + * vnc - name of protcol; + * 192.168.0.101 - IP of VNC server; + * 5901 - port of VNC server screen (5900+display number); + * password - VNC server password. + + +RDP client can be invoked using following command: + + mvn exec:java -Dexec.mainClass="common.Client" -Dexec.args="rdp 192.168.0.101 3389 Administrator" + +where + * rdp - name of protcol; + * 192.168.0.101 - IP of RDP server; + * 3389 - port of RDP server; + * Administrator - user name for loging dialog. + + +Limitations of VNC client: + * only basic functionality work. + +Limitations of RDP client: + * it uses SSL/TLS; + * NLA is not supported; + * only basic functionality work. + + +To configure and start RDP service properly, run rdp-config.bat on server. diff --git a/services/console-proxy-rdp/rdpconsole/pom.xml b/services/console-proxy-rdp/rdpconsole/pom.xml new file mode 100644 index 00000000000..d1b4918f316 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + rdpclient + rdpclient + 4.3.0-SNAPSHOT + jar + + rdpclient + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + 3.8.1 + test + + + org.apache.tomcat.embed + tomcat-embed-core + 7.0.30 + test + + + diff --git a/services/console-proxy-rdp/rdpconsole/rdp-config.bat b/services/console-proxy-rdp/rdpconsole/rdp-config.bat new file mode 100644 index 00000000000..e9510144426 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/rdp-config.bat @@ -0,0 +1,42 @@ +rem Licensed to the Apache Software Foundation (ASF) under one +rem or more contributor license agreements. See the NOTICE file +rem distributed with this work for additional information +rem regarding copyright ownership. The ASF licenses this file +rem to you under the Apache License, Version 2.0 (the +rem "License"); you may not use this file except in compliance +rem with the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, +rem software distributed under the License is distributed on an +rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +rem KIND, either express or implied. See the License for the +rem specific language governing permissions and limitations +rem under the License. + +rem +rem Configure and start RDP service. +rem + +rem Turn off firewall + +netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes + +rem Enable TS connections + +reg add "HKLM\System\CurrentControlSet\Control\Terminal Server" /v "AllowTSConnections" /t REG_DWORD /d 1 /f +reg add "HKLM\System\CurrentControlSet\Control\Terminal Server" /v "fDenyTSConnections" /t REG_DWORD /d 0 /f + +rem Disable RDP NLA + +reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f + +rem Enable TS service + +sc config TermService start=auto + +rem Start TS service + +net start Termservice + diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtBellAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtBellAdapter.java new file mode 100644 index 00000000000..3318c090303 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtBellAdapter.java @@ -0,0 +1,76 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.Toolkit; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.FakeSource; +import streamer.Link; +import streamer.Pipeline; +import streamer.PipelineImpl; + +public class AwtBellAdapter extends BaseElement { + + public AwtBellAdapter(String id) { + super(id); + declarePads(); + } + + private void declarePads() { + inputPads.put(STDIN, null); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + if (buf == null) + return; + + Toolkit.getDefaultToolkit().beep(); + } + + public String toString() { + return "Bell(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + System.setProperty("streamer.Element.debug", "true"); + + Element source = new FakeSource("source") { + { + this.incommingBufLength = 0; + this.delay = 1000; + this.numBuffers = 3; + } + }; + + Element sink = new AwtBellAdapter("sink"); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.addAndLink(source, sink); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtCanvasAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtCanvasAdapter.java new file mode 100644 index 00000000000..12dd88b9cdc --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtCanvasAdapter.java @@ -0,0 +1,164 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.awt.image.WritableRaster; + +import rdpclient.ServerBitmapUpdate; +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.Order; +import streamer.Pipeline; +import streamer.PipelineImpl; + +public class AwtCanvasAdapter extends BaseElement { + + protected ScreenDescription screen; + + public AwtCanvasAdapter(String id, BufferedImageCanvas canvas, ScreenDescription screen) { + super(id); + this.canvas = canvas; + this.screen = screen; + } + + protected BufferedImageCanvas canvas; + + public String toString() { + return "AwtRdpAdapter(" + id + ")"; + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + Order order = (Order) buf.getOrder(); + switch ((OrderType) order.type) { + + case BITMAP_UPDATE: + handleBitmap((BitmapOrder) order, buf); + break; + + case COPY_RECT: + handleCopyRect((CopyRectOrder) order, buf); + break; + + default: + throw new RuntimeException("Order is not implemented: " + buf + "."); + // break; + } + + buf.unref(); + } + + private void handleCopyRect(CopyRectOrder order, ByteBuffer buf) { + // TODO Auto-generated method stub + // Copy image + canvas.getOfflineGraphics().copyArea(order.srcX, order.srcY, order.width, order.height, order.x - order.srcX, order.y - order.srcY); + + // Request update of repainted area + canvas.repaint(order.x, order.y, order.width, order.height); + + } + + private void handleBitmap(BitmapOrder order, ByteBuffer buf) { + // Draw rectangle on offline buffer + BufferedImage image = canvas.getOfflineImage(); + Graphics2D g = (Graphics2D) image.getGraphics(); + + for (BitmapRectangle rectangle : order.rectangles) { + // *DEBUG*/System.out.println("["+this+"] DEBUG: Rectangle: " + + // rectangle.toString()); + + int x = rectangle.x; + int y = rectangle.y; + int width = rectangle.width; + int height = rectangle.height; + int bufferWidth = rectangle.bufferWidth; + int bufferHeight = rectangle.bufferHeight; + + BufferedImage rectImage; + switch (rectangle.colorDepth) { + case 8: { + rectImage = new BufferedImage(bufferWidth, height, BufferedImage.TYPE_BYTE_INDEXED, screen.colorMap); + WritableRaster raster = rectImage.getRaster(); + raster.setDataElements(0, 0, bufferWidth, bufferHeight, rectangle.bitmapDataStream.toByteArray()); + break; + } + case 15: { + rectImage = new BufferedImage(bufferWidth, height, BufferedImage.TYPE_USHORT_555_RGB); + WritableRaster raster = rectImage.getRaster(); + raster.setDataElements(0, 0, bufferWidth, bufferHeight, rectangle.bitmapDataStream.toShortArray()); + break; + } + case 16: { + rectImage = new BufferedImage(bufferWidth, height, BufferedImage.TYPE_USHORT_565_RGB); + WritableRaster raster = rectImage.getRaster(); + raster.setDataElements(0, 0, bufferWidth, bufferHeight, rectangle.bitmapDataStream.toShortArray()); + break; + } + case 24: + case 32: { + rectImage = new BufferedImage(bufferWidth, height, BufferedImage.TYPE_INT_RGB); + WritableRaster raster = rectImage.getRaster(); + raster.setDataElements(0, 0, bufferWidth, bufferHeight, rectangle.bitmapDataStream.toIntLEArray()); + break; + } + default: + throw new RuntimeException("Unsupported color depth: " + rectangle.colorDepth + "."); + } + + g.setClip(x, y, width, height); + g.drawImage(rectImage, x, y, null); + + // Request update of repainted area + canvas.repaint(x, y, width, height); + } + + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + // System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + ByteBuffer packet = new ByteBuffer(new byte[] { 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x00, + 0x01, 0x04, 0x0a, 0x00, 0x0c, (byte) 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); + + Pipeline pipeline = new PipelineImpl("test"); + + Element bitmap = new ServerBitmapUpdate("bitmap"); + + BufferedImageCanvas canvas = new BufferedImageCanvas(1024, 768); + Element adapter = new AwtCanvasAdapter("test", canvas, null) { + { + verbose = true; + } + }; + pipeline.addAndLink(bitmap, adapter); + + bitmap.handleData(packet, null); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtClipboardAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtClipboardAdapter.java new file mode 100644 index 00000000000..aeed41ca636 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtClipboardAdapter.java @@ -0,0 +1,55 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.Toolkit; +import java.awt.datatransfer.StringSelection; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; +import vncclient.VncMessageHandler; + +public class AwtClipboardAdapter extends BaseElement { + + public AwtClipboardAdapter(String id) { + super(id); + declarePads(); + } + + private void declarePads() { + inputPads.put(STDIN, null); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + if (buf == null) + return; + + String content = (String) buf.getMetadata(VncMessageHandler.CLIPBOARD_CONTENT); + StringSelection contents = new StringSelection(content); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(contents, null); + } + + public String toString() { + return "Clipboard(" + id + ")"; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtKeyEventSource.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtKeyEventSource.java new file mode 100644 index 00000000000..a754796a0d2 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtKeyEventSource.java @@ -0,0 +1,53 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; + +import streamer.BaseElement; +import streamer.ByteBuffer; + +public class AwtKeyEventSource extends BaseElement implements KeyListener { + + public AwtKeyEventSource(String id) { + super(id); + } + + @Override + public void keyTyped(KeyEvent e) { + // Nothing to do + + } + + @Override + public void keyPressed(KeyEvent e) { + sendEvent(e, true); + } + + @Override + public void keyReleased(KeyEvent e) { + sendEvent(e, false); + } + + private void sendEvent(KeyEvent e, boolean pressed) { + ByteBuffer buf=new ByteBuffer(new KeyOrder(e, pressed)); + + pushDataToAllOuts(buf); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtMouseEventSource.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtMouseEventSource.java new file mode 100644 index 00000000000..f3e58fc02c1 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/AwtMouseEventSource.java @@ -0,0 +1,71 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +import streamer.BaseElement; +import streamer.ByteBuffer; + +public class AwtMouseEventSource extends BaseElement implements MouseListener, MouseMotionListener { + + public AwtMouseEventSource(String id) { + super(id); + } + + @Override + public void mouseClicked(MouseEvent e) { + // Nothing to do + } + + @Override + public void mousePressed(MouseEvent e) { + MouseOrder order = new MouseOrder(e); + order.pressed = true; + pushDataToAllOuts(new ByteBuffer(order)); + } + + @Override + public void mouseReleased(MouseEvent e) { + MouseOrder order = new MouseOrder(e); + order.released = true; + pushDataToAllOuts(new ByteBuffer(order)); + } + + @Override + public void mouseEntered(MouseEvent e) { + // Nothing to do + } + + @Override + public void mouseExited(MouseEvent e) { + // Nothing to do + } + + @Override + public void mouseDragged(MouseEvent e) { + pushDataToAllOuts(new ByteBuffer(new MouseOrder(e))); + } + + @Override + public void mouseMoved(MouseEvent e) { + pushDataToAllOuts(new ByteBuffer(new MouseOrder(e))); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/BitmapOrder.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BitmapOrder.java new file mode 100644 index 00000000000..438755f4869 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BitmapOrder.java @@ -0,0 +1,48 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.util.Arrays; + + +import streamer.Order; + +/** + * Not an order, but derived from Order class for compatibility with orders. + * + * @see http://msdn.microsoft.com/en-us/library/dd306368.aspx + */ +public class BitmapOrder extends Order { + + public BitmapOrder() { + type = OrderType.BITMAP_UPDATE; + } + + /** + * Structures, each of which contains a rectangular clipping taken from the + * server-side screen frame buffer. + */ + public BitmapRectangle rectangles[]; + + @Override + public String toString() { + final int maxLen = 10; + return String.format("BitmapUpdateOrder [rectangles=%s]", rectangles != null ? Arrays.asList(rectangles).subList(0, Math.min(rectangles.length, maxLen)) + : null); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/BitmapRectangle.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BitmapRectangle.java new file mode 100644 index 00000000000..f0c178e6092 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BitmapRectangle.java @@ -0,0 +1,74 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import streamer.ByteBuffer; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240612.aspx + */ +public class BitmapRectangle { + + /** + * Left bound of the rectangle. + */ + public int x; + + /** + * Top bound of the rectangle. + */ + public int y; + + /** + * Width of the rectangle. + */ + public int width; + + /** + * Height of the rectangle. + */ + public int height; + + /** + * Color depth of the rectangle data in bits-per-pixel. + */ + public int colorDepth; + + /** + * Variable-length array of bytes describing a raw uncompressed bitmap image. + */ + public ByteBuffer bitmapDataStream; + + /** + * Size of single horizontal scan line. + */ + public int bufferWidth; + + /** + * Number of horizontal scan lines in buffer. + */ + public int bufferHeight; + + @Override + public String toString() { + return String + .format( + "BitmapUpdateRectangle [x=%s, y=%s, width=%s, height=%s, bitsPerPixel=%s, bitmapDataStream=%s]", + x, y, width, height, colorDepth, bitmapDataStream); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImageCanvas.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImageCanvas.java new file mode 100644 index 00000000000..6e7738fad3e --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImageCanvas.java @@ -0,0 +1,79 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; + +/** + * A BuffereImageCanvas component represents frame buffer image on the + * screen. It also notifies its subscribers when screen is repainted. + */ +public class BufferedImageCanvas extends Canvas { + private static final long serialVersionUID = 1L; + + // Offline screen buffer + private BufferedImage offlineImage; + + // Cached Graphics2D object for offline screen buffer + private Graphics2D graphics; + + public BufferedImageCanvas(int width, int height) { + super(); + + setBackground(Color.black); + + setFocusable(true); + + // Don't intercept TAB key + setFocusTraversalKeysEnabled(false); + + setCanvasSize(width, height); + } + + public void setCanvasSize(int width, int height) { + this.offlineImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + graphics = offlineImage.createGraphics(); + + setSize(offlineImage.getWidth(), offlineImage.getHeight()); + } + + @Override + public void update(Graphics g) { + // Call paint() directly, without clearing screen first + paint(g); + } + + @Override + public void paint(Graphics g) { + // Only part of image, requested with repaint(Rectangle), will be + // painted on screen. + g.drawImage(offlineImage, 0, 0, this); + } + + public BufferedImage getOfflineImage() { + return offlineImage; + } + + public Graphics2D getOfflineGraphics() { + return graphics; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImageCopyRectAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImageCopyRectAdapter.java new file mode 100644 index 00000000000..bbd5142cad6 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImageCopyRectAdapter.java @@ -0,0 +1,124 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.image.DataBufferInt; +import java.util.Arrays; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; + +public class BufferedImageCopyRectAdapter extends BaseElement { + + public static final String SRC_X = "srcX"; + public static final String SRC_Y = "srcY"; + public static final String TARGET_X = "x"; + public static final String TARGET_Y = "y"; + public static final String WIDTH = "width"; + public static final String HEIGHT = "height"; + + protected BufferedImageCanvas canvas; + + public BufferedImageCopyRectAdapter(String id, BufferedImageCanvas canvas) { + super(id); + this.canvas = canvas; + declarePads(); + } + + private void declarePads() { + inputPads.put(STDIN, null); + } + + public String toString() { + return "Renderer(" + id + ")"; + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + int x = (Integer) buf.getMetadata(TARGET_X); + int y = (Integer) buf.getMetadata(TARGET_Y); + int width = (Integer) buf.getMetadata(WIDTH); + int height = (Integer) buf.getMetadata(HEIGHT); + int srcX = (Integer) buf.getMetadata(SRC_X); + int srcY = (Integer) buf.getMetadata(SRC_Y); + buf.unref(); + + // Copy image + canvas.getOfflineGraphics().copyArea(srcX, srcY, width, height, x - srcX, y - srcY); + + // Request update of repainted area + canvas.repaint(x, y, width, height); + } + + public static void main(String args[]) { + System.setProperty("streamer.Element.debug", "true"); + + BufferedImageCanvas canvas = new BufferedImageCanvas(4, 4); + + Element renderer = new BufferedImageCopyRectAdapter("renderer", canvas); + + int[] pixelsBeforeCopy = new int[] { + // 0 + 1, 2, 3, 4, + // 1 + 5, 6, 7, 8, + // 2 + 9, 10, 11, 12, + // 3 + 13, 14, 15, 16 }; + int[] pixelsAfterCopy = new int[] { + // 0 + 11, 12, 3, 4, + // 1 + 15, 16, 7, 8, + // 2 + 9, 10, 11, 12, + // 3 + 13, 14, 15, 16 }; + + + // Initalize image + int[] data = ((DataBufferInt) canvas.getOfflineImage().getRaster().getDataBuffer()).getData(); + System.arraycopy(pixelsBeforeCopy, 0, data, 0, pixelsBeforeCopy.length); + + ByteBuffer buf = new ByteBuffer(new byte[0]); + buf.putMetadata(TARGET_X, 0); + buf.putMetadata(TARGET_Y, 0); + buf.putMetadata(WIDTH, 2); + buf.putMetadata(HEIGHT, 2); + buf.putMetadata(SRC_X, 2); + buf.putMetadata(SRC_Y, 2); + + renderer.handleData(buf, null); + + data = ((DataBufferInt) canvas.getOfflineImage().getRaster().getDataBuffer()).getData(); + String actualData = Arrays.toString(data); + String expectedData = Arrays.toString(pixelsAfterCopy); + if (!actualData.equals(expectedData)) + System.err.println("Actual image: " + actualData + "\nExpected image: " + expectedData + "."); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImagePixelsAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImagePixelsAdapter.java new file mode 100644 index 00000000000..95e7738b0e0 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/BufferedImagePixelsAdapter.java @@ -0,0 +1,147 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.image.BufferedImage; +import java.awt.image.DataBuffer; +import java.awt.image.DataBufferInt; +import java.util.Arrays; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; + +public class BufferedImagePixelsAdapter extends BaseElement { + + public static final String TARGET_X = "x"; + public static final String TARGET_Y = "y"; + public static final String WIDTH = "width"; + public static final String HEIGHT = "height"; + public static final String RGB888LE32 = "RGB888LE32"; + public static final String PIXEL_FORMAT = "pixel_format"; + + protected BufferedImageCanvas canvas; + + public BufferedImagePixelsAdapter(String id, BufferedImageCanvas canvas) { + super(id); + this.canvas = canvas; + declarePads(); + } + + private void declarePads() { + inputPads.put(STDIN, null); + } + + public String toString() { + return "Renderer(" + id + ")"; + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + int x = (Integer) buf.getMetadata(TARGET_X); + int y = (Integer) buf.getMetadata(TARGET_Y); + int rectWidth = (Integer) buf.getMetadata(WIDTH); + int rectHeight = (Integer) buf.getMetadata(HEIGHT); + String format = (String) buf.getMetadata(PIXEL_FORMAT); + + int bpp; + // Support RGB888/32 little endian only + if (format != null && RGB888LE32.equals(format)) { + bpp = 4; + // TODO: support more formats + } else + throw new RuntimeException("Unsupported format: " + format + ". Supported formats: " + RGB888LE32 + "."); + + int dataLength = rectWidth * rectHeight * bpp; + if (!cap(buf, dataLength, dataLength, link, false)) + return; + + // Draw rectangle on offline buffer + BufferedImage image = canvas.getOfflineImage(); + + DataBuffer dataBuf = image.getRaster().getDataBuffer(); + + switch (dataBuf.getDataType()) { + + case DataBuffer.TYPE_INT: { + + // Convert array of bytes to array of int's + int[] intArray = buf.toIntLEArray(); + + // We chose RGB888 model, so Raster will use DataBufferInt type + DataBufferInt dataBuffer = (DataBufferInt) dataBuf; + + int imageWidth = image.getWidth(); + int imageHeight = image.getHeight(); + + // Paint rectangle directly on buffer, line by line + int[] imageBuffer = dataBuffer.getData(); + + for (int srcLine = 0, dstLine = y; srcLine < rectHeight && dstLine < imageHeight; srcLine++, dstLine++) { + try { + System.arraycopy(intArray, srcLine * rectWidth, imageBuffer, x + dstLine * imageWidth, rectWidth); + } catch (IndexOutOfBoundsException e) { + } + } + break; + } + + default: + throw new RuntimeException("Unsupported data buffer in buffered image: expected data buffer of type int (DataBufferInt). Actual data buffer type: " + + dataBuf.getClass().getSimpleName()); + } + + // Request update of repainted area + canvas.repaint(x, y, rectWidth, rectHeight); + + buf.unref(); + } + + public static void main(String args[]) { + System.setProperty("streamer.Element.debug", "true"); + + BufferedImageCanvas canvas = new BufferedImageCanvas(4, 4); + + Element renderer = new BufferedImagePixelsAdapter("renderer", canvas); + + byte[] pixels = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; + + int[] pixelsLE = new int[] { 0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605, + 0x0c0b0a09, 0x100f0e0d, 0x04030201, 0x08070605, 0x0c0b0a09, 0x100f0e0d }; + + ByteBuffer buf = new ByteBuffer(pixels); + buf.putMetadata(TARGET_X, 0); + buf.putMetadata(TARGET_Y, 0); + buf.putMetadata(WIDTH, 4); + buf.putMetadata(HEIGHT, 4); + buf.putMetadata(PIXEL_FORMAT, RGB888LE32); + + renderer.handleData(buf, null); + + String actualData = Arrays.toString(((DataBufferInt) canvas.getOfflineImage().getRaster().getDataBuffer()).getData()); + String expectedData = Arrays.toString(pixelsLE); + if (!actualData.equals(expectedData)) + System.err.println("Actual image: " + actualData + "\nExpected image: " + expectedData + "."); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/Client.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/Client.java new file mode 100644 index 00000000000..343fe0abec4 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/Client.java @@ -0,0 +1,137 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.Frame; +import java.awt.ScrollPane; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import java.net.InetSocketAddress; + +import rdpclient.RdpClient; +import streamer.Element; +import streamer.Pipeline; +import streamer.PipelineImpl; +import streamer.SocketWrapper; +import vncclient.VncClient; + +public class Client { + + private static Frame frame; + private static SocketWrapper socket; + private static ScrollPane scroller; + private static ScreenDescription screen; + private static BufferedImageCanvas canvas; + + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + // System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + try { + if (args.length < 4) { + System.out.println("Usage: \n java common.Client vnc IP PORT PASSWORD\n java common.Client rdp IP PORT username\n"); + System.exit(0); + } + + String connectionType = args[0]; + String hostname = args[1]; + int port = Integer.parseInt(args[2]); + String userNameOrPassword = args[3]; + + // Create address from arguments + InetSocketAddress address = new InetSocketAddress(hostname, port); + + // Create socket wrapper + socket = new SocketWrapper("socket"); + + screen = new ScreenDescription(); + canvas = new BufferedImageCanvas(1024, 768); + screen.addSizeChangeListener(new SizeChangeListener() { + @Override + public void sizeChanged(int width, int height) { + if (canvas != null) { + canvas.setCanvasSize(width, height); + if (scroller != null) + scroller.setSize(canvas.getWidth(), canvas.getHeight()); + } + } + }); + + // Assemble pipeline + Element main; + if ("vnc".equals(connectionType)) { + main = new VncClient("client", userNameOrPassword, screen, canvas); + } else if ("rdp".equals(connectionType)) { + main = new RdpClient("client", userNameOrPassword, screen, canvas); + } else { + throw new RuntimeException("Unknown connection type. Expected value: \"vnc\" or \"rdp\", actual value: \"" + connectionType + "\"."); + } + + Pipeline pipeline = new PipelineImpl("Client"); + pipeline.add(socket, main); + pipeline.link("socket", main.getId(), "socket"); + + pipeline.validate(); + + frame = createVncClientMainWindow(canvas, "VNC", new WindowAdapter() { + public void windowClosing(WindowEvent evt) { + shutdown(); + } + }); + + try { + // Connect socket to remote server and run main loop(s) + socket.connect(address); + } finally { + shutdown(); + } + + } catch (Exception e) { + e.printStackTrace(System.err); + } + } + + protected static void shutdown() { + if (frame != null) { + frame.setVisible(false); + frame.dispose(); + } + if (socket != null) + socket.shutdown(); + } + + protected static Frame createVncClientMainWindow(BufferedImageCanvas canvas, String title, WindowListener windowListener) { + // Create AWT windows + Frame frame = new Frame(title + " - RDP"); + + // Use scrolling pane to support screens, which are larger than ours + scroller = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED); + scroller.add(canvas); + scroller.setSize(canvas.getWidth(), canvas.getHeight()); + + frame.add(scroller); + frame.pack(); + frame.setVisible(true); + + frame.addWindowListener(windowListener); + + return frame; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/CopyRectOrder.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/CopyRectOrder.java new file mode 100644 index 00000000000..5f0c0f77ebc --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/CopyRectOrder.java @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + + +import streamer.Order; + +public class CopyRectOrder extends Order { + public int srcX; + public int srcY; + public int width; + public int height; + public int x; + public int y; + + public CopyRectOrder() { + type = OrderType.COPY_RECT; + } + + @Override + public String toString() { + return "CopyRectOrder [srcX=" + srcX + ", srcY=" + srcY + ", width=" + width + ", height=" + height + ", x=" + x + ", y=" + y + "]"; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/KeyOrder.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/KeyOrder.java new file mode 100644 index 00000000000..726d8a094d5 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/KeyOrder.java @@ -0,0 +1,45 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.event.KeyEvent; + +import streamer.Order; + +public class KeyOrder extends Order { + public KeyOrder() { + type = "key event"; + } + + public KeyOrder(KeyEvent event, boolean pressed) { + type = "key event"; + + this.event = event; + this.pressed = pressed; + } + + public KeyEvent event; + + public boolean pressed; + + @Override + public String toString() { + return "KeyOrder [event=" + event + ", pressed=" + pressed + "]"; + } + + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/MouseOrder.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/MouseOrder.java new file mode 100644 index 00000000000..d6670fad58b --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/MouseOrder.java @@ -0,0 +1,41 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.event.MouseEvent; + +import streamer.Order; + +public class MouseOrder extends Order { + + public MouseOrder() { + type = "mouse order"; + } + + public MouseOrder(MouseEvent event) { + type = "mouse order"; + this.event = event; + } + + public MouseEvent event; + public boolean pressed; + public boolean released; + @Override + public String toString() { + return "MouseOrder [event=" + event + ", pressed=" + pressed + ", released=" + released + "]"; + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/OrderType.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/OrderType.java new file mode 100644 index 00000000000..1e77ea91434 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/OrderType.java @@ -0,0 +1,22 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +public enum OrderType { + BITMAP_UPDATE, COPY_RECT, + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/ScreenDescription.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/ScreenDescription.java new file mode 100644 index 00000000000..a01f22e8459 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/ScreenDescription.java @@ -0,0 +1,168 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +import java.awt.image.IndexColorModel; +import java.util.HashSet; +import java.util.Set; + +/** + * VncScreenDescription - contains information about remote VNC screen. + */ +public class ScreenDescription { + + protected Set sizeChangeListeners = new HashSet(); + + // Frame buffer size + protected int framebufferWidth = -1; + protected int framebufferHeight = -1; + + // Desktop name + protected String desktopName = null; + + // Bytes per pixel + protected int bytesPerPixel; + protected int colorDepth; + protected int bitsPerPixel; + protected int redShift; + protected int greenShift; + protected int blueShift; + protected int redMax; + protected int greenMax; + protected int blueMax; + protected boolean bigEndianFlag; + protected boolean trueColorFlag; + + public IndexColorModel colorMap = null; + + public ScreenDescription() { + } + + /** + * Store information about server pixel format. + */ + public void setPixelFormat(int bitsPerPixel, int depth, boolean bigEndianFlag, boolean trueColorFlag, int redMax, int greenMax, int blueMax, int redShift, + int greenShift, int blueShift) { + + this.bytesPerPixel = (bitsPerPixel + 7) / 8; + + this.bitsPerPixel = bitsPerPixel; + this.colorDepth = depth; + this.bigEndianFlag = bigEndianFlag; + this.trueColorFlag = trueColorFlag; + + this.redMax = redMax; + this.greenMax = greenMax; + this.blueMax = blueMax; + this.redShift = redShift; + this.greenShift = greenShift; + this.blueShift = blueShift; + } + + /** + * Store information about server pixel format. + */ + public void setPixelFormatRGBTrueColor(int bitsPerPixel) { + + switch(bitsPerPixel) { + case 8: + setPixelFormat(8, 8, false, false, -1, -1, -1, -1, -1, -1); + break; + case 15: + setPixelFormat(16, 15, false, true, 31, 31, 31, 0, 5, 10); + break; + case 16: + setPixelFormat(16, 16, false, true, 31, 63, 31, 0, 5, 11); + break; + case 24: + setPixelFormat(24, 24, false, true, 255, 255, 255, 0, 8, 16); + break; + case 32: + setPixelFormat(32, 24, false, true, 255, 255, 255, 0, 8, 16); + break; + default: + throw new RuntimeException("Unknown color depth."); + } + + } + + /** + * Store information about server screen size. + */ + public void setFramebufferSize(int width, int height) { + if (height <= 0 || width <= 0) + throw new RuntimeException("Incorrect framebuffer size: " + width + "x" + height + "."); + + this.framebufferWidth = width; + this.framebufferHeight = height; + + callSizeChangeListeners(width, height); + } + + protected void callSizeChangeListeners(int width, int height) { + for(SizeChangeListener listener:sizeChangeListeners) { + listener.sizeChanged(width, height); + } + } + + /** + * Store server desktop name. + */ + public void setDesktopName(String desktopName) { + this.desktopName = desktopName; + } + + // Getters for variables, as usual + + public String getDesktopName() { + return desktopName; + } + + public int getBytesPerPixel() { + return bytesPerPixel; + } + + public int getFramebufferHeight() { + return framebufferHeight; + } + + public int getFramebufferWidth() { + return framebufferWidth; + } + + public boolean isRGB888_32_LE() { + return (colorDepth == 24 && bitsPerPixel == 32 && redShift == 0 && greenShift == 8 && blueShift == 16 && redMax == 255 && greenMax == 255 && blueMax == 255 + && !bigEndianFlag && trueColorFlag); + } + + @Override + public String toString() { + return "ScreenDescription [framebufferWidth=" + framebufferWidth + ", framebufferHeight=" + framebufferHeight + ", desktopName=" + desktopName + + ", bytesPerPixel=" + bytesPerPixel + ", depth=" + colorDepth + ", bitsPerPixel=" + bitsPerPixel + ", redShift=" + redShift + ", greenShift=" + greenShift + + ", blueShift=" + blueShift + ", redMax=" + redMax + ", greenMax=" + greenMax + ", blueMax=" + blueMax + ", bigEndianFlag=" + bigEndianFlag + + ", trueColorFlag=" + trueColorFlag + "]"; + } + + public void addSizeChangeListener(SizeChangeListener sizeChangeListener) { + sizeChangeListeners.add(sizeChangeListener); + } + + public int getColorDeph() { + return colorDepth; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/common/SizeChangeListener.java b/services/console-proxy-rdp/rdpconsole/src/main/java/common/SizeChangeListener.java new file mode 100644 index 00000000000..d658d1b95f2 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/common/SizeChangeListener.java @@ -0,0 +1,22 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package common; + +public interface SizeChangeListener { + + public void sizeChanged(int width, int height); +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/AwtRdpKeyboardAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/AwtRdpKeyboardAdapter.java new file mode 100644 index 00000000000..f19f09c0b68 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/AwtRdpKeyboardAdapter.java @@ -0,0 +1,351 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import java.awt.event.KeyEvent; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +import common.KeyOrder; + +public class AwtRdpKeyboardAdapter extends BaseElement { + + /** + * Absence of this flag indicates a key-down event, while its presence + * indicates a key-release event. + */ + public static final int FASTPATH_INPUT_KBDFLAGS_RELEASE = 0x01; + + /** + * Keystroke message contains an extended scancode. For enhanced 101-key and + * 102-key keyboards, extended keys include the right ALT and right CTRL keys + * on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE + * DOWN and ARROW keys in the clusters to the left of the numeric keypad; and + * the Divide ("/") and ENTER keys in the numeric keypad. + */ + public static final int FASTPATH_INPUT_KBDFLAGS_EXTENDED = 0x02; + + public static final int FASTPATH_INPUT_EVENT_SCANCODE = 0; + + public AwtRdpKeyboardAdapter(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + KeyOrder order = (KeyOrder) buf.getOrder(); + buf.unref(); + + ByteBuffer outBuf = new ByteBuffer(2, true); + + int scanCode = map_en_us(order.event); + + // eventHeader (1 byte): An 8-bit, unsigned integer. The format of this + // field is the same as the eventHeader byte field described in section + // 2.2.8.1.2.2. The eventCode bitfield (3 bits in size) MUST be set to + // FASTPATH_INPUT_EVENT_SCANCODE (0). The eventFlags bitfield (5 bits in + // size) contains flags describing the keyboard event. + outBuf.writeByte((scanCode >> 8) | (FASTPATH_INPUT_EVENT_SCANCODE << 5) | ((order.pressed) ? 0 : FASTPATH_INPUT_KBDFLAGS_RELEASE)); + + // keyCode (1 byte): An 8-bit, unsigned integer. The scancode of the key + // which triggered the event. + outBuf.writeByte(scanCode); + + // Push buffer to one pad only, so it can be modified without copying of + // data + pushDataToPad(STDOUT, outBuf); + } + + /** + * Return key scan code (in lower byte) and extended flags (in second byte). + */ + private int map_en_us(KeyEvent event) { + // Also set extended key flag when necessary. + // For enhanced 101-key and 102-key keyboards, extended keys include the + // right ALT and right CTRL keys on the main section of the keyboard; the + // INS, DEL, HOME, END, PAGE UP, PAGE DOWN and ARROW keys in the clusters to + // the left of the numeric keypad; and the Divide ("/") and ENTER keys in + // the numeric keypad. + + switch (event.getKeyCode()) { + // Functional keys + case KeyEvent.VK_ESCAPE: + return 1; + case KeyEvent.VK_F1: + return 59; + case KeyEvent.VK_F2: + return 60; + case KeyEvent.VK_F3: + return 61; + case KeyEvent.VK_F4: + return 62; + case KeyEvent.VK_F5: + return 63; + case KeyEvent.VK_F6: + return 64; + case KeyEvent.VK_F7: + return 65; + case KeyEvent.VK_F8: + return 66; + case KeyEvent.VK_F9: + return 67; + case KeyEvent.VK_F10: + return 68; + case KeyEvent.VK_F11: + return 87; + case KeyEvent.VK_F12: + return 88; + + // Row #1 + case KeyEvent.VK_BACK_QUOTE: + return 41; + case KeyEvent.VK_1: + return 2; + case KeyEvent.VK_2: + return 3; + case KeyEvent.VK_3: + return 4; + case KeyEvent.VK_4: + return 5; + case KeyEvent.VK_5: + return 6; + case KeyEvent.VK_6: + return 7; + case KeyEvent.VK_7: + return 8; + case KeyEvent.VK_8: + return 9; + case KeyEvent.VK_9: + return 10; + case KeyEvent.VK_0: + return 11; + case KeyEvent.VK_MINUS: + return 12; + case KeyEvent.VK_EQUALS: + return 13; + case KeyEvent.VK_BACK_SPACE: + return 14; + + // Row #2 + case KeyEvent.VK_TAB: + return 15; + case KeyEvent.VK_Q: + return 16; + case KeyEvent.VK_W: + return 17; + case KeyEvent.VK_E: + return 18; + case KeyEvent.VK_R: + return 19; + case KeyEvent.VK_T: + return 20; + case KeyEvent.VK_Y: + return 21; + case KeyEvent.VK_U: + return 22; + case KeyEvent.VK_I: + return 23; + case KeyEvent.VK_O: + return 24; + case KeyEvent.VK_P: + return 25; + case KeyEvent.VK_OPEN_BRACKET: + return 26; + case KeyEvent.VK_CLOSE_BRACKET: + return 27; + case KeyEvent.VK_ENTER: + switch (event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_STANDARD: + return 28; + case KeyEvent.KEY_LOCATION_NUMPAD: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 28; + } + + // Row #3 + case KeyEvent.VK_CAPS_LOCK: + return 58; + case KeyEvent.VK_A: + return 30; + case KeyEvent.VK_S: + return 31; + case KeyEvent.VK_D: + return 32; + case KeyEvent.VK_F: + return 33; + case KeyEvent.VK_G: + return 34; + case KeyEvent.VK_H: + return 35; + case KeyEvent.VK_J: + return 36; + case KeyEvent.VK_K: + return 37; + case KeyEvent.VK_L: + return 38; + case KeyEvent.VK_SEMICOLON: + return 39; + case KeyEvent.VK_QUOTE: + return 40; + + // Row #4 + case KeyEvent.VK_SHIFT: + switch (event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 42; + case KeyEvent.KEY_LOCATION_RIGHT: + return 54; + } + case KeyEvent.VK_BACK_SLASH: + return 43; + case KeyEvent.VK_Z: + return 44; + case KeyEvent.VK_X: + return 45; + case KeyEvent.VK_C: + return 46; + case KeyEvent.VK_V: + return 47; + case KeyEvent.VK_B: + return 48; + case KeyEvent.VK_N: + return 49; + case KeyEvent.VK_M: + return 50; + case KeyEvent.VK_COMMA: + return 51; + case KeyEvent.VK_PERIOD: + return 52; + case KeyEvent.VK_SLASH: + return 53; + + // + // Bottom row + case KeyEvent.VK_CONTROL: + switch (event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 29; + case KeyEvent.KEY_LOCATION_RIGHT: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 29; + } + case KeyEvent.VK_WINDOWS: + switch (event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 91; + case KeyEvent.KEY_LOCATION_RIGHT: + return 92; + } + case KeyEvent.VK_ALT: + switch (event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 56; + case KeyEvent.KEY_LOCATION_RIGHT: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 56; + } + case KeyEvent.VK_ALT_GRAPH: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 56; + + case KeyEvent.VK_SPACE: + return 57; + + case KeyEvent.VK_CONTEXT_MENU: + return 93; + + // + // Special keys + case KeyEvent.VK_PRINTSCREEN: + return 55; + case KeyEvent.VK_SCROLL_LOCK: + return 70; + case KeyEvent.VK_PAUSE: + return 29; + + // Text navigation keys + case KeyEvent.VK_INSERT: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 82; + case KeyEvent.VK_HOME: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 71; + case KeyEvent.VK_PAGE_UP: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 73; + case KeyEvent.VK_DELETE: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 83; + case KeyEvent.VK_END: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 79; + case KeyEvent.VK_PAGE_DOWN: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 81; + + // Cursor keys + case KeyEvent.VK_UP: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 72; + case KeyEvent.VK_LEFT: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 75; + case KeyEvent.VK_DOWN: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 80; + case KeyEvent.VK_RIGHT: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 77; + + // Keypad + case KeyEvent.VK_NUM_LOCK: + return 69; + case KeyEvent.VK_DIVIDE: + return (FASTPATH_INPUT_KBDFLAGS_EXTENDED << 8) | 53; + case KeyEvent.VK_MULTIPLY: + return 55; + case KeyEvent.VK_SUBTRACT: + return 74; + case KeyEvent.VK_ADD: + return 78; + + case KeyEvent.VK_NUMPAD7: + return 71; + case KeyEvent.VK_NUMPAD8: + return 72; + case KeyEvent.VK_NUMPAD9: + return 73; + case KeyEvent.VK_NUMPAD4: + return 75; + case KeyEvent.VK_NUMPAD5: + return 76; + case KeyEvent.VK_NUMPAD6: + return 77; + case KeyEvent.VK_NUMPAD1: + return 79; + case KeyEvent.VK_NUMPAD2: + return 80; + case KeyEvent.VK_NUMPAD3: + return 81; + case KeyEvent.VK_NUMPAD0: + return 82; + case KeyEvent.VK_DECIMAL: + return 83; + + default: + System.err.println("Key is not mapped: " + event + "."); + return 57; // Space + } + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/AwtRdpMouseAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/AwtRdpMouseAdapter.java new file mode 100644 index 00000000000..371bffc8ae1 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/AwtRdpMouseAdapter.java @@ -0,0 +1,180 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import java.awt.event.MouseEvent; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +import common.MouseOrder; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240594.aspx + */ +public class AwtRdpMouseAdapter extends BaseElement { + public static int FASTPATH_INPUT_EVENT_MOUSE = 0x01; + + /** + * Event is a mouse wheel rotation. The only valid flags in a wheel rotation + * event are PTRFLAGS_WHEEL_NEGATIVE and the WheelRotationMask; all other + * pointer flags are ignored. + */ + public static int PTRFLAGS_WHEEL = 0x0200; + + /** + * Wheel rotation value (contained in the WheelRotationMask bit field) is + * negative and MUST be sign-extended before injection at the server. + */ + public static int PTRFLAGS_WHEEL_NEGATIVE = 0x0100; + + /** + * Bit field describing the number of rotation units the mouse wheel was + * rotated. The value is negative if the PTRFLAGS_WHEEL_NEGATIVE flag is set. + */ + public static int WHEEL_ROTATION_MASK = 0x01FF; + + /** + * Indicates that the mouse position MUST be updated to the location specified + * by the xPos and yPos fields. + */ + public static int PTRFLAGS_MOVE = 0x0800; + + /** + * Indicates that a click event has occurred at the position specified by the + * xPos and yPos fields. The button flags indicate which button has been + * clicked and at least one of these flags MUST be set. + */ + public static int PTRFLAGS_DOWN = 0x8000; + + /** + * Mouse button 1 (left button) was clicked or released. If the PTRFLAGS_DOWN + * flag is set, then the button was clicked, otherwise it was released. + */ + public static int PTRFLAGS_BUTTON1 = 0x1000; + + /** + * Mouse button 2 (right button) was clicked or released. If the PTRFLAGS_DOWN + * flag is set, then the button was clicked, otherwise it was released. + */ + public static int PTRFLAGS_BUTTON2 = 0x2000; + + /** + * Mouse button 3 (middle button or wheel) was clicked or released. If the + * PTRFLAGS_DOWN flag is set, then the button was clicked, otherwise it was + * released. + */ + public static int PTRFLAGS_BUTTON3 = 0x4000; + + public AwtRdpMouseAdapter(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Get mouse event + MouseOrder order = (MouseOrder) buf.getOrder(); + + ByteBuffer outBuf = new ByteBuffer(7, true); + + // eventHeader (1 byte): An 8-bit, unsigned integer. EventCode bitfield (top + // 3 bits) MUST be set to FASTPATH_INPUT_EVENT_MOUSE (1). The + // eventFlags bitfield (low 5 bits) MUST be zeroed out. + outBuf.writeByte(FASTPATH_INPUT_EVENT_MOUSE << 5); + + // pointerFlags (2 bytes): A 16-bit, unsigned integer. + outBuf.writeShortLE(getPointerFlags(order)); + + // xPos (2 bytes): A 16-bit, unsigned integer. The x-coordinate of the + // pointer. + outBuf.writeShortLE(order.event.getX()); + + // yPos (2 bytes): A 16-bit, unsigned integer. The y-coordinate of the + // pointer. + outBuf.writeShortLE(order.event.getY()); + + // Push buffer to one pad only, so it can be modified without copying of + // data + pushDataToPad(STDOUT, outBuf); + } + + // Remember mouse buttons + protected boolean button1, button2, button3; + + protected int getPointerFlags(MouseOrder order) { + int flags = 0; + + int modifiers = order.event.getModifiersEx(); + + if (order.pressed) { + // Mouse pressed + flags |= PTRFLAGS_DOWN; + + // Check, which one of buttons is released + boolean b1 = ((modifiers & MouseEvent.BUTTON1_DOWN_MASK) > 0) && !button1; + boolean b2 = ((modifiers & MouseEvent.BUTTON2_DOWN_MASK) > 0) && !button2; + boolean b3 = ((modifiers & MouseEvent.BUTTON3_DOWN_MASK) > 0) && !button3; + + if (b1) { + flags |= PTRFLAGS_BUTTON1; + button1 = true; + } + + if (b2) { + flags |= PTRFLAGS_BUTTON3; + button2 = true; + } + + if (b3) { + flags |= PTRFLAGS_BUTTON2; + button3 = true; + } + } else if (order.released) { + // Mouse released + + // Check, which one of buttons is released + boolean b1 = !((modifiers & MouseEvent.BUTTON1_DOWN_MASK) > 0) && button1; + boolean b2 = !((modifiers & MouseEvent.BUTTON2_DOWN_MASK) > 0) && button2; + boolean b3 = !((modifiers & MouseEvent.BUTTON3_DOWN_MASK) > 0) && button3; + + if (b1) { + flags |= PTRFLAGS_BUTTON1; + button1 = false; + } + + if (b2) { + flags |= PTRFLAGS_BUTTON3; + button2 = false; + } + + if (b3) { + flags |= PTRFLAGS_BUTTON2; + button3 = false; + } + } else { + // Mouse moved + flags |= PTRFLAGS_MOVE; + } + + return flags; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientConfirmActivePDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientConfirmActivePDU.java new file mode 100644 index 00000000000..9a1caab0c88 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientConfirmActivePDU.java @@ -0,0 +1,1132 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.Pipeline; +import streamer.PipelineImpl; + +import common.ScreenDescription; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240488.aspx + */ +public class ClientConfirmActivePDU extends BaseElement { + + public static final String SOURCE_DESC = "MSTSC"; + + public static final int CAPSTYPE_BITMAP = 0x2; + + protected int numberCapabilities; + + protected RdpState state; + protected ScreenDescription screen; + + protected boolean desktopResize = false; + protected int prefferedBitsPerPixel = 16; + + public ClientConfirmActivePDU(String id, ScreenDescription screen, RdpState state) { + super(id); + this.state = state; + this.screen = screen; + } + + @Override + public void handleData(ByteBuffer aBuf, Link link) { + + // Body + ByteBuffer buf = new ByteBuffer(1024, true); + numberCapabilities = 0; + writeCapabilities(buf); + buf.trimAtCursor(); + + // Header + ByteBuffer header = createMCSHeader(buf); + + // Length of source descriptor, including NULL character (LE) + header.writeShortLE(SOURCE_DESC.length() + 1); + + // Length of combined capabilities + 4 bytes (number of capabilities and + // padding) (LE) + header.writeShortLE(buf.length + 4); + + header.writeString(SOURCE_DESC, RdpConstants.CHARSET_8); + header.writeByte(0); + + // Number of capabilities + header.writeShortLE(numberCapabilities); + + // Padding 2 bytes + header.writeShortLE(0); + + header.trimAtCursor(); + + // Prepend header to capabilities + buf.prepend(header); + + // Trim buffer to actual length of data written + buf.length = buf.cursor; + + pushDataToPad(STDOUT, buf); + + sendOtherRequredPackets(); + + } + + private ByteBuffer createMCSHeader(ByteBuffer buf) { + ByteBuffer header = new ByteBuffer(100); + // MCS Send Data Request + header.writeByte(0x64); + + // Initiator: 1004 (1001+3) + header.writeShort(3); + + // Channel ID: 1003 (I/O channel) + header.writeShort(1003); + + // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10) + header.writeByte(0x70); + + int length = buf.length + 26; + + // User data length: (variable length field, LE) + header.writeVariableShort(length); + + // Total length: (LE) + header.writeShortLE(length); + + // PDU type: Confirm Active PDU (0x3), TS_PROTOCOL_VERSION (0x10) (LE) + header.writeShortLE(0x13); + + // PDU source: 1004 (LE) + header.writeShortLE(1004); + + // Share ID, e.g. 0x000103ea (LE) + header.writeIntLE((int) state.serverShareId); + + // Originator ID: 1002 (LE) + header.writeShortLE(1002); + return header; + } + + private void sendOtherRequredPackets() { + // Send sequence in bulk + + sendSynchronizePDU(); + sendControlPDUActionCooperate(); + sendControlPDUActionRequestControl(); + // sendBitmapCachePersistentListPDU(); + sendFontListPDU(); + } + + private void sendFontListPDU() { + { + int length = 1024; // Large enough + ByteBuffer buf = new ByteBuffer(length, true); + + /* @formatter:off */ + buf.writeBytes(new byte[] { + // MCS Send Data Request + (byte)0x64, + // Initiator: 1004 (1001+3) + (byte)0x00, (byte)0x03, + // Channel ID: 1003 (I/O channel) + (byte)0x03, (byte)0xeb, + // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10) + (byte)0x70, + // User data length: 26 bytes (0x1a, variable length field) + (byte)0x80, (byte)0x1a, + + // Total length: 26 bytes (0x1a, LE) + (byte)0x1a, (byte)0x00, + // PDU type: PDUTYPE_DATAPDU (0x7), PDU version: 1 (0x0010) (LE) + (byte)0x17, (byte)0x00, + // PDU source: 1004 (LE) + (byte)0xec, (byte)0x03, + }); + // Share ID, 4 bytes (LE) + buf.writeIntLE((int)state.serverShareId); + + buf.writeBytes(new byte[] { + // Padding 1 byte + (byte)0x00, + // Stream ID: STREAM_LOW (1) + (byte)0x01, + // uncompressedLength : 12 bytes (LE) + (byte)0x0c, (byte)0x00, + + // pduType2: PDUTYPE2_FONTLIST (39) + (byte)0x27, + // generalCompressedType: 0 + (byte)0x00, + // generalCompressedLength: 0 (LE) + (byte)0x00, (byte)0x00, + + // numberEntries (should be set to zero): 0 (LE) + (byte)0x00, (byte)0x00, + // totalNumEntries (should be set to zero): 0 (LE) + (byte)0x00, (byte)0x00, + // listFlags (should be set to 0x3): 0x0003 (LE), FONTLIST_LAST(0x2) | FONTLIST_FIRST(0x1) + (byte)0x03, (byte)0x00, + // entrySize: 50 bytes (0x0032, LE) + (byte)0x32, (byte)0x00, + }); + /* @formatter:on */ + + // Trim buffer to actual length of data written + buf.trimAtCursor(); + + pushDataToPad(STDOUT, buf); + } + } + + private void sendControlPDUActionRequestControl() { + int length = 1024; // Large enough + ByteBuffer buf = new ByteBuffer(length, true); + + /* @formatter:off */ + buf.writeBytes(new byte[] { + // MCS Send Data Request + (byte)0x64, + // Initiator: 1004 (1001+3) + (byte)0x00, (byte)0x03, + // Channel ID: 1003 (I/O channel) + (byte)0x03, (byte)0xeb, + // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10) + (byte)0x70, + // User data length: 26 bytes (0x1a, variable length field) + (byte)0x80, (byte)0x1a, + + // Total length: 26 bytes (0x1a, LE) + (byte)0x1a, (byte)0x00, + // PDU type: PDUTYPE_DATAPDU (0x7), PDU version: 1 (0x0010) (LE) + (byte)0x17, (byte)0x00, + // PDU source: 1004 (LE) + (byte)0xec, (byte)0x03, + }); + // Share ID, 4 bytes (LE) + buf.writeIntLE((int)state.serverShareId); + + buf.writeBytes(new byte[] { + // Padding 1 byte + (byte)0x00, + // Stream ID: STREAM_LOW (1) + (byte)0x01, + // uncompressedLength : 12 bytes (LE) + (byte)0x0c, (byte)0x00, + // pduType2: PDUTYPE2_CONTROL (20) + (byte)0x14, + // generalCompressedType: 0 + (byte)0x00, + // generalCompressedLength: 0 (LE) + (byte)0x00, (byte)0x00, + + // action: CTRLACTION_REQUEST_CONTROL (1) (LE) + (byte)0x01, (byte)0x00, + // grantId: 0 (LE) + (byte)0x00, (byte)0x00, + // controlId: 0 (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + }); + /* @formatter:on */ + + // Trim buffer to actual length of data written + buf.trimAtCursor(); + + pushDataToPad(STDOUT, buf); + } + + private void sendControlPDUActionCooperate() { + int length = 1024; // Large enough + ByteBuffer buf = new ByteBuffer(length, true); + + /* @formatter:off */ + buf.writeBytes(new byte[] { + // MCS Send Data Request + (byte)0x64, + // Initiator: 1004 (1001+3) + (byte)0x00, (byte)0x03, + // Channel ID: 1003 (I/O channel) + (byte)0x03, (byte)0xeb, + // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10) + (byte)0x70, + // User data length: 26 bytes (0x1a, variable length field) + (byte)0x80, (byte)0x1a, + + // Total length: 26 bytes (0x1a, LE) + (byte)0x1a,(byte)0x00, + // PDU type: PDUTYPE_DATAPDU (0x7), PDU version: 1 (0x0010) (LE) + (byte)0x17, (byte)0x00, + // PDU source: 1004 (LE) + (byte)0xec, (byte)0x03, + }); + // Share ID, 4 bytes (LE) + buf.writeIntLE((int)state.serverShareId); + + buf.writeBytes(new byte[] { + // Padding 1 byte + (byte)0x00, + // Stream ID: STREAM_LOW (1) + (byte)0x01, + // uncompressedLength : 12 bytes (LE) + (byte)0x0c, (byte)0x00, + // pduType2: PDUTYPE2_CONTROL (20) + (byte)0x14, + // generalCompressedType: 0 + (byte)0x00, + // generalCompressedLength: 0 (LE?) + (byte)0x00, (byte)0x00, + // action: CTRLACTION_COOPERATE (4) (LE) + (byte)0x04, (byte)0x00, + // grantId: 0 (LE) + (byte)0x00, (byte)0x00, + // controlId: 0 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + }); + /* @formatter:on */ + + buf.trimAtCursor(); + + pushDataToPad(STDOUT, buf); + } + + private void sendSynchronizePDU() { + + ByteBuffer buf = new ByteBuffer(1024, true); + /* @formatter:off */ + buf.writeBytes(new byte[] { + // MCS send data request + (byte)0x64, + // Initiator: 1004 (1001+3) + (byte)0x00, (byte)0x03, + // Channel ID: 1003 (I/O Channel) + (byte)0x03, (byte)0xeb, + // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10) + (byte)0x70, + // Data length: 22 bytes (0x16, variable length field) + (byte)0x80, (byte)0x16, + + // RDP: total length: 22 bytes (LE) + (byte)0x16, (byte)0x00, + + // PDU type: PDUTYPE_DATAPDU (0x7), TS_PROTOCOL_VERSION (0x10) (LE) + (byte)0x17, (byte)0x00, + + // PDU source: 1007 (LE) + (byte)0xec, (byte)0x03, + }); + // Share ID, 4 bytes (LE) + buf.writeIntLE((int)state.serverShareId); + + buf.writeBytes(new byte[] { + // Padding: 1 byte + (byte)0x00, + // Stream ID: STREAM_LOW (1) + (byte)0x01, + // uncompressedLength : 8 bytes (LE) + (byte)0x08, (byte)0x00, + // pduType2 = PDUTYPE2_SYNCHRONIZE (31) + (byte)0x1f, + // generalCompressedType: 0 + (byte)0x00, + // generalCompressedLength: 0 (LE?) + (byte)0x00, (byte)0x00, + // messageType: SYNCMSGTYPE_SYNC (1) (LE) + (byte)0x01, (byte)0x00, + // targetUser: 0x03ea + (byte)0xea, (byte)0x03, + }); + /* @formatter:on */ + buf.trimAtCursor(); + pushDataToPad(STDOUT, buf); + } + + private void writeCapabilities(ByteBuffer buf) { + writeGeneralCS(buf); + + writeBitmapCS(buf); + + writeOrderCS(buf); + + writeBitmapCache2CS(buf); + + writeColorTableCacheCS(buf); + + writeWindowActivationCS(buf); + + writeControlCS(buf); + + writePointerCS(buf); + + writeShareCS(buf); + + writeInputCS(buf); + + writeBrushCS(buf); + + writeSoundCS(buf); + + writeFontCS(buf); + + writeOffscreenBitmapCS(buf); + + writeGlyphCacheCS(buf); + } + + private void writeBrushCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Brush Capability Set (8 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240564.aspx + (byte) 0x0f, (byte) 0x00, // capability set type: CAPSTYPE_BRUSH (15, + // LE) + (byte) 0x08, (byte) 0x00, // length of capability set: 8 bytes (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // brushSupportLevel: + // BRUSH_DEFAULT + // (0x0, LE) + + }); + } + + private void writeInputCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Input Capability Set (88 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240563.aspx + (byte) 0x0d, + (byte) 0x00, // capability set type: CAPSTYPE_INPUT (13, LE) + (byte) 0x58, + (byte) 0x00, // length of capability set: 88 bytes (LE) + (byte) 0x35, + (byte) 0x00, // inputFlags: 0x0035 (LE), INPUT_FLAG_FASTPATH_INPUT2 + // (0x20), INPUT_FLAG_VKPACKET (0x10), INPUT_FLAG_MOUSEX + // (0x4), INPUT_FLAG_SCANCODES (0x1) + (byte) 0x00, + (byte) 0x00, // Padding 2 bytes + (byte) 0x09, + (byte) 0x04, + (byte) 0x00, + (byte) 0x00, // keyboardLayout: "US" keyboard layout (0x000409, LE) + (byte) 0x00, + (byte) 0x00, + (byte) 0x00, + (byte) 0x00, // keyboardType: unknown (LE) + (byte) 0x00, + (byte) 0x00, + (byte) 0x00, + (byte) 0x00, // keyboardSubType: unknown (LE) + (byte) 0x00, + (byte) 0x00, + (byte) 0x00, + (byte) 0x00, // keyboardFunctionKey: unknown (LE) + // imeFileName: "", (64 bytes, including trailing NULL characters, UCS2) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + }); + } + + private void writeShareCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Share Capability Set (8 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240570.aspx + (byte) 0x09, (byte) 0x00, // capability set type: CAPSTYPE_SHARE (9, LE) + (byte) 0x08, (byte) 0x00, // length of capability set: 8 bytes (LE) + (byte) 0x00, (byte) 0x00, // nodeID (must be set to 0 by client): 0 (LE) + (byte) 0x00, (byte) 0x00, // Padding 2 bytes (LE) + + }); + } + + private void writePointerCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Pointer Capability Set (10 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240562.aspx + (byte) 0x08, (byte) 0x00, // capability set type: CAPSTYPE_POINTER (8, + // LE) + (byte) 0x0a, (byte) 0x00, // length of capability set: 10 bytes (LE) + (byte) 0x00, (byte) 0x00, // colorPointerFlag: FALSE (LE) + (byte) 0x00, (byte) 0x00, // colorPointerCacheSize: 0 (LE) + (byte) 0x14, (byte) 0x00, // pointerCacheSize: 20 (LE) + + }); + } + + private void writeControlCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Control Capability Set (12 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240568.aspx + (byte) 0x05, (byte) 0x00, // capability set type: CAPSTYPE_ACTIVATION + // (7) + (byte) 0x0c, (byte) 0x00, // length of capability set: 12 bytes (LE) + (byte) 0x00, (byte) 0x00, // controlFlags (should be set to 0): 0 (LE) + (byte) 0x00, (byte) 0x00, // remoteDetachFlag (should be set to 0): 0 + // (LE) + (byte) 0x02, (byte) 0x00, // controlInterest (should be set to + // CONTROLPRIORITY_NEVER): + // CONTROLPRIORITY_NEVER (2) (LE) + (byte) 0x02, (byte) 0x00, // detachInterest (should be set to + // CONTROLPRIORITY_NEVER): + // CONTROLPRIORITY_NEVER (2) (LE) + + }); + } + + private void writeWindowActivationCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Window Activation Capability Set (12 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240569.aspx + (byte) 0x07, (byte) 0x00, // capability set type: CAPSTYPE_ACTIVATION + // (7) (LE) + (byte) 0x0c, (byte) 0x00, // length of capability set: 12 bytes (LE) + (byte) 0x00, (byte) 0x00, // helpKeyFlag (should be set to FALSE (0)): + // FALSE (0, LE) + (byte) 0x00, (byte) 0x00, // helpKeyIndexFlag (should be set to FALSE + // (0)): FALSE (0, LE) + (byte) 0x00, (byte) 0x00, // helpExtendedKeyFlag (should be set to FALSE + // (0)): FALSE (0, LE) + (byte) 0x00, (byte) 0x00, // windowManagerKeyFlag (should be set to + // FALSE (0)): FALSE (0, LE) + + }); + } + + private void writeColorTableCacheCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + + // + // Color Table Cache Capability Set (8 bytes), see + // http://msdn.microsoft.com/en-us/library/cc241564.aspx + (byte) 0x0a, (byte) 0x00, // capability set type: CAPSTYPE_COLORCACHE + // (10) (LE) + (byte) 0x08, (byte) 0x00, // length of capability set: 8 bytes (LE) + (byte) 0x06, (byte) 0x00, // Color table cache size (must be ignored + // during capability exchange and is assumed + // to be 0x0006): 6 (LE) + (byte) 0x00, (byte) 0x00, // Padding 2 bytes + + }); + } + + private void writeBitmapCache2CS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Bitmap Cache Rev. 2 Capability Set (40 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240560.aspx + (byte) 0x13, (byte) 0x00, // capability set type: + // CAPSTYPE_BITMAPCACHE_REV2 (19) (LE) + (byte) 0x28, (byte) 0x00, // length of capability set: 40 bytes (LE) + (byte) 0x00, (byte) 0x00, // Cache flags: 0 (LE) + (byte) 0x00, // Padding 1 byte + (byte) 0x00, // Number of cell caches: 0 + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Bitmap cache0 + // cell info: 0 (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Bitmap cache1 + // cell info: 0 (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Bitmap cache2 + // cell info: 0 (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Bitmap cache3 + // cell info: 0 (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Bitmap cache4 + // cell info: 0 (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Padding 12 bytes + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Padding + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Padding + }); + } + + private void writeGeneralCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // Capabilities, see + // http://msdn.microsoft.com/en-us/library/cc240486.aspx + + // + // General capability set (24 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240549.aspx + (byte) 0x01, (byte) 0x00, // capability set type: CAPSTYPE_GENERAL (1) + // (LE) + (byte) 0x18, (byte) 0x00, // length of capability set: 24 bytes (LE) + (byte) 0x01, (byte) 0x00, // TS_OSMAJORTYPE_WINDOWS (1) (LE) + (byte) 0x03, (byte) 0x00, // TS_OSMINORTYPE_WINDOWS_NT (3) (LE) + (byte) 0x00, (byte) 0x02, // TS_CAPS_PROTOCOLVERSION (0x0200) (LE) + (byte) 0x00, (byte) 0x00, // Padding 2 bytes + (byte) 0x00, (byte) 0x00, // generalCompressionTypes: 0 (LE) + + // Extra flags: 0x040d (LE) + // FastPathOutput: (...............1) Advertiser supports fast-path + // output + // ShadowCompression: (..............0.) Advertiser NOT supports shadow + // compression + // LongLengthCredentials: (.............1..) Advertiser supports + // long-length credentials for the user name, password, or domain name + // SessionAutoreconnection: (............1...) Advertiser supports + // session auto-reconnection + // ImprovedEncryptionChecksum: (...........0....) Client and server NOT + // support improved encryption checksum + // Reserved1: (......00000.....) + // CompressedBitMapDataFlag: (.....1..........) No 8-UINT8 header is + // present for compressed bitmap data + // Reserved2: (00000...........) + (byte) 0x0d, (byte) 0x04, + + (byte) 0x00, (byte) 0x00, // updateCapabilityFlag: 0 (LE) + (byte) 0x00, (byte) 0x00, // remoteUnshareFlag: 0 (LE) + (byte) 0x00, (byte) 0x00, // generalCompressionLevel: 0 (LE) + (byte) 0x00, // refreshRectSupport: FALSE (0) + (byte) 0x00, // suppressOutputSupport: FALSE (0) + + }); + } + + private void writeBitmapCS(ByteBuffer buf) { + // Bitmap capability set (28 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240554.aspx + + numberCapabilities++; + + // Capability set type: CAPSTYPE_BITMAP (2) (LE) + buf.writeShortLE(CAPSTYPE_BITMAP); + + // Length of capability set: 28 bytes (LE) + buf.writeShortLE(28); + + // preferredBitsPerPixel: 16 bpp (LE) + buf.writeShortLE(prefferedBitsPerPixel); + + // receive1BitPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE) + buf.writeShortLE(1); + + // receive4BitsPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE) + buf.writeShortLE(1); + + // receive8BitsPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE) + buf.writeShortLE(1); + + // Desktop width and height (LE) + buf.writeShortLE(screen.getFramebufferWidth()); + buf.writeShortLE(screen.getFramebufferHeight()); + + // Padding 2 bytes + buf.writeShortLE(0); + + // desktopResizeFlag (LE) + buf.writeShortLE((desktopResize )?1:0); + + buf.writeBytes(new byte[] { + (byte) 0x01, (byte) 0x00, // bitmapCompressionFlag (must be set to TRUE + // (0x1)): TRUE (0x1) (LE) + (byte) 0x00, // highColorFlags (field is ignored and SHOULD be set to + // zero): 0 + (byte) 0x01, // drawingFlags: 0x1 TODO: padding, why 0x1 ??? + (byte) 0x01, (byte) 0x00, // multipleRectangleSupport: TRUE (LE) + (byte) 0x00, (byte) 0x00, // Padding 2 bytes + + }); + } + + private void writeOrderCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Order Capability Set (88 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240556.aspx + (byte) 0x03, + (byte) 0x00, // capability set type: CAPSTYPE_ORDER (3) (LE) + (byte) 0x58, + (byte) 0x00, // length of capability set: 88 bytes (LE) + // terminalDescriptor = "" (16 bytes, UCS2) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // pad4octetsA + (byte) 0x01, (byte) 0x00, // desktopSaveXGranularity (ignored): 1 (LE) + (byte) 0x14, (byte) 0x00, // desktopSaveYGranularity (ignored): 20 (LE) + (byte) 0x00, (byte) 0x00, // pad2octetsA (ignored) + (byte) 0x01, (byte) 0x00, // maximumOrderLevel: ORD_LEVEL_1_ORDERS (1) + (byte) 0x00, (byte) 0x00, // number of fonts (ignored): 0 + (byte) 0x4a, (byte) 0x00, // orderFlags = 0x004a (LE), + // SOLIDPATTERNBRUSHONLY (0x40), + // ZEROBOUNDSDELTASSUPPORT (0x8, MUST), + // NEGOTIATEORDERSUPPORT (0x2, MUST) + // Order support: 32 bytes (no primary drawing orders are supported, so + // this array MUST be initialized to all zeros, use 0x01 for TRUE). + (byte) 0x00, // TS_NEG_DSTBLT_INDEX: FALSE + (byte) 0x00, // TS_NEG_PATBLT_INDEX: FALSE + (byte) 0x00, // TS_NEG_SCRBLT_INDEX: FALSE + (byte) 0x00, // TS_NEG_MEMBLT_INDEX: FALSE + (byte) 0x00, // TS_NEG_MEM3BLT_INDEX: FALSE + (byte) 0x00, // TS_NEG_ATEXTOUT_INDEX: FALSE + (byte) 0x00, // TS_NEG_AEXTTEXTOUT_INDEX: FALSE + (byte) 0x00, // TS_NEG_DRAWNINEGRID_INDEX: FALSE + (byte) 0x00, // TS_NEG_LINETO_INDEX: FALSE + (byte) 0x00, // TS_NEG_MULTI_DRAWNINEGRID_INDEX: FALSE + (byte) 0x00, // TS_NEG_OPAQUERECT_INDEX: FALSE + (byte) 0x00, // TS_NEG_SAVEBITMAP_INDEX: FALSE + (byte) 0x00, // TS_NEG_WTEXTOUT_INDEX: FALSE + (byte) 0x00, // TS_NEG_MEMBLT_R2_INDEX: FALSE + (byte) 0x00, // TS_NEG_MEM3BLT_R2_INDEX: FALSE + (byte) 0x00, // TS_NEG_MULTIDSTBLT_INDEX: FALSE + (byte) 0x00, // TS_NEG_MULTIPATBLT_INDEX: FALSE + (byte) 0x00, // TS_NEG_MULTISCRBLT_INDEX: FALSE + (byte) 0x00, // TS_NEG_MULTIOPAQUERECT_INDEX: FALSE + (byte) 0x00, // TS_NEG_FAST_INDEX_INDEX: FALSE + (byte) 0x00, // TS_NEG_POLYGON_SC_INDEX: FALSE + (byte) 0x00, // TS_NEG_POLYGON_CB_INDEX: FALSE + (byte) 0x00, // TS_NEG_POLYLINE_INDEX: TRUE + (byte) 0x00, // Unused: 0 + (byte) 0x00, // TS_NEG_FAST_GLYPH_INDEX: FALSE + (byte) 0x00, // TS_NEG_ELLIPSE_SC_INDEX: FALSE + (byte) 0x00, // TS_NEG_ELLIPSE_CB_INDEX: FALSE + (byte) 0x00, // TS_NEG_INDEX_INDEX: FALSE + (byte) 0x00, // TS_NEG_WEXTTEXTOUT_INDEX: FALSE + (byte) 0x00, // TS_NEG_WLONGTEXTOUT_INDEX: FALSE + (byte) 0x00, // TS_NEG_WLONGEXTTEXTOUT_INDEX: FALSE + (byte) 0x00, // Unused: 0 + (byte) 0x00, (byte) 0x00, // Text flags (ignored): 0 (LE) + (byte) 0x00, (byte) 0x00, // Order support extra flags: 0 (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Padding 4 bytes + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Desktop save size + // (ignored): 0 + // (assumed to be + // 230400 bytes + // (480*480, + // 0x38400, LE)) + (byte) 0x00, (byte) 0x00, // Padding 2 bytes + (byte) 0x00, (byte) 0x00, // Padding 2 bytes + (byte) 0xe4, (byte) 0x04, // Text ANSI Code Page: 1252, ANSI - Latin I + // (0x04e4, LE) + (byte) 0x00, (byte) 0x00, // Padding 2 bytes + + }); + } + + private void writeSoundCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Sound Capability Set (8 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240552.aspx + (byte) 0x0c, (byte) 0x00, // capability set type: CAPSTYPE_SOUND (12, + // LE) + (byte) 0x08, (byte) 0x00, // length of capability set: 8 bytes (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // soundFlags: + // 0x0000 (LE) // + // SOUND_FLAG_BEEPS + // (0x1) + + }); + } + + private void writeFontCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Font Capability Set (8 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240571.aspx + (byte) 0x0e, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + }); + } + + private void writeOffscreenBitmapCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Offscreen Bitmap Cache Capability Set (12 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240550.aspx + (byte) 0x11, (byte) 0x00, // capability set type: + // CAPSTYPE_OFFSCREENCACHE (17, LE) + (byte) 0x0c, (byte) 0x00, // length of capability set: 12 bytes (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, // offscreenSupportLevel: + // FALSE (LE) + (byte) 0x00, (byte) 0x00, // offscreenCacheSize: 0 (LE) + (byte) 0x00, (byte) 0x00, // offscreenCacheEntries: 0 (LE) + + }); + } + + private void writeGlyphCacheCS(ByteBuffer buf) { + numberCapabilities++; + buf.writeBytes(new byte[] { + // + // Glyph Cache Capability Set (52 bytes), see + // http://msdn.microsoft.com/en-us/library/cc240565.aspx + (byte) 0x10, (byte) 0x00, // capability set type: + // CAPSTYPE_OFFSCREENCACHE (16, LE) + (byte) 0x34, (byte) 0x00, // length of capability set: 52 bytes (LE) + // Glyph Cache (40 bytes) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x04, (byte) 0x00, // CacheMaximumCellSize: 4 (LE) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x04, (byte) 0x00, // CacheMaximumCellSize: 4 (LE) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x08, (byte) 0x00, // CacheMaximumCellSize: 4 (LE) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x08, (byte) 0x00, // CacheMaximumCellSize: 4 (LE) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x10, (byte) 0x00, // CacheMaximumCellSize: 4 (LE) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x20, (byte) 0x00, // CacheMaximumCellSize: 4 (LE) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x40, (byte) 0x00, // CacheMaximumCellSize: 4 (LE) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x80, (byte) 0x00, // CacheMaximumCellSize: 4 (LE) + (byte) 0xfe, (byte) 0x00, // CacheEntries: 254 (LE) + (byte) 0x00, (byte) 0x01, // CacheMaximumCellSize: 4 (LE) + (byte) 0x40, (byte) 0x00, // CacheEntries: 64 (LE) + (byte) 0x00, (byte) 0x08, // CacheMaximumCellSize: 2048 (LE) + // FragCache + (byte) 0x00, (byte) 0x01, // CacheEntries: 256 (LE) + (byte) 0x00, (byte) 0x01, // CacheMaximumCellSize: 256 (LE) + // + (byte) 0x00, (byte) 0x00, // GlyphSupportLevel: GLYPH_SUPPORT_NONE (0x0, + // LE) + (byte) 0x00, (byte) 0x00, // Padding 2 bytes + }); + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + /* @formatter:off */ + byte[] packet = new byte[] { + // MCS Send Data Request + (byte)0x64, + + // Initiator: 1004 (1001+3) + (byte)0x00, (byte)0x03, + + // Channel ID: 1003 (I/O channel) + (byte)0x03, (byte)0xeb, + + // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10) + (byte)0x70, + + // User data length: 432 bytes (0x1b0, variable length field) + (byte)0x81, (byte)0xb0, + + // Total length: 432 bytes (0x1b0, LE) + (byte)0xb0, (byte)0x01, + + // PDU type: Confirm Active PDU (0x3), TS_PROTOCOL_VERSION (0x10) (LE) + (byte)0x13, (byte)0x00, + + // PDU source: 1004 (LE) + (byte)0xec, (byte)0x03, + + // Share ID: 0x000103ea (LE) + (byte)0xea, (byte)0x03, (byte)0x01, (byte)0x00, + + // Originator ID: 1002 (LE) + (byte)0xea, (byte)0x03, + + // Length of source descriptor: 6 bytes (including NULL character) (LE) + (byte)0x06, (byte)0x00, + + // Length of combined capabilities: 410 bytes (LE) + (byte)0x9a, (byte)0x01, + + // Source descriptor: "MSTSC" ??? + (byte)0x4d, (byte)0x53, (byte)0x54, (byte)0x53, (byte)0x43, (byte)0x00, + + // Number of capabilities: 15 (LE) + (byte)0x0f, (byte)0x00, + + // Padding 2 bytes + (byte)0x00, (byte)0x00, + + // Capabilities, see http://msdn.microsoft.com/en-us/library/cc240486.aspx + + // + // General capability set (24 bytes), see http://msdn.microsoft.com/en-us/library/cc240549.aspx + (byte)0x01, (byte)0x00, // capability set type: CAPSTYPE_GENERAL (1) (LE) + (byte)0x18, (byte)0x00, // length of capability set: 24 bytes (LE) + (byte)0x01, (byte)0x00, // TS_OSMAJORTYPE_WINDOWS (1) (LE) + (byte)0x03, (byte)0x00, // TS_OSMINORTYPE_WINDOWS_NT (3) (LE) + (byte)0x00, (byte)0x02, // TS_CAPS_PROTOCOLVERSION (0x0200) (LE) + (byte)0x00, (byte)0x00, // Padding 2 bytes + (byte)0x00, (byte)0x00, // generalCompressionTypes: 0 (LE) + + // Extra flags: 0x040d (LE) +// FastPathOutput: (...............1) Advertiser supports fast-path output +// ShadowCompression: (..............0.) Advertiser NOT supports shadow compression +// LongLengthCredentials: (.............1..) Advertiser supports long-length credentials for the user name, password, or domain name +// SessionAutoreconnection: (............1...) Advertiser supports session auto-reconnection +// ImprovedEncryptionChecksum: (...........0....) Client and server NOT support improved encryption checksum +// Reserved1: (......00000.....) +// CompressedBitMapDataFlag: (.....1..........) No 8-UINT8 header is present for compressed bitmap data +// Reserved2: (00000...........) + (byte)0x0d, (byte)0x04, + + (byte)0x00, (byte)0x00, // updateCapabilityFlag: 0 (LE) + (byte)0x00, (byte)0x00, // remoteUnshareFlag: 0 (LE) + (byte)0x00, (byte)0x00, // generalCompressionLevel: 0 (LE) + (byte)0x00, // refreshRectSupport: FALSE (0) + (byte)0x00, // suppressOutputSupport: FALSE (0) + + // + // Bitmap capability set (28 bytes), see http://msdn.microsoft.com/en-us/library/cc240554.aspx + (byte)0x02, (byte)0x00, // capability set type: CAPSTYPE_BITMAP (2) (LE) + (byte)0x1c, (byte)0x00, // length of capability set: 28 bytes (LE) + (byte)0x10, (byte)0x00, // preferredBitsPerPixel: 16 bpp (LE) + (byte)0x01, (byte)0x00, // receive1BitPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE) + (byte)0x01, (byte)0x00, // receive4BitsPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE) + (byte)0x01, (byte)0x00, // receive8BitsPerPixel (ignored and SHOULD be set to TRUE (0x1)): TRUE (0x1) (LE) + (byte)0x00, (byte)0x04, // desktopWidth = 1024 pixels (LE) + (byte)0x00, (byte)0x03, // desktopHeight = 768 pixels (LE) + (byte)0x00, (byte)0x00, // Padding 2 bytes + (byte)0x00, (byte)0x00, // desktopResizeFlag: FALSE (0x0) (LE) + (byte)0x01, (byte)0x00, // bitmapCompressionFlag (must be set to TRUE (0x1)): TRUE (0x1) (LE) + (byte)0x00, // highColorFlags (field is ignored and SHOULD be set to zero): 0 + (byte)0x01, // drawingFlags: 0x1 TODO: padding, why 0x1 ??? + (byte)0x01, (byte)0x00, // multipleRectangleSupport: TRUE (LE) + (byte)0x00, (byte)0x00, // Padding 2 bytes + + // + // Order Capability Set (88 bytes), see http://msdn.microsoft.com/en-us/library/cc240556.aspx + (byte)0x03, (byte)0x00, // capability set type: CAPSTYPE_ORDER (3) (LE) + (byte)0x58, (byte)0x00, // length of capability set: 88 bytes (LE) + // terminalDescriptor = "" (16 bytes, UCS2) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // pad4octetsA + (byte)0x01, (byte)0x00, // desktopSaveXGranularity (ignored): 1 (LE) + (byte)0x14, (byte)0x00, // desktopSaveYGranularity (ignored): 20 (LE) + (byte)0x00, (byte)0x00, // pad2octetsA (ignored) + (byte)0x01, (byte)0x00, // maximumOrderLevel: ORD_LEVEL_1_ORDERS (1) + (byte)0x00, (byte)0x00, // number of fonts (ignored): 0 + (byte)0x4a, (byte)0x00, // orderFlags = 0x004a (LE), SOLIDPATTERNBRUSHONLY (0x40), ZEROBOUNDSDELTASSUPPORT (0x8, MUST), NEGOTIATEORDERSUPPORT (0x2, MUST) + // Order support: 32 bytes (no primary drawing orders are supported, so this array MUST be initialized to all zeros, use 0x01 for TRUE). + (byte)0x00, // TS_NEG_DSTBLT_INDEX: FALSE + (byte)0x00, // TS_NEG_PATBLT_INDEX: FALSE + (byte)0x00, // TS_NEG_SCRBLT_INDEX: FALSE + (byte)0x00, // TS_NEG_MEMBLT_INDEX: FALSE + (byte)0x00, // TS_NEG_MEM3BLT_INDEX: FALSE + (byte)0x00, // TS_NEG_ATEXTOUT_INDEX: FALSE + (byte)0x00, // TS_NEG_AEXTTEXTOUT_INDEX: FALSE + (byte)0x00, // TS_NEG_DRAWNINEGRID_INDEX: FALSE + (byte)0x00, // TS_NEG_LINETO_INDEX: FALSE + (byte)0x00, // TS_NEG_MULTI_DRAWNINEGRID_INDEX: FALSE + (byte)0x00, // TS_NEG_OPAQUERECT_INDEX: FALSE + (byte)0x00, // TS_NEG_SAVEBITMAP_INDEX: FALSE + (byte)0x00, // TS_NEG_WTEXTOUT_INDEX: FALSE + (byte)0x00, // TS_NEG_MEMBLT_R2_INDEX: FALSE + (byte)0x00, // TS_NEG_MEM3BLT_R2_INDEX: FALSE + (byte)0x00, // TS_NEG_MULTIDSTBLT_INDEX: FALSE + (byte)0x00, // TS_NEG_MULTIPATBLT_INDEX: FALSE + (byte)0x00, // TS_NEG_MULTISCRBLT_INDEX: FALSE + (byte)0x00, // TS_NEG_MULTIOPAQUERECT_INDEX: FALSE + (byte)0x00, // TS_NEG_FAST_INDEX_INDEX: FALSE + (byte)0x00, // TS_NEG_POLYGON_SC_INDEX: FALSE + (byte)0x00, // TS_NEG_POLYGON_CB_INDEX: FALSE + (byte)0x00, // TS_NEG_POLYLINE_INDEX: TRUE + (byte)0x00, // Unused: 0 + (byte)0x00, // TS_NEG_FAST_GLYPH_INDEX: FALSE + (byte)0x00, // TS_NEG_ELLIPSE_SC_INDEX: FALSE + (byte)0x00, // TS_NEG_ELLIPSE_CB_INDEX: FALSE + (byte)0x00, // TS_NEG_INDEX_INDEX: FALSE + (byte)0x00, // TS_NEG_WEXTTEXTOUT_INDEX: FALSE + (byte)0x00, // TS_NEG_WLONGTEXTOUT_INDEX: FALSE + (byte)0x00, // TS_NEG_WLONGEXTTEXTOUT_INDEX: FALSE + (byte)0x00, // Unused: 0 + (byte)0x00, (byte)0x00, // Text flags (ignored): 0 (LE) + (byte)0x00, (byte)0x00, // Order support extra flags: 0 (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Padding 4 bytes + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Desktop save size (ignored): 0 (assumed to be 230400 bytes (480*480, 0x38400, LE)) + (byte)0x00, (byte)0x00, // Padding 2 bytes + (byte)0x00, (byte)0x00, // Padding 2 bytes + (byte)0xe4, (byte)0x04, // Text ANSI Code Page: 1252, ANSI - Latin I (0x04e4, LE) + (byte)0x00, (byte)0x00, // Padding 2 bytes + + // + // Bitmap Cache Rev. 2 Capability Set (40 bytes), see http://msdn.microsoft.com/en-us/library/cc240560.aspx + (byte)0x13, (byte)0x00, // capability set type: CAPSTYPE_BITMAPCACHE_REV2 (19) (LE) + (byte)0x28, (byte)0x00, // length of capability set: 40 bytes (LE) + (byte)0x00, (byte)0x00, // Cache flags: 0 (LE) + (byte)0x00, // Padding 1 byte + (byte)0x00, // Number of cell caches: 0 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Bitmap cache0 cell info: 0 (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Bitmap cache1 cell info: 0 (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Bitmap cache2 cell info: 0 (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Bitmap cache3 cell info: 0 (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Bitmap cache4 cell info: 0 (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Padding 12 bytes + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Padding + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // Padding + + // + // Color Table Cache Capability Set (8 bytes), see http://msdn.microsoft.com/en-us/library/cc241564.aspx + (byte)0x0a, (byte)0x00, // capability set type: CAPSTYPE_COLORCACHE (10) (LE) + (byte)0x08, (byte)0x00, // length of capability set: 8 bytes (LE) + (byte)0x06, (byte)0x00, // Color table cache size (must be ignored during capability exchange and is assumed to be 0x0006): 6 (LE) + (byte)0x00, (byte)0x00, // Padding 2 bytes + + // + // Window Activation Capability Set (12 bytes), see http://msdn.microsoft.com/en-us/library/cc240569.aspx + (byte)0x07, (byte)0x00, // capability set type: CAPSTYPE_ACTIVATION (7) (LE) + (byte)0x0c, (byte)0x00, // length of capability set: 12 bytes (LE) + (byte)0x00, (byte)0x00, // helpKeyFlag (should be set to FALSE (0)): FALSE (0, LE) + (byte)0x00, (byte)0x00, // helpKeyIndexFlag (should be set to FALSE (0)): FALSE (0, LE) + (byte)0x00, (byte)0x00, // helpExtendedKeyFlag (should be set to FALSE (0)): FALSE (0, LE) + (byte)0x00, (byte)0x00, // windowManagerKeyFlag (should be set to FALSE (0)): FALSE (0, LE) + + // + // Control Capability Set (12 bytes), see http://msdn.microsoft.com/en-us/library/cc240568.aspx + (byte)0x05, (byte)0x00, // capability set type: CAPSTYPE_ACTIVATION (7) + (byte)0x0c, (byte)0x00, // length of capability set: 12 bytes (LE) + (byte)0x00, (byte)0x00, // controlFlags (should be set to 0): 0 (LE) + (byte)0x00, (byte)0x00, // remoteDetachFlag (should be set to 0): 0 (LE) + (byte)0x02, (byte)0x00, // controlInterest (should be set to CONTROLPRIORITY_NEVER): CONTROLPRIORITY_NEVER (2) (LE) + (byte)0x02, (byte)0x00, // detachInterest (should be set to CONTROLPRIORITY_NEVER): CONTROLPRIORITY_NEVER (2) (LE) + + // + // Pointer Capability Set (10 bytes), see http://msdn.microsoft.com/en-us/library/cc240562.aspx + (byte)0x08, (byte)0x00, // capability set type: CAPSTYPE_POINTER (8, LE) + (byte)0x0a, (byte)0x00, // length of capability set: 10 bytes (LE) + (byte)0x00, (byte)0x00, // colorPointerFlag: FALSE (LE) + (byte)0x00, (byte)0x00, // colorPointerCacheSize: 0 (LE) + (byte)0x14, (byte)0x00, // pointerCacheSize: 20 (LE) + + // + // Share Capability Set (8 bytes), see http://msdn.microsoft.com/en-us/library/cc240570.aspx + (byte)0x09, (byte)0x00, // capability set type: CAPSTYPE_SHARE (9, LE) + (byte)0x08, (byte)0x00, // length of capability set: 8 bytes (LE) + (byte)0x00, (byte)0x00, // nodeID (must be set to 0 by client): 0 (LE) + (byte)0x00, (byte)0x00, // Padding 2 bytes (LE) + + // + // Input Capability Set (88 bytes), see http://msdn.microsoft.com/en-us/library/cc240563.aspx + (byte)0x0d, (byte)0x00, // capability set type: CAPSTYPE_INPUT (13, LE) + (byte)0x58, (byte)0x00, // length of capability set: 88 bytes (LE) + (byte)0x35, (byte)0x00, // inputFlags: 0x0035 (LE), INPUT_FLAG_FASTPATH_INPUT2 (0x20), INPUT_FLAG_VKPACKET (0x10), INPUT_FLAG_MOUSEX (0x4), INPUT_FLAG_SCANCODES (0x1) + (byte)0x00, (byte)0x00, // Padding 2 bytes + (byte)0x09, (byte)0x04, (byte)0x00, (byte)0x00, // keyboardLayout: "US" keyboard layout (0x000409, LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // keyboardType: unknown (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // keyboardSubType: unknown (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // keyboardFunctionKey: unknown (LE) + // imeFileName: "", (64 bytes, including trailing NULL characters, UCS2) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + + // + // Brush Capability Set (8 bytes), see http://msdn.microsoft.com/en-us/library/cc240564.aspx + (byte)0x0f, (byte)0x00, // capability set type: CAPSTYPE_BRUSH (15, LE) + (byte)0x08, (byte)0x00, // length of capability set: 8 bytes (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // brushSupportLevel: BRUSH_DEFAULT (0x0, LE) + + // + // Sound Capability Set (8 bytes), see http://msdn.microsoft.com/en-us/library/cc240552.aspx + (byte)0x0c, (byte)0x00, // capability set type: CAPSTYPE_SOUND (12, LE) + (byte)0x08, (byte)0x00, // length of capability set: 8 bytes (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // soundFlags: 0x0000 (LE) // SOUND_FLAG_BEEPS (0x1) + + // + // Font Capability Set (8 bytes), see http://msdn.microsoft.com/en-us/library/cc240571.aspx + (byte)0x0e, (byte)0x00, + (byte)0x08, (byte)0x00, + (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, + + // + // Offscreen Bitmap Cache Capability Set (12 bytes), see http://msdn.microsoft.com/en-us/library/cc240550.aspx + (byte)0x11, (byte)0x00, // capability set type: CAPSTYPE_OFFSCREENCACHE (17, LE) + (byte)0x0c, (byte)0x00, // length of capability set: 12 bytes (LE) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, // offscreenSupportLevel: FALSE (LE) + (byte)0x00, (byte)0x00, // offscreenCacheSize: 0 (LE) + (byte)0x00, (byte)0x00, // offscreenCacheEntries: 0 (LE) + + // + // Glyph Cache Capability Set (52 bytes), see http://msdn.microsoft.com/en-us/library/cc240565.aspx + (byte)0x10, (byte)0x00, // capability set type: CAPSTYPE_OFFSCREENCACHE (16, LE) + (byte)0x34, (byte)0x00, // length of capability set: 52 bytes (LE) + // Glyph Cache (40 bytes) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x04, (byte)0x00, // CacheMaximumCellSize: 4 (LE) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x04, (byte)0x00, // CacheMaximumCellSize: 4 (LE) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x08, (byte)0x00, // CacheMaximumCellSize: 4 (LE) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x08, (byte)0x00, // CacheMaximumCellSize: 4 (LE) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x10, (byte)0x00, // CacheMaximumCellSize: 4 (LE) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x20, (byte)0x00, // CacheMaximumCellSize: 4 (LE) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x40, (byte)0x00, // CacheMaximumCellSize: 4 (LE) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x80, (byte)0x00, // CacheMaximumCellSize: 4 (LE) + (byte)0xfe, (byte)0x00, // CacheEntries: 254 (LE) + (byte)0x00, (byte)0x01, // CacheMaximumCellSize: 4 (LE) + (byte)0x40, (byte)0x00, // CacheEntries: 64 (LE) + (byte)0x00, (byte)0x08, // CacheMaximumCellSize: 2048 (LE) + // FragCache + (byte)0x00, (byte)0x01, // CacheEntries: 256 (LE) + (byte)0x00, (byte)0x01, // CacheMaximumCellSize: 256 (LE) + // + (byte)0x00, (byte)0x00, // GlyphSupportLevel: GLYPH_SUPPORT_NONE (0x0, LE) + (byte)0x00, (byte)0x00, // Padding 2 bytes + }; + /* @formatter:on */ + + RdpState rdpState = new RdpState(); + ScreenDescription screenDescription = new ScreenDescription(); + screenDescription.setFramebufferSize(1024, 768); + + rdpState.serverShareId = 0x000103ea; + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {})); + Element confirm_active = new ClientConfirmActivePDU("confirm_active", screenDescription, rdpState); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet)); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, confirm_active, sink); + pipeline.link("source", "confirm_active", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientFastPathPDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientFastPathPDU.java new file mode 100644 index 00000000000..4c7dcfc50b7 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientFastPathPDU.java @@ -0,0 +1,55 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240589.aspx + */ +public class ClientFastPathPDU extends BaseElement { + + public ClientFastPathPDU(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + if (buf.length > 32767-3) + throw new RuntimeException("Packet is too long: " + buf + "."); + + ByteBuffer data = new ByteBuffer(6); + + // FastPath, 1 event, no checksum, not encrypted + data.writeByte(0x4); + + // Length of full packet, including length field, in network order. + // Topmost bit of first byte indicates that field has 2 bytes + data.writeShort((1 + 2 + buf.length) | 0x8000); + data.trimAtCursor(); + + buf.prepend(data); + + pushDataToAllOuts(buf); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientInfoPDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientInfoPDU.java new file mode 100644 index 00000000000..f5efc2c35b1 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientInfoPDU.java @@ -0,0 +1,456 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240475.aspx + */ +public class ClientInfoPDU extends OneTimeSwitch { + + public static final int INFO_MOUSE = 0x1; + public static final int INFO_DISABLECTRLALTDEL = 0x2; + public static final int INFO_UNICODE = 0x10; + + public static final int INFO_MAXIMIZESHELL = 0x20; + public static final int INFO_LOGONNOTIFY = 0x40; + public static final int INFO_ENABLEWINDOWSKEY = 0x100; + public static final int INFO_MOUSE_HAS_WHEEL = 0x00020000; + public static final int INFO_NOAUDIOPLAYBACK = 0x00080000; + + public static final int PERF_DISABLE_WALLPAPER = 0x1; + public static final int PERF_DISABLE_FULLWINDOWDRAG = 0x2; + public static final int PERF_DISABLE_MENUANIMATIONS = 0x4; + + protected byte[] userName = "".getBytes(RdpConstants.CHARSET_16); + protected byte[] password = "".getBytes(RdpConstants.CHARSET_16); // No effect + protected byte[] alternateShell = "".getBytes(RdpConstants.CHARSET_16); + protected byte[] domain = "".getBytes(RdpConstants.CHARSET_16); + protected byte[] workingDir = "".getBytes(RdpConstants.CHARSET_16); + protected byte[] clientAddress = "192.168.0.100".getBytes(RdpConstants.CHARSET_16); + protected byte[] clientDir = "C:\\Windows\\System32\\mstscax.dll".getBytes(RdpConstants.CHARSET_16); + + protected String standardTimeZoneName = "EET, Standard Time"; + protected String daylightTimeZoneName = "EET, Summer Time"; + protected int standardTimeZoneBias = 0; /* in minutes */ + protected int daylightTimeZoneBias = 60; /* in minutes */ + + public ClientInfoPDU(String id, String userName) { + super(id); + this.userName = userName.getBytes(RdpConstants.CHARSET_16); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + throw new RuntimeException("Unexpected packet: " + buf + "."); + } + + @Override + protected void onStart() { + super.onStart(); + + // Length of packet + ByteBuffer buf = new ByteBuffer(1024, true); + + // MCS Send Data Request PDU + buf.writeByte(0x64); + + // Initiator: 0x03 + 1001 = 1004 + buf.writeShort(3); + + // Channel ID: 1003 + buf.writeShort(1003); + + // Data priority: high, segmentation: begin | end (0x40 | 0x20 | 0x10 = 0x70) + buf.writeByte(0x70); + + // User data length: (variable length field) + int length=224+userName.length + password.length+alternateShell.length+domain.length+workingDir.length+clientAddress.length+clientDir.length; + buf.writeShort(length | 0x8000); + + // Flags: SEC_INFO_PKT (0x4000) + buf.writeShort(0x4000); + + // TS_SECURITY_HEADER::flagsHi - ignored + buf.writeShort(0x0000); + + // Codepage: 0 (UNKNOWN, LE) (use 0x04090409 (1033,1033) for EN_US) + buf.writeIntLE(0x0000); + + // Flags + buf.writeIntLE(INFO_MOUSE | INFO_DISABLECTRLALTDEL | INFO_UNICODE | + INFO_MAXIMIZESHELL | INFO_LOGONNOTIFY | INFO_ENABLEWINDOWSKEY | + INFO_MOUSE_HAS_WHEEL | INFO_NOAUDIOPLAYBACK ); + + // + // Lengths + // + + // cbDomain length: 0 bytes (LE) (NOT including size of mandatory NULL terminator) + buf.writeShortLE(domain.length); + + // cbUserName length: 16 bytes (0x10, LE) (NOT including size of mandatory NULL terminator) + buf.writeShortLE(userName.length); + + // cbPassword length: (LE) (NOT including size of mandatory NULL terminator) + buf.writeShortLE(password.length); + + // cbAlternateShell: (LE) (NOT including size of mandatory NULL terminator) + buf.writeShortLE(alternateShell.length); + + // cbWorkingDir: (LE) (NOT including size of mandatory NULL terminator) + buf.writeShortLE(workingDir.length); + + // + // Values + // + + // Domain: (UCS2), see cbDomain + buf.writeBytes(domain); + buf.writeShort(0); + + // User name: (UCS2), see cbUserName + buf.writeBytes(userName); + buf.writeShort(0); + + // Password: (UCS2), see cbPassword + buf.writeBytes(password); + buf.writeShort(0); + + // Alternate shell: (UCS2), see cbAlternateShell + buf.writeBytes(alternateShell); + buf.writeShort(0); + + // Working directory: (UCS2), see cbWorkingDir + buf.writeBytes(workingDir); + buf.writeShort(0); + + // Client address family: 2 (AF_INET, LE) + buf.writeShortLE(2); + + // cbClientAddress: ( LE) (including the size of the mandatory NULL terminator) + buf.writeShortLE(clientAddress.length+2); + + // Client address: (UCS2) + buf.writeBytes(clientAddress); + buf.writeShort(0); + + // cbClientDir: 64 bytes (0x40, LE) (including the size of the mandatory NULL terminator) + buf.writeShortLE(clientDir.length+2); + + // Client directory: (UCS2) + buf.writeBytes(clientDir); + buf.writeShort(0); + + // + // Client time zone: + // + + // Bias: 0 minutes (LE) + buf.writeIntLE(0); + + // Standard name: "EET, Standard Time" (fixed string: 64 bytes, UCS2) + buf.writeFixedString(62, standardTimeZoneName, RdpConstants.CHARSET_16); + buf.writeShort(0); + + // Standard date + buf.writeBytes(new byte[] { + // wYear: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMonth: unknown (LE) + (byte) 0x00, (byte) 0x00, + // wDayOfWeek: Sunday (LE) + (byte) 0x00, (byte) 0x00, + // wDay: unknown (LE) + (byte) 0x00, (byte) 0x00, + // wHour: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMinute: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wSecond: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMilliseconds: 0 + (byte) 0x00, (byte) 0x00, + + }); + + // StandardBias: 0 minutes (LE) + buf.writeIntLE(standardTimeZoneBias); + + // Daylight name: "EET, Summer Time" (fixed string: 64 bytes, UCS2) + buf.writeFixedString(62, daylightTimeZoneName, RdpConstants.CHARSET_16); + buf.writeShort(0); + + // Daylight date + buf.writeBytes(new byte[] { + // wYear: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMonth: unknown (LE) + (byte) 0x00, (byte) 0x00, + // wDayOfWeek: Sunday (LE) + (byte) 0x00, (byte) 0x00, + // wDay: unknown (LE) + (byte) 0x00, (byte) 0x00, + // wHour: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMinute: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wSecond: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMilliseconds: 0 + (byte) 0x00, (byte) 0x00, + + }); + + // Daylight bias: 60 minutes (LE) + buf.writeIntLE(daylightTimeZoneBias); + + // Client session ID: 0x00000000 (LE) + buf.writeIntLE(0); + + // Performance flags: 0x7 (LE) = PERF_DISABLE_WALLPAPER (0x1), PERF_DISABLE_FULLWINDOWDRAG (0x2), PERF_DISABLE_MENUANIMATIONS (0x4) + buf.writeIntLE(PERF_DISABLE_WALLPAPER | PERF_DISABLE_FULLWINDOWDRAG | PERF_DISABLE_MENUANIMATIONS); + + // cbAutoReconnectCookie: 0 bytes (LE) + buf.writeShortLE(0); + + // Trim buffer to actual length of data written + buf.length = buf.cursor; + + pushDataToOTOut(buf); + + switchOff(); + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + /* @formatter:off */ + byte[] packet = new byte[] { + + // TPKT + (byte) 0x03, (byte) 0x00, + + // TPKT length: 343 bytes + (byte) 0x01, (byte) 0x57, + + // X224 Data PDU + (byte) 0x02, (byte) 0xf0, (byte) 0x80, + + + // MCS Send Data Request PDU + (byte) 0x64, + + // Initiator: 0x03 + 1001 = 1004 + (byte) 0x00, (byte) 0x03, + + // Channel ID: 1003 (IO Channel) + (byte) 0x03, (byte) 0xeb, + + // Data priority: high, segmentation: begin | end (0x40 | 0x20 | 0x10 = 0x70) + (byte) 0x70, + + // User data length: 328 (0x148) bytes, variable length field + (byte) 0x81, (byte) 0x48, + + // Flags: SEC_INFO_PKT (0x4000) + (byte) 0x40, (byte) 0x00, + + // TS_SECURITY_HEADER::flagsHi - ignored + (byte) 0x00, (byte) 0x00, + + // Codepage: 0 (UNKNOWN, LE) (use 0x04090409 (1033,1033) for EN_US) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // Flags: 0xa0173 (LE), INFO_MOUSE (0x1), INFO_DISABLECTRLALTDEL (0x2), INFO_UNICODE (0x10), + // INFO_MAXIMIZESHELL (0x20), INFO_LOGONNOTIFY (0x40), INFO_ENABLEWINDOWSKEY (0x100), + // INFO_MOUSE_HAS_WHEEL (0x00020000), INFO_NOAUDIOPLAYBACK (0x00080000), + (byte) 0x73, (byte) 0x01, (byte) 0x0a, (byte) 0x00, + + // Lengths + + // cbDomain length: 0 bytes (LE) (NOT including size of mandatory NULL terminator) + (byte) 0x00, (byte) 0x00, + + // cbUserName length: 16 bytes (0x10, LE) (NOT including size of mandatory NULL terminator) + (byte) 0x10, (byte) 0x00, + + // cbPassword length: 0 bytes (LE) (NOT including size of mandatory NULL terminator) + (byte) 0x00, (byte) 0x00, + + // cbAlternateShell: 0 bytes (LE) (NOT including size of mandatory NULL terminator) + (byte) 0x00, (byte) 0x00, + + // cbWorkingDir: 0 bytes (LE) (NOT including size of mandatory NULL terminator) + (byte) 0x00, (byte) 0x00, + + // Values + + // Domain: "" (UCS2), see cbDomain + (byte) 0x00, (byte) 0x00, + + // User name: "vlisivka" (UCS2), see cbUserName + (byte) 0x76, (byte) 0x00, (byte) 0x6c, (byte) 0x00, (byte) 0x69, (byte) 0x00, (byte) 0x73, (byte) 0x00, + (byte) 0x69, (byte) 0x00, (byte) 0x76, (byte) 0x00, (byte) 0x6b, (byte) 0x00, (byte) 0x61, (byte) 0x00, + (byte) 0x00, (byte) 0x00, + + // Password: "" (UCS2), see cbPassword + (byte) 0x00, (byte) 0x00, + + // Alternate shell: "" (UCS2), see cbAlternateShell + (byte) 0x00, (byte) 0x00, + + // Working directory: "" (UCS2), see cbWorkingDir + (byte) 0x00, (byte) 0x00, + + // Client address family: 2 (AF_INET, LE) + (byte) 0x02, (byte) 0x00, + + // cbClientAddress = 28 bytes (0x1c, LE) (including the size of the mandatory NULL terminator) + (byte) 0x1c, (byte) 0x00, + + // Client address: "192.168.0.100" (UCS2) + (byte) 0x31, (byte) 0x00, (byte) 0x39, (byte) 0x00, (byte) 0x32, (byte) 0x00, (byte) 0x2e, (byte) 0x00, + (byte) 0x31, (byte) 0x00, (byte) 0x36, (byte) 0x00, (byte) 0x38, (byte) 0x00, (byte) 0x2e, (byte) 0x00, + (byte) 0x30, (byte) 0x00, (byte) 0x2e, (byte) 0x00, (byte) 0x31, (byte) 0x00, (byte) 0x30, (byte) 0x00, + (byte) 0x30, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // cbClientDir: 64 bytes (0x40, LE) (including the size of the mandatory NULL terminator) + (byte) 0x40, (byte) 0x00, + + // Client directory: "C:\Windows\System32\mstscax.dll" (UCS2) + (byte) 0x43, (byte) 0x00, (byte) 0x3a, (byte) 0x00, (byte) 0x5c, (byte) 0x00, (byte) 0x57, (byte) 0x00, + (byte) 0x69, (byte) 0x00, (byte) 0x6e, (byte) 0x00, (byte) 0x64, (byte) 0x00, (byte) 0x6f, (byte) 0x00, + (byte) 0x77, (byte) 0x00, (byte) 0x73, (byte) 0x00, (byte) 0x5c, (byte) 0x00, (byte) 0x53, (byte) 0x00, + (byte) 0x79, (byte) 0x00, (byte) 0x73, (byte) 0x00, (byte) 0x74, (byte) 0x00, (byte) 0x65, (byte) 0x00, + (byte) 0x6d, (byte) 0x00, (byte) 0x33, (byte) 0x00, (byte) 0x32, (byte) 0x00, (byte) 0x5c, (byte) 0x00, + (byte) 0x6d, (byte) 0x00, (byte) 0x73, (byte) 0x00, (byte) 0x74, (byte) 0x00, (byte) 0x73, (byte) 0x00, + (byte) 0x63, (byte) 0x00, (byte) 0x61, (byte) 0x00, (byte) 0x78, (byte) 0x00, (byte) 0x2e, (byte) 0x00, + (byte) 0x64, (byte) 0x00, (byte) 0x6c, (byte) 0x00, (byte) 0x6c, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // + // Client time zone: + + // Bias: 0 minutes (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // Standard name: "EET, Standard Time" (fixed string: 64 bytes, UCS2) + (byte) 0x45, (byte) 0x00, (byte) 0x45, (byte) 0x00, (byte) 0x54, (byte) 0x00, (byte) 0x2c, (byte) 0x00, + (byte) 0x20, (byte) 0x00, (byte) 0x53, (byte) 0x00, (byte) 0x74, (byte) 0x00, (byte) 0x61, (byte) 0x00, + (byte) 0x6e, (byte) 0x00, (byte) 0x64, (byte) 0x00, (byte) 0x61, (byte) 0x00, (byte) 0x72, (byte) 0x00, + (byte) 0x64, (byte) 0x00, (byte) 0x20, (byte) 0x00, (byte) 0x54, (byte) 0x00, (byte) 0x69, (byte) 0x00, + (byte) 0x6d, (byte) 0x00, (byte) 0x65, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // + // Standard date + // wYear: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMonth: unknown (LE) + (byte) 0x00, (byte) 0x00, + // wDayOfWeek: Sunday (LE) + (byte) 0x00, (byte) 0x00, + // wDay: unknown (LE) + (byte) 0x00, (byte) 0x00, + // wHour: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMinute: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wSecond: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMilliseconds: 0 + (byte) 0x00, (byte) 0x00, + + // StandardBias: 0 minutes (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // Daylight name: "EET, Summer Time" (fixed string: 64 bytes, UCS2) + (byte) 0x45, (byte) 0x00, (byte) 0x45, (byte) 0x00, (byte) 0x54, (byte) 0x00, (byte) 0x2c, (byte) 0x00, + (byte) 0x20, (byte) 0x00, (byte) 0x53, (byte) 0x00, (byte) 0x75, (byte) 0x00, (byte) 0x6d, (byte) 0x00, + (byte) 0x6d, (byte) 0x00, (byte) 0x65, (byte) 0x00, (byte) 0x72, (byte) 0x00, (byte) 0x20, (byte) 0x00, + (byte) 0x54, (byte) 0x00, (byte) 0x69, (byte) 0x00, (byte) 0x6d, (byte) 0x00, (byte) 0x65, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // Daylight date + // wYear: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMonth: unknown (LE) + (byte) 0x00, (byte) 0x00, + // wDayOfWeek: Sunday (LE) + (byte) 0x00, (byte) 0x00, + // wDay: unknown (LE) + (byte) 0x00, (byte) 0x00, + // wHour: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMinute: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wSecond: 0 (LE) + (byte) 0x00, (byte) 0x00, + // wMilliseconds: 0 + (byte) 0x00, (byte) 0x00, + + // Daylight bias: 60 minutes (LE) + (byte) 0x3c, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + + // Client session ID: 0x00000000 (LE) + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // Performance flags: 0x7 (LE) = PERF_DISABLE_WALLPAPER (0x1), PERF_DISABLE_FULLWINDOWDRAG (0x2), PERF_DISABLE_MENUANIMATIONS (0x4) + (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00, + + // cbAutoReconnectCookie: 0 bytes (LE) + (byte) 0x00, (byte) 0x00, + }; + /* @formatter:on */ + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + Element todo = new ClientInfoPDU("client_info", "vlisivka"); + Element x224 = new ClientX224DataPdu("x224"); + Element tpkt = new ClientTpkt("tpkt"); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet)); + Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, todo, x224, tpkt, sink, mainSink); + pipeline.link("source", "client_info", "mainSink"); + pipeline.link("client_info >" + OTOUT, "x224", "tpkt", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSAttachUserRequest.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSAttachUserRequest.java new file mode 100644 index 00000000000..10a7eff4bad --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSAttachUserRequest.java @@ -0,0 +1,102 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; +/** + * @see http://msdn.microsoft.com/en-us/library/cc240684.aspx + */ +public class ClientMCSAttachUserRequest extends OneTimeSwitch { + + public ClientMCSAttachUserRequest(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + throw new RuntimeException("Unexpected packet: " + buf + "."); + } + + @Override + protected void onStart() { + super.onStart(); + + int length = 1; + ByteBuffer buf = new ByteBuffer(length, true); + + buf.writeByte(0x28); // AttachUserRequest + + pushDataToOTOut(buf); + + switchOff(); + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + /* @formatter:off */ + byte[] packet = new byte[] { + + 0x03, 0x00, 0x00, 0x08, // TPKT Header (length = 8 bytes) + 0x02, (byte) 0xf0, (byte) 0x80, // X.224 Data TPDU + + // PER encoded (ALIGNED variant of BASIC-PER) PDU contents: + 0x28, + + // 0x28: + // 0 - --\ + // 0 - | + // 1 - | CHOICE: From DomainMCSPDU select attachUserRequest (10) + // 0 - | of type AttachUserRequest + // 1 - | + // 0 - --/ + // 0 - padding + // 0 - padding + + }; + /* @formatter:on */ + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + Element todo = new ClientMCSAttachUserRequest("TODO"); + Element x224 = new ClientX224DataPdu("x224"); + Element tpkt = new ClientTpkt("tpkt"); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet)); + Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, todo, x224, tpkt, sink, mainSink); + pipeline.link("source", "TODO", "mainSink"); + pipeline.link("TODO >" + OTOUT, "x224", "tpkt", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSChannelJoinRequest_ServerMCSChannelConfirmPDUs.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSChannelJoinRequest_ServerMCSChannelConfirmPDUs.java new file mode 100644 index 00000000000..f0825397680 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSChannelJoinRequest_ServerMCSChannelConfirmPDUs.java @@ -0,0 +1,222 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * The MCS Channel Join Request PDUs are sent sequentially. The first PDU is + * sent after receiving the MCS Attach User Confirm PDU and subsequent PDUs are + * sent after receiving the MCS Channel Join Confirm PDU for the previous + * request. Sending of the MCS Channel Join Request PDUs MUST continue until all + * channels have been successfully joined. + * + * @see http://msdn.microsoft.com/en-us/library/cc240686.aspx + */ +public class ClientMCSChannelJoinRequest_ServerMCSChannelConfirmPDUs extends OneTimeSwitch { + + private static final int MCS_CHANNEL_CONFIRM_PDU = 15; + + protected int[] channels; + protected int channelRequestsSent = 0; + + protected RdpState state; + + public ClientMCSChannelJoinRequest_ServerMCSChannelConfirmPDUs(String id, int[] channels, RdpState state) { + super(id); + this.channels = channels; + this.state=state; + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + // Parse channel confirm response + int typeAndFlags = buf.readUnsignedByte(); + int type = typeAndFlags >> 2; + // int flags = typeAndFlags & 0x3; + + if (type != MCS_CHANNEL_CONFIRM_PDU) + throw new RuntimeException("["+this+"] ERROR: Incorrect type of MCS AttachUserConfirm PDU. Expected value: 15, actual value: " + type + ", data: " + buf + "."); + + int rtSuccess = buf.readUnsignedByte() >> 4; + if (rtSuccess != 0) + throw new RuntimeException("["+this+"] ERROR: Cannot connect to channel: request failed. Error code: " + rtSuccess + ", channel ID: " + channels[channelRequestsSent - 1] + + ", data: " + buf + "."); + + // Initiator and requested fields MAY be ignored, however, the channelId + // field MUST be examined. If the value of the channelId field does not + // correspond with the value of the channelId field sent in the previous MCS + // Channel Join Request PDU the connection SHOULD be dropped. + + // Initiator: 1007 (6+1001) + // int initator=buf.readUnsignedShort(); + buf.skipBytes(2); + + // Requested channel + // int requestedChannel=buf.readUnsignedShort(); + buf.skipBytes(2); + + // Actual channel + int actualChannel = buf.readUnsignedShort(); + if (actualChannel != channels[channelRequestsSent - 1]) + throw new RuntimeException("Unexpeceted channeld ID returned. Expected channeld ID: " + channels[channelRequestsSent - 1] + ", actual channel ID: " + + actualChannel + ", data: " + buf + "."); + + state.channelJoined(actualChannel); + + buf.unref(); + + + if (channelRequestsSent < channels.length) + sendChannelRequest(channels[channelRequestsSent++]); + else + switchOff(); + } + + @Override + protected void onStart() { + super.onStart(); + + sendChannelRequest(channels[channelRequestsSent++]); + + // Switch off after receiving response(s) + } + + private void sendChannelRequest(int channel) { + ByteBuffer buf = new ByteBuffer(5, true); + + buf.writeByte(0x38); // Channel Join request + + buf.writeShort(0x03); // ChannelJoinRequest::initiator: 1004 + buf.writeShort(channel); + + pushDataToOTOut(buf); + } + + /** + * Example. + * + * @see http://msdn.microsoft.com/en-us/library/cc240834.aspx + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + /* @formatter:off */ + byte[] clientRequestPacket = new byte[] { + 0x03, 0x00, 0x00, 0x0c, // TPKT Header (length = 12 bytes) + 0x02, (byte) 0xf0, (byte) 0x80, // X.224 Data TPDU + + // PER encoded (ALIGNED variant of BASIC-PER) PDU contents: + 0x38, 0x00, 0x03, 0x03, (byte) 0xef, + + // 0x38: + // 0 - --\ + // 0 - | + // 1 - | CHOICE: From DomainMCSPDU select channelJoinRequest (14) + // 1 - | of type ChannelJoinRequest + // 1 - | + // 0 - --/ + // 0 - padding + // 0 - padding + + // 0x00: + // 0 - --\ + // 0 - | + // 0 - | + // 0 - | + // 0 - | + // 0 - | + // 0 - | + // 0 - | + // | ChannelJoinRequest::initiator = 0x03 + 1001 = 1004 + // 0x03: | + // 0 - | + // 0 - | + // 0 - | + // 0 - | + // 0 - | + // 1 - | + // 1 - | + // 0 - --/ + + // 0x03: + // 0 - --\ + // 0 - | + // 0 - | + // 0 - | + // 0 - | + // 0 - | + // 1 - | + // 1 - | + // | ChannelJoinRequest::channelId = 0x03ef = 1007 + // 0xef: | + // 1 - | + // 1 - | + // 1 - | + // 0 - | + // 1 - | + // 1 - | + // 1 - | + // 1 - --/ + }; + + byte[] serverResponsePacket = new byte[] { + // MCS Channel Confirm + (byte)0x3e, + + // result: rt-successful (0) + (byte)0x00, + + // Initiator: 1007 (6+1001) + (byte)0x00, (byte)0x06, + + // Requested channel + (byte)0x03, (byte)0xef, + + // Actual channel + (byte)0x03, (byte)0xef, + }; + /* @formatter:on */ + + RdpState rdpState = new RdpState(); + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(serverResponsePacket, new byte[] { 1, 2, 3 })); + Element todo = new ClientMCSChannelJoinRequest_ServerMCSChannelConfirmPDUs("channels", new int[] { 1007 }, rdpState); + Element x224 = new ClientX224DataPdu("x224"); + Element tpkt = new ClientTpkt("tpkt"); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(clientRequestPacket)); + Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, todo, x224, tpkt, sink, mainSink); + pipeline.link("source", "channels", "mainSink"); + pipeline.link("channels >" + OTOUT, "x224", "tpkt", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSConnectInitial.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSConnectInitial.java new file mode 100644 index 00000000000..01899877299 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSConnectInitial.java @@ -0,0 +1,669 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +public class ClientMCSConnectInitial extends OneTimeSwitch { + + public ClientMCSConnectInitial(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + throw new RuntimeException("Unexpected packet: " + buf + "."); + } + + @Override + protected void onStart() { + super.onStart(); + + int length = 1024; // Large enough + ByteBuffer buf = new ByteBuffer(length, true); + + /* @formatter:off */ + buf.writeBytes(new byte[] { +// - T125: MCSConnect Initial +// - MCSConnectInitial: Identifier=Generic Conference Control (0.0.20.124.0.1), ConnectPDULength=254 +// - ConnectInitialHeader: + (byte)0x7F, (byte)0x65, +// - AsnId: Application Constructed Tag (101) +// - HighTag: +// Class: (01......) Application (1) +// Type: (..1.....) Constructed +// TagNumber: (...11111) +// TagValueEnd: 101 (0x65) + (byte)0x82, (byte)0x01, (byte)0x6C, +// - AsnLen: Length = 364, LengthOfLength = 2 +// LengthType: LengthOfLength = 2 +// Length: 364 bytes + (byte)0x04, (byte)0x01, (byte)0x01, +// - CallingDomainSelector: 0x1 +// - AsnOctetStringHeader: +// - AsnId: OctetString type (Universal 4) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00100) 4 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// OctetStream: 0x1 + (byte)0x04, (byte)0x01, (byte)0x01, +// - CalledDomainSelector: 0x1 +// - AsnOctetStringHeader: +// - AsnId: OctetString type (Universal 4) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00100) 4 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// OctetStream: 0x1 + (byte)0x01, (byte)0x01, (byte)0xFF, +// - UpwardFlag: True +// - AsnBooleanHeader: +// - AsnId: Boolean type (Universal 1) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00001) 1 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// Tf: 255 (0xFF) + +// +// - TargetParameters: Length = 26, LengthOfLength = 0 + (byte)0x30, (byte)0x1A, +// - DomainParametersHeader: 0x1 +// - AsnId: Sequence and SequenceOf types (Universal 16) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..1.....) Constructed +// TagValue: (...10000) 16 +// - AsnLen: Length = 26, LengthOfLength = 0 +// Length: 26 bytes, LengthOfLength = 0 + (byte)0x02, (byte)0x01, (byte)0x22, +// - ChannelIds: 34 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 34 (0x22) + (byte)0x02, (byte)0x01, (byte)0x02, +// - UserIDs: 2 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 2 (0x2) + (byte)0x02, (byte)0x01, (byte)0x00, +// - TokenIds: 0 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 0 (0x0) + (byte)0x02, (byte)0x01, (byte)0x01, +// - NumPriorities: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x01, (byte)0x00, +// - MinThroughput: 0 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 0 (0x0) + (byte)0x02, (byte)0x01, (byte)0x01, +// - Height: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x03, (byte)0x00, (byte)0xFF, (byte)0xFF, +// - MCSPDUsize: 65535 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 3, LengthOfLength = 0 +// Length: 3 bytes, LengthOfLength = 0 +// AsnInt: 65535 (0xFFFF) + (byte)0x02, (byte)0x01, (byte)0x02, +// - protocolVersion: 2 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 2 (0x2) + +// +// - MinimumParameters: Length = 25, LengthOfLength = 0 + (byte)0x30, (byte)0x19, +// - DomainParametersHeader: 0x1 +// - AsnId: Sequence and SequenceOf types (Universal 16) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..1.....) Constructed +// TagValue: (...10000) 16 +// - AsnLen: Length = 25, LengthOfLength = 0 +// Length: 25 bytes, LengthOfLength = 0 + (byte)0x02, (byte)0x01, (byte)0x01, +// - ChannelIds: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x01, (byte)0x01, +// - UserIDs: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x01, (byte)0x01, +// - TokenIds: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x01, (byte)0x01, +// - NumPriorities: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x01, (byte)0x00, +// - MinThroughput: 0 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 0 (0x0) + (byte)0x02, (byte)0x01, (byte)0x01, +// - Height: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x02, (byte)0x04, (byte)0x20, +// - MCSPDUsize: 1056 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 2, LengthOfLength = 0 +// Length: 2 bytes, LengthOfLength = 0 +// AsnInt: 1056 (0x420) + (byte)0x02, (byte)0x01, (byte)0x02, +// - protocolVersion: 2 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 2 (0x2) +// - MaximumParameters: Length = 31, LengthOfLength = 0 +// - DomainParametersHeader: 0x1 + (byte)0x30, (byte)0x1F, +// - AsnId: Sequence and SequenceOf types (Universal 16) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..1.....) Constructed +// TagValue: (...10000) 16 +// - AsnLen: Length = 31, LengthOfLength = 0 +// Length: 31 bytes, LengthOfLength = 0 + (byte)0x02, (byte)0x03, (byte)0x00, (byte)0xFF, (byte)0xFF, +// - ChannelIds: 65535 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 3, LengthOfLength = 0 +// Length: 3 bytes, LengthOfLength = 0 +// AsnInt: 65535 (0xFFFF) + (byte)0x02, (byte)0x02, (byte)0xFC, (byte)0x17, +// - UserIDs: 64535 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 2, LengthOfLength = 0 +// Length: 2 bytes, LengthOfLength = 0 +// AsnInt: 64535 (0xFC17) + (byte)0x02, (byte)0x03, (byte)0x00, (byte)0xFF, (byte)0xFF, +// - TokenIds: 65535 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 3, LengthOfLength = 0 +// Length: 3 bytes, LengthOfLength = 0 +// AsnInt: 65535 (0xFFFF) + (byte)0x02, (byte)0x01, (byte)0x01, +// - NumPriorities: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x01, (byte)0x00, +// - MinThroughput: 0 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 0 (0x0) + (byte)0x02, (byte)0x01, (byte)0x01, +// - Height: 1 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 1 (0x1) + (byte)0x02, (byte)0x03, (byte)0x00, (byte)0xFF, (byte)0xFF, +// - MCSPDUsize: 65535 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 3, LengthOfLength = 0 +// Length: 3 bytes, LengthOfLength = 0 +// AsnInt: 65535 (0xFFFF) + (byte)0x02, (byte)0x01, (byte)0x02, +// - protocolVersion: 2 +// - AsnIntegerHeader: +// - AsnId: Integer type (Universal 2) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00010) 2 +// - AsnLen: Length = 1, LengthOfLength = 0 +// Length: 1 bytes, LengthOfLength = 0 +// AsnInt: 2 (0x2) +// - UserData: Identifier=Generic Conference Contro (0.0.20.124.0.1), ConnectPDULength=254 +// - UserDataHeader: + (byte)0x04, (byte)0x82, (byte)0x01, (byte)0x07, +// - AsnId: OctetString type (Universal 4) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00100) 4 +// - AsnLen: Length = 263, LengthOfLength = 2 +// LengthType: LengthOfLength = 2 +// Length: 263 bytes + (byte)0x00, (byte)0x05, (byte)0x00, (byte)0x14, (byte)0x7C, (byte)0x00, (byte)0x01, +// - AsnBerObjectIdentifier: Generic Conference Contro (0.0.20.124.0.1) +// - AsnObjectIdentifierHeader: +// - AsnId: Reserved for use by the encoding rules (Universal 0) +// - LowTag: +// Class: (00......) Universal (0) +// Type: (..0.....) Primitive +// TagValue: (...00000) 0 +// - AsnLen: Length = 5, LengthOfLength = 0 +// Length: 5 bytes, LengthOfLength = 0 +// First: 0 (0x0) +// Final: 20 (0x14) +// Final: 124 (0x7C) +// Final: 0 (0x0) +// Final: 1 (0x1) + (byte)0x80, (byte)0xFE, +// - ConnectPDULength: 254 +// Align: No Padding +// Length: 254 + (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x10, +// - ConnectGCCPDU: conferenceCreateRequest +// ExtensionBit: 0 (0x0) +// - ChoiceValue: conferenceCreateRequest +// Value: (000.....) 0x0 +// - conferenceCreateRequest: +// ExtensionBit: 0 (0x0) +// convenerPasswordPresent: 0 (0x0) +// passwordPresent: 0 (0x0) +// conductorPrivilegesPresent: 0 (0x0) +// conductedPrivilegesPresent: 0 (0x0) +// nonConductedPrivilegesPresent: 0 (0x0) +// conferenceDescriptionPresent: 0 (0x0) +// callerIdentifierPresent: 0 (0x0) +// userDataPresent: 1 (0x1) +// - conferenceName: +// ExtensionBit: 0 (0x0) +// textPresent: 0 (0x0) +// - numeric: 1 +// - SimpleNumericString: 1 +// - NumericString: 1 +// - Align: No Padding +// Padding1: (0.......) 0x0 +// - Length: 1 +// Value: (00000000) 0x0 +// - Restrictedstr: 1 +// FourBits: (0001....) 0x1 +// - lockedConference: False +// Value: False 0....... +// - listedConference: False +// Value: False 0....... +// - conductibleConference: False +// Value: False 0....... +// - TerminationMethod: automatic +// ExtensionBit: 0 (0x0) +// - RootIndex: 0 +// Value: (0.......) 0x0 +// - userData: + (byte)0x00, (byte)0x01, +// - Size: 1 +// - Align: No Padding +// Padding7: (0000000.) 0x0 +// Length: 1 +// - UserData: 0x44756361 + (byte)0xC0, (byte)0x00, (byte)0x44, (byte)0x75, (byte)0x63, (byte)0x61, +// valuePresent: 1 (0x1) +// - key: h221NonStandard "Duca" +// - ChoiceValue: h221NonStandard +// Value: (1.......) 0x1 +// - h221NonStandard: +// - H221NonStandardIdentifier: length: 4 +// - ConstrainedLength: 4 +// Value: (00000000) 0x0 +// - Align: No Padding +// Padding6: (000000..) 0x0 +// Value: Binary Large Object (4 Bytes) "Duca" +// - ClientMcsConnectInitialPdu: + (byte)0x80, (byte)0xF0, +// - RDPGCCUserDataRequestLength: 240 +// Align: No Padding +// Length: 240 +// - TsUd: CS_CORE + (byte)0x01, (byte)0xC0, (byte)0xD8, (byte)0x00, +// - TsUdHeader: Type = CS_CORE, Length = 216 +// Type: CS_CORE +// Length: 216 (0xD8) +// - TsUdCsCore: + (byte)0x04, (byte)0x00, (byte)0x08, (byte)0x00, +// Version: RDP 5.0, 5.1, 5.2, 6.0, 6.1, and 7.0 + (byte)0x00, (byte)0x04, +// DesktopWidth: 1024 (0x400) + (byte)0x00, (byte)0x03, +// DesktopHeight: 768 (0x300) + (byte)0x01, (byte)0xCA, +// ColorDepth: 8 bpp + (byte)0x03, (byte)0xAA, +// SASSequence: 0xaa03, SHOULD be set to RNS_UD_SAS_DEL(0xAA03) + (byte)0x09, (byte)0x04, (byte)0x00, (byte)0x00, +// KeyboardLayout: Language: English, Location: United States + (byte)0x28, (byte)0x0A, (byte)0x00, (byte)0x00, +// ClientBuild: 2600 (0xA28) + (byte)0x61, (byte)0x00, (byte)0x70, (byte)0x00, (byte)0x6F, (byte)0x00, (byte)0x6C, (byte)0x00, (byte)0x6C, (byte)0x00, (byte)0x6F, (byte)0x00, (byte)0x33, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// ClientName: apollo3 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// KeyboardType: Undefined value: 0 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// KeyboardSubType: 0 (0x0) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// KeyboardFunctionKey: 0 (0x0) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// ImeFileName: + (byte)0x01, (byte)0xCA, +// PostBeta2ColorDepth: 8 bpp + (byte)0x01, (byte)0x00, +// ClientProductId: 0x1, SHOULD be set to initialized to 1 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// SerialNumber: 0x0, SHOULD be set to 0 + (byte)0x10, (byte)0x00, +// HighColorDepth: 16-bit 565 RGB + (byte)0x07, (byte)0x00, +// - SupportedColorDepth: 7 (0x7) +// Support24BPP: (...............1) Support 24BPP +// Support16BPP: (..............1.) Support 16BPP +// Support15BPP: (.............1..) Support 15BPP +// Support32BPP: (............0...) Not Support 32BPP +// Reserved: (000000000000....) + (byte)0x01, (byte)0x00, +// - EarlyCapabilityFlags: 1 (0x1) +// SupportSetErrorPdu: (...............1) Indicates that the client supports the Set Error Info PDU +// Want32BppSession: (..............0.) Client is not requesting 32BPP session +// SupportStatusInfoPdu: (.............0..) Client not supports the Server Status Info PDU +// StrongAsymmetricKeys: (............0...) Not support asymmetric keys larger than 512-bits +// Unused: (...........0....) +// ValidConnection: (..........0.....) Not Indicates ConnectionType field contains valid data +// SupportMonitorLayoutPdu: (.........0......) Not Indicates that the client supports the Monitor Layout PDU +// Unused2: (000000000.......) + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// ClientDigProductId: +(byte)0x00, +// connectionType: invalid connection type +(byte)0x00, +// pad1octet: 0 (0x0) +(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, +// ServerSelectedProtocols: TLS 1.0 +// +// - TsUd: CS_CLUSTER +// - TsUdHeader: Type = CS_CLUSTER, Length = 12 +(byte)0x04, (byte)0xC0, +// Type: CS_CLUSTER +(byte)0x0C, (byte)0x00, +// Length: 12 (0xC) +(byte)0x0D, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// - TsUdCsCluster: +// - Flags: 13 (0xD) +// RedirectedSupported: (...............................1) Support Redirected +// SessionIDFieldValid: (..............................0.) SessionID Field not Valid +// SupportedVersion: (..........................0011..) REDIRECTION_VERSION4 +// RedirectedSmartcard: (.........................0......) Not Logon with Smartcard +// Unused: (0000000000000000000000000.......) +// RedirectedSessionID: 0 (0x0) +// +// - TsUd: CS_SECURITY +// - TsUdHeader: Type = CS_SECURITY, Length = 12 +(byte)0x02, (byte)0xC0, +// Type: CS_SECURITY +(byte)0x0C, (byte)0x00, +// Length: 12 (0xC) +// +// - TsUdCsSec: +(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// - EncryptionMethod: +// Support40Bit: (...............................0) Not Support +// Support128Bit: (..............................0.) Not Support 128-bit +// Reserved1: (.............................0..) +// Support56Bit: (............................0...) Not Support 56-bit +// SupportFIPS: (...........................0....) Not Support FIPS Compliant +// Reserved2: (000000000000000000000000000.....) +(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, +// - ExtEncryptionMethod: +// Support40Bit: (...............................0) Not Support +// Support128Bit: (..............................0.) Not Support 128-bit +// Reserved1: (.............................0..) +// Support56Bit: (............................0...) Not Support 56-bit +// SupportFIPS: (...........................0....) Not Support FIPS Compliant +// Reserved2: (000000000000000000000000000.....) + }); + /* @formatter:on */ + + buf.length = buf.cursor; + + pushDataToOTOut(buf); + + switchOff(); + } + + /** + * Example. + * + * @see http://msdn.microsoft.com/en-us/library/cc240836.aspx + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + /* @formatter:off */ + byte[] packet = new byte[] { + // TPKT: TPKT version = 3 + (byte) 0x03, (byte) 0x00, + // TPKT: Packet length: 378 bytes + (byte) 0x01, (byte) 0x78, + + // X.224: Length indicator = 2 + (byte) 0x02, + // X.224: Type: Data TPDU + (byte) 0xf0, + // X.224: EOT + (byte) 0x80, + + // Captured packet + (byte)0x7f, (byte)0x65, (byte)0x82, (byte)0x01, (byte)0x6c, (byte)0x04, (byte)0x01, (byte)0x01, (byte)0x04, + (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01, (byte)0xff, (byte)0x30, (byte)0x1a, (byte)0x02, (byte)0x01, (byte)0x22, (byte)0x02, (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x01, (byte)0x00, + (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x01, (byte)0x00, (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0x02, (byte)0x01, + (byte)0x02, (byte)0x30, (byte)0x19, (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, + (byte)0x01, (byte)0x00, (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x02, (byte)0x04, (byte)0x20, (byte)0x02, (byte)0x01, (byte)0x02, (byte)0x30, (byte)0x1f, (byte)0x02, (byte)0x03, + (byte)0x00, (byte)0xff, (byte)0xff, (byte)0x02, (byte)0x02, (byte)0xfc, (byte)0x17, (byte)0x02, (byte)0x03, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, + (byte)0x01, (byte)0x00, (byte)0x02, (byte)0x01, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x00, (byte)0xff, (byte)0xff, (byte)0x02, (byte)0x01, (byte)0x02, (byte)0x04, (byte)0x82, (byte)0x01, + (byte)0x07, (byte)0x00, (byte)0x05, (byte)0x00, (byte)0x14, (byte)0x7c, (byte)0x00, (byte)0x01, (byte)0x80, (byte)0xfe, (byte)0x00, (byte)0x08, (byte)0x00, (byte)0x10, (byte)0x00, (byte)0x01, + (byte)0xc0, (byte)0x00, (byte)0x44, (byte)0x75, (byte)0x63, (byte)0x61, (byte)0x80, (byte)0xf0, (byte)0x01, (byte)0xc0, (byte)0xd8, (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x08, (byte)0x00, + (byte)0x00, (byte)0x04, (byte)0x00, (byte)0x03, (byte)0x01, (byte)0xca, (byte)0x03, (byte)0xaa, (byte)0x09, (byte)0x04, (byte)0x00, (byte)0x00, (byte)0x28, (byte)0x0a, (byte)0x00, (byte)0x00, + (byte)0x61, (byte)0x00, (byte)0x70, (byte)0x00, (byte)0x6f, (byte)0x00, (byte)0x6c, (byte)0x00, (byte)0x6c, (byte)0x00, (byte)0x6f, (byte)0x00, (byte)0x33, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0xca, (byte)0x01, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x10, (byte)0x00, (byte)0x07, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x04, (byte)0xc0, (byte)0x0c, (byte)0x00, (byte)0x0d, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x02, (byte)0xc0, (byte)0x0c, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + }; + /* @formatter:on */ + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + Element todo = new ClientMCSConnectInitial("ClientMCSConnectInitial"); + Element x224 = new ClientX224DataPdu("x224"); + Element tpkt = new ClientTpkt("tpkt"); + + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet)); + + Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, todo, x224, tpkt, sink, mainSink); + pipeline.link("source", "ClientMCSConnectInitial", "mainSink"); + pipeline.link("ClientMCSConnectInitial >" + OTOUT, "x224", "tpkt", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSErectDomainRequest.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSErectDomainRequest.java new file mode 100644 index 00000000000..4a0fd0413a9 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientMCSErectDomainRequest.java @@ -0,0 +1,190 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240683.aspx + */ +public class ClientMCSErectDomainRequest extends OneTimeSwitch { + + public ClientMCSErectDomainRequest(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + throw new RuntimeException("Unexpected packet: " + buf + "."); + } + + @Override + protected void onStart() { + super.onStart(); + + int length = 5; + ByteBuffer buf = new ByteBuffer(length, true); + + buf.writeByte(0x04); // Erect Domain Request + + // Client SHOULD initialize both the subHeight and subinterval fields of the MCS Erect Domain Request PDU to zero. + + buf.writeByte(1); // ErectDomainRequest::subHeight length = 1 byte + buf.writeByte(0); // ErectDomainRequest::subHeight + + buf.writeByte(1); // ErectDomainRequest::subInterval length = 1 byte + buf.writeByte(0); // ErectDomainRequest::subInterval + + + pushDataToOTOut(buf); + + switchOff(); + } + + /** + * Example. + * @see http://msdn.microsoft.com/en-us/library/cc240837.aspx + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + /* @formatter:off */ + byte[] packet = new byte[] { + + 0x03, 0x00, 0x00, 0x0c, // TPKT Header (length = 12 bytes) + 0x02, (byte) 0xf0, (byte) 0x80, // X.224 Data TPDU + + // PER encoded (ALIGNED variant of BASIC-PER) PDU contents: + 0x04, 0x01, 0x00, 0x01, 0x00, + + // 0x04: + // 0 - --\ + // 0 - | + // 0 - | CHOICE: From DomainMCSPDU select erectDomainRequest (1) + // 0 - | of type ErectDomainRequest + // 0 - | + // 1 - --/ + // 0 - padding + // 0 - padding + + // 0x01: + // 0 - --\ + // 0 - | + // 0 - | + // 0 - | ErectDomainRequest::subHeight length = 1 byte + // 0 - | + // 0 - | + // 0 - | + // 1 - --/ + + // 0x00: + // 0 - --\ + // 0 - | + // 0 - | + // 0 - | ErectDomainRequest::subHeight = 0 + // 0 - | + // 0 - | + // 0 - | + // 0 - --/ + + // 0x01: + // 0 - --\ + // 0 - | + // 0 - | + // 0 - | ErectDomainRequest::subInterval length = 1 byte + // 0 - | + // 0 - | + // 0 - | + // 1 - --/ + + // 0x00: + // 0 - --\ + // 0 - | + // 0 - | + // 0 - | ErectDomainRequest::subInterval = 0 + // 0 - | + // 0 - | + // 0 - | + // 0 - --/ + + + }; + /* @formatter:on */ + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + Element todo = new ClientMCSErectDomainRequest("TODO"); + Element x224 = new ClientX224DataPdu("x224"); + Element tpkt = new ClientTpkt("tpkt"); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet)); + Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, todo, x224, tpkt, sink, mainSink); + pipeline.link("source", "TODO", "mainSink"); + pipeline.link("TODO >" + OTOUT, "x224", "tpkt", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} + +/* + * 03 00 00 0C 02 F0 80 04 01 00 01 00 + + Frame: Number = 14, Captured Frame Length = 69, MediaType = DecryptedPayloadHeader ++ DecryptedPayloadHeader: FrameCount = 1, ErrorStatus = SUCCESS + TLSSSLData: Transport Layer Security (TLS) Payload Data ++ TLS: TLS Rec Layer-1 SSL Application Data + ISOTS: TPKTCount = 1 +- TPKT: version: 3, Length: 12 + version: 3 (0x3) + Reserved: 0 (0x0) + PacketLength: 12 (0xC) +- X224: Data + Length: 2 (0x2) + Type: Data + EOT: 128 (0x80) +- T125: Erect Domain Request, SubHeight = 0, SubInterval = 0 + - MCSHeader: Type=Erect Domain Request + - Type: Erect Domain Request + - RootIndex: 1 + Value: (000001..) 0x1 + - MCSErectDomainRequest: SubHeight = 0, SubInterval = 0 + - SubHeight: 0x0 + - Length: 1 + - Align: No Padding + Padding2: (00......) 0x0 + Length: 1 + Value: 0 (0x0) + - SubInterval: 0x0 + - Length: 1 + Align: No Padding + Length: 1 + Value: 0 (0x0) + + */ diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientPacketSniffer.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientPacketSniffer.java new file mode 100644 index 00000000000..651d002af7e --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientPacketSniffer.java @@ -0,0 +1,50 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + + +/** + * Try to determine packet content by it header fingerprint. + */ +public class ClientPacketSniffer extends PacketSniffer { + + private static final Pair[] clientRegexps = new Pair[] { +// @formatter:off + new Pair("Client FastPath input", "04"), + new Pair("Client X224ConnectionRequest", "03 00 XX XX 27 E0"), + new Pair("Client ConnectionRequest", "03 00 XX XX XX E0"), + new Pair("Client MCConnectInitial", "03 00 XX XX 02 F0 80 7F 65"), + new Pair("Client ErectDomainRequest", "03 00 XX XX 02 F0 80 04"), + new Pair("Client AttachUserRequest", "03 00 XX XX 02 F0 80 28"), + new Pair("Client ChannelJoinRequest", "03 00 XX XX 02 F0 80 38"), + new Pair("Client Info", "03 00 XX XX 02 F0 80 64 00 03 03 EB 70 XX XX XX XX 00 00"), + new Pair("Client ConfirmActivePDU", "03 00 XX XX 02 F0 80 64 00 03 03 EB 70 XX XX XX XX 13 00"), + new Pair("Client SynchronizePDU", "03 00 XX XX 02 F0 80 64 00 03 03 EB 70 XX XX XX XX 17 00 EC 03 EA 03 XX 00 XX XX XX XX 1F"), + new Pair("Client ControlPDU", "03 00 XX XX 02 F0 80 64 00 03 03 EB 70 XX XX XX XX 17 00 EC 03 EA 03 XX 00 XX XX XX XX 14"), + new Pair("Client FontListPDU", "03 00 XX XX 02 F0 80 64 00 03 03 EB 70 XX XX XX XX 17 00 EC 03 EA 03 XX 00 XX XX XX XX 27"), + new Pair("Client BitmapCachePersistentList","03 00 XX XX 02 F0 80 64 00 03 03 EB 70 XX XX XX XX 17 00 EC 03 EA 03 XX XX XX XX XX XX 2b"), +// new Pair("Client TPKT Unknown packet", "03"), +// new Pair("Client UNKNOWN PACKET (ERROR)", ".*"), + // @formatter:on + + }; + + public ClientPacketSniffer(String id) { + super(id, clientRegexps); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientSynchronizePDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientSynchronizePDU.java new file mode 100644 index 00000000000..9631976c848 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientSynchronizePDU.java @@ -0,0 +1,248 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240489.aspx + */ +public class ClientSynchronizePDU extends OneTimeSwitch { + + public ClientSynchronizePDU(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + throw new RuntimeException("Unexpected packet: " + buf + "."); + } + + @Override + protected void onStart() { + super.onStart(); + + int length = 1024; // Large enough + ByteBuffer buf = new ByteBuffer(length, true); + + /* @formatter:off */ + buf.writeBytes(new byte[] { + // MCS send data request + (byte)0x64, + // Initiator: 1004 (1001+3) + (byte)0x00, (byte)0x03, + // Channel ID: 1003 (I/O Channel) + (byte)0x03, (byte)0xeb, + // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10) + (byte)0x70, + // Data length: 22 bytes (0x16, variable length field) + (byte)0x80, (byte)0x16, + + // RDP: total length: 22 bytes (LE) + (byte)0x16, (byte)0x00, + + // PDU type: PDUTYPE_DATAPDU (0x7), TS_PROTOCOL_VERSION (0x10) (LE) + (byte)0x17, (byte)0x00, + + // PDU source: 1007 (LE) + (byte)0xec, (byte)0x03, + // Share ID: 0x000103ea (LE) + (byte)0xea, (byte)0x03, (byte)0x01, (byte)0x00, + // Padding: 1 byte + (byte)0x00, + // Stream ID: STREAM_LOW (1) + (byte)0x01, + // uncompressedLength : 8 bytes (LE) + (byte)0x08, (byte)0x00, + // pduType2 = PDUTYPE2_SYNCHRONIZE (31) + (byte)0x1f, + // generalCompressedType: 0 + (byte)0x00, + // generalCompressedLength: 0 (LE?) + (byte)0x00, (byte)0x00, + // messageType: SYNCMSGTYPE_SYNC (1) (LE) + (byte)0x01, (byte)0x00, + // targetUser: 0x03ea + (byte)0xea, (byte)0x03, + }); + /* @formatter:on */ + + // Trim buffer to actual length of data written + buf.trimAtCursor(); + + pushDataToOTOut(buf); + + switchOff(); + } + + /** + * Example. + * + * @see http://msdn.microsoft.com/en-us/library/cc240841.aspx + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + /* @formatter:off */ + byte[] packet = new byte[] { + // TPKT + (byte)0x03, (byte)0x00, + // TPKT length: 37 bytes + (byte)0x00, (byte)0x25, + // X224 Data PDU + (byte)0x02, (byte)0xf0, (byte)0x80, + + // MCS send data request + (byte)0x64, + // Initiator: 1004 (1001+3) + (byte)0x00, (byte)0x03, + // Channel ID: 1003 (I/O Channel) + (byte)0x03, (byte)0xeb, + // Data priority: high (0x40), segmentation: begin (0x20) | end (0x10) + (byte)0x70, + // Data length: 22 bytes (0x16, variable length field) + (byte)0x80, (byte)0x16, + + // RDP: total length: 22 bytes (LE) + (byte)0x16, (byte)0x00, + // PDU type: PDUTYPE_DATAPDU (0x7), TS_PROTOCOL_VERSION (0x10) (LE) + (byte)0x17, (byte)0x00, + // PDU source: 1007 (LE) + (byte)0xec, (byte)0x03, + // Share ID: 0x000103ea (LE) + (byte)0xea, (byte)0x03, (byte)0x01, (byte)0x00, + // Padding: 1 byte + (byte)0x00, + // Stream ID: STREAM_LOW (1) + (byte)0x01, + // uncompressedLength : 8 bytes (LE) + (byte)0x08, (byte)0x00, + // pduType2 = PDUTYPE2_SYNCHRONIZE (31) + (byte)0x1f, + // generalCompressedType: 0 + (byte)0x00, + // generalCompressedLength: 0 (LE?) + (byte)0x00, (byte)0x00, + // messageType: SYNCMSGTYPE_SYNC (1) (LE) + (byte)0x01, (byte)0x00, + // targetUser: 0x03ea + (byte)0xea, (byte)0x03, + + }; + /* @formatter:on */ + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + Element todo = new ClientSynchronizePDU("TODO"); + Element x224 = new ClientX224DataPdu("x224"); + Element tpkt = new ClientTpkt("tpkt"); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet)); + Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, todo, x224, tpkt, sink, mainSink); + pipeline.link("source", "TODO", "mainSink"); + pipeline.link("TODO >" + OTOUT, "x224", "tpkt", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} + +/* + * @formatting:off + + * 03 00 00 25 02 F0 80 64 00 03 03 EB 70 80 16 16 00 17 00 EC 03 EA 03 01 00 00 01 08 00 1F 00 00 00 01 00 EA 03 + + Frame: Number = 40, Captured Frame Length = 94, MediaType = DecryptedPayloadHeader ++ DecryptedPayloadHeader: FrameCount = 1, ErrorStatus = SUCCESS + TLSSSLData: Transport Layer Security (TLS) Payload Data ++ TLS: TLS Rec Layer-1 SSL Application Data + ISOTS: TPKTCount = 1 +- TPKT: version: 3, Length: 37 + version: 3 (0x3) + Reserved: 0 (0x0) + PacketLength: 37 (0x25) +- X224: Data + Length: 2 (0x2) + Type: Data + EOT: 128 (0x80) +- T125: Data Packet + - MCSHeader: Type=Send Data Request, UserID=1004, ChannelID=1003 + - Type: Send Data Request + - RootIndex: 25 + Value: (011001..) 0x19 + - UserID: 0x3ec + - UserID: 0x3ec + - ChannelId: 1004 + - Align: No Padding + Padding2: (00......) 0x0 + Value: 3 (0x3) + - Channel: 0x3eb + - ChannelId: 1003 + Align: No Padding + Value: 1003 (0x3EB) + - DataPriority: high + - DataPriority: high + - RootIndex: 1 + Value: (01......) 0x1 + - Segmentation: Begin End + Begin: (1.......) Begin + End: (.1......) End + - Length: 22 + - Align: No Padding + Padding4: (0000....) 0x0 + Length: 22 + RDP: RDPBCGR +- RDPBCGR: SynchronizePDU + - SlowPathPacket: SynchronizePDU + - SlowPath: Type = TS_PDUTYPE_DATAPDU + - TsShareControlHeader: Type = TS_PDUTYPE_DATAPDU + TotalLength: 22 (0x16) + - PDUType: 23 (0x17) + Type: (............0111) TS_PDUTYPE_DATAPDU + ProtocolVersion: (000000000001....) 1 + PDUSource: 1004 (0x3EC) + - SlowPathIoPacket: 0x0 + - ShareDataHeader: TS_PDUTYPE2_SYNCHRONIZE + ShareID: 66538 (0x103EA) + Pad1: 0 (0x0) + StreamID: TS_STREAM_LOW + UncompressedLength: 8 (0x8) + PDUType2: TS_PDUTYPE2_SYNCHRONIZE + - CompressedType: Not Compressed + MPPC: (....0000) MPPC 8K + Reserved: (...0....) + Compressed: (..0.....) Not Compressed + Front: (.0......) Not At Front + Flush: (0.......) Not Flushed + CompressedLength: 0 (0x0) + - TsSynchronizePDU: 0x1 + MessageType: 0x1, MUST be set to SYNCMSGTYPE_SYNC (1) + TargetUser: 1002 (0x3EA) + */ + diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientTpkt.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientTpkt.java new file mode 100644 index 00000000000..c92d8321a8f --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientTpkt.java @@ -0,0 +1,54 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +public class ClientTpkt extends BaseElement { + + public ClientTpkt(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + if (buf.length + 4 > 65535) + throw new RuntimeException("Packet is too long for TPKT (max length 65535-4): " + buf + "."); + + ByteBuffer data = new ByteBuffer(4); + // TPKT version + data.writeByte(3); + // Reserved + data.writeByte(0); + // Packet length, including length of the header + data.writeShort(buf.length + 4); + + buf.prepend(data); + data.unref(); + + pushDataToPad(STDOUT, buf); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientX224ConnectionRequestPDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientX224ConnectionRequestPDU.java new file mode 100644 index 00000000000..48ac08933e6 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientX224ConnectionRequestPDU.java @@ -0,0 +1,156 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240470.aspx + * @see http://msdn.microsoft.com/en-us/library/cc240663.aspx + */ +public class ClientX224ConnectionRequestPDU extends OneTimeSwitch { + + public static final int X224_TPDU_CONNECTION_REQUEST = 0xe0; + public static final int X224_TPDU_CONNECTION_CONFIRM = 0xd0; + public static final int X224_TPDU_DISCONNECTION_REQUEST = 0x80; + public static final int X224_TPDU_DISCONNECTION_CONFIRM = 0xc0; + public static final int X224_TPDU_EXPEDITED_DATA = 0x10; + public static final int X224_TPDU_DATA_ACKNOWLEDGE = 0x61; + public static final int X224_TPDU_EXPEDITET_ACKNOWLEDGE = 0x40; + public static final int X224_TPDU_REJECT = 0x51; + public static final int X224_TPDU_ERROR = 0x70; + public static final int X224_TPDU_PROTOCOL_IDENTIFIER = 0x01; + + /** + * Reconnection cookie. + */ + protected String userName; + + public ClientX224ConnectionRequestPDU(String id, String userName) { + super(id); + this.userName = userName; + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + throw new RuntimeException("Unexpected packet: " + buf + "."); + } + + @Override + protected void onStart() { + super.onStart(); + + // Length of packet without length field + int length = 33 + userName.length(); + ByteBuffer buf = new ByteBuffer(length, true); + + // Type (high nibble) = 0xe = CR TPDU; credit (low nibble) = 0 + buf.writeByte(X224_TPDU_CONNECTION_REQUEST); + + buf.writeShort(0); // Destination reference = 0 + buf.writeShort(0); // Source reference = 0 + buf.writeByte(0); // Class and options = 0 + buf.writeString("Cookie: mstshash=" + userName + "\r\n", RdpConstants.CHARSET_8); // Cookie + + // RDP_NEG_REQ::type + buf.writeByte(RdpConstants.RDP_NEG_REQ_TYPE_NEG_REQ); + // RDP_NEG_REQ::flags (0) + buf.writeByte(RdpConstants.RDP_NEG_REQ_FLAGS); + // RDP_NEG_REQ::length (constant: 8) short int in LE format + buf.writeByte(0x08); + buf.writeByte(0x00); + + // RDP_NEG_REQ: Requested protocols: PROTOCOL_SSL + buf.writeIntLE(RdpConstants.RDP_NEG_REQ_PROTOCOL_SSL); + + // Calculate length of packet and prepend it to buffer + ByteBuffer data = new ByteBuffer(5); + + // Write length + data.writeVariableIntLE(buf.length); + + // Reset length of buffer to actual length of data written + data.length = data.cursor; + + buf.prepend(data); + data.unref(); + + pushDataToOTOut(buf); + + switchOff(); + } + + /** + * Example. + * + * @see http://msdn.microsoft.com/en-us/library/cc240842.aspx + * @see http://msdn.microsoft.com/en-us/library/cc240500.aspx + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + String cookie = "eltons"; + + byte[] packet = new byte[] { + + 0x03, // TPKT Header: version = 3 + 0x00, // TPKT Header: Reserved = 0 + 0x00, // TPKT Header: Packet length - high part + 0x2c, // TPKT Header: Packet length - low part (total = 44 bytes) + 0x27, // X.224: Length indicator (39 bytes) + (byte) 0xe0, // X.224: Type (high nibble) = 0xe = CR TPDU; + // credit (low nibble) = 0 + 0x00, 0x00, // X.224: Destination reference = 0 + 0x00, 0x00, // X.224: Source reference = 0 + 0x00, // X.224: Class and options = 0 + + 'C', 'o', 'o', 'k', 'i', 'e', ':', ' ', 'm', 's', 't', 's', 'h', 'a', 's', 'h', '=', 'e', 'l', 't', 'o', 'n', 's', // "Cookie: mstshash=eltons" + '\r', '\n', // -Cookie terminator sequence + + 0x01, // RDP_NEG_REQ::type (TYPE_RDP_NEG_REQ) + 0x00, // RDP_NEG_REQ::flags (0) + 0x08, 0x00, // RDP_NEG_REQ::length (8 bytes) + 0x01, 0x00, 0x00, 0x00 // RDP_NEG_REQ: Requested protocols + // (PROTOCOL_SSL in little endian format) + }; + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + Element cr = new ClientX224ConnectionRequestPDU("cr", cookie); + Element tpkt = new ClientTpkt("tpkt"); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(packet)); + Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, cr, tpkt, sink, mainSink); + pipeline.link("source", "cr", "mainSink"); + pipeline.link("cr >" + OTOUT, "tpkt", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientX224DataPdu.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientX224DataPdu.java new file mode 100644 index 00000000000..2cf9b72612c --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ClientX224DataPdu.java @@ -0,0 +1,54 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +public class ClientX224DataPdu extends BaseElement { + + public static final int X224_TPDU_DATA = 0xF0; + public static final int X224_TPDU_LAST_DATA_UNIT = 0x80; + + public ClientX224DataPdu(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + ByteBuffer data = new ByteBuffer(3); + // X224 header + data.writeByte(2); // Header length indicator + data.writeByte(X224_TPDU_DATA); + data.writeByte(X224_TPDU_LAST_DATA_UNIT); + + buf.prepend(data); + data.unref(); + + pushDataToPad(STDOUT, buf); + } + + + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/HandshakeEnd.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/HandshakeEnd.java new file mode 100644 index 00000000000..62242de7943 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/HandshakeEnd.java @@ -0,0 +1,27 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; + +public class HandshakeEnd extends BaseElement { + + public HandshakeEnd(String id) { + super(id); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/MockServer.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/MockServer.java new file mode 100644 index 00000000000..b1419174911 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/MockServer.java @@ -0,0 +1,197 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.Arrays; + +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; + +public class MockServer implements Runnable { + + private boolean shutdown = false; + private ServerSocket serverSocket; + private Packet[] packets; + private Throwable exception; + private boolean shutdowned; + + /** + * Set to true to enable debugging messages. + */ + protected boolean verbose = System.getProperty("rdpclient.MockServer.debug", "false").equals("true"); + + public MockServer(Packet packets[]) { + this.packets = packets; + } + + public void start() throws IOException { + serverSocket = new ServerSocket(0); + + shutdown = false; + exception = null; + shutdowned = false; + + new Thread(this).start(); + } + + public void run() { + + try { + Socket socket = serverSocket.accept(); + + InputStream is = socket.getInputStream(); + OutputStream os = socket.getOutputStream(); + + try { + for (int i = 0; i < packets.length && !shutdown; i++) { + + Packet packet = packets[i]; + switch (packet.type) { + case CLIENT: { + // Read client data and compare it with mock data + // (unless "ignore" option is set) + byte actualData[] = new byte[packet.data.length]; + int actualDataLength = is.read(actualData); + + if (verbose) + System.out.println("[" + this + "] INFO: Data is read: {" + Arrays.toString(Arrays.copyOf(actualData, actualDataLength)) + "}."); + + if (!packet.ignore) { + // Compare actual data with expected data + if (actualDataLength != packet.data.length) { + throw new AssertionError("Actual length of client request for packet #" + (i + 1) + " (\"" + packet.id + "\")" + + " does not match length of expected client request. Actual length: " + actualDataLength + ", expected legnth: " + + packet.data.length + "."); + } + + for (int j = 0; j < packet.data.length; j++) { + + if (packet.data[j] != actualData[j]) { + throw new AssertionError("Actual byte #" + (j + 1) + " of client request for packet #" + (i + 1) + " (\"" + packet.id + + "\")" + " does not match corresponding byte of expected client request. Actual byte: " + actualData[j] + + ", expected byte: " + packet.data[j] + "."); + } + } + } + break; + } + case SERVER: { + // Send mock data to client + os.write(packet.data); + + if (verbose) + System.out.println("[" + this + "] INFO: Data is written: {" + Arrays.toString(packet.data) + "}."); + + break; + } + case UPGRADE_TO_SSL: { + // Attach SSL context to socket + + final SSLSocketFactory sslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) sslSocketFactory.createSocket(socket, null, serverSocket.getLocalPort(), true); + sslSocket.setEnabledCipherSuites(sslSocket.getSupportedCipherSuites()); + sslSocket.setUseClientMode(false); + sslSocket.startHandshake(); + is = sslSocket.getInputStream(); + os = sslSocket.getOutputStream(); + + break; + } + default: + throw new RuntimeException("Unknown packet type: " + packet.type); + } + + } + } finally { + try { + is.close(); + } catch (Throwable e) { + } + try { + os.close(); + } catch (Throwable e) { + } + try { + socket.close(); + } catch (Throwable e) { + } + try { + serverSocket.close(); + } catch (Throwable e) { + } + } + } catch (Throwable e) { + System.err.println("Error in mock server: " + e.getMessage()); + e.printStackTrace(System.err); + exception = e; + } + shutdowned = true; + if (verbose) + System.out.println("[" + this + "] INFO: Mock server shutdowned."); + + } + + public void shutdown() { + shutdown = true; + } + + public InetSocketAddress getAddress() { + return (InetSocketAddress) serverSocket.getLocalSocketAddress(); + } + + public Throwable getException() { + return exception; + } + + public static class Packet { + public static enum PacketType { + SERVER, CLIENT, UPGRADE_TO_SSL; + } + + public String id = ""; + + public Packet() { + } + + public Packet(String id) { + this.id = id; + } + + public PacketType type; + + public boolean ignore = false; + + public byte data[]; + } + + public boolean isShutdowned() { + return shutdowned; + } + + public void waitUntilShutdowned(long timeToWaitMiliseconds) throws InterruptedException { + long deadline = System.currentTimeMillis() + timeToWaitMiliseconds; + while (!shutdowned && System.currentTimeMillis() < deadline) { + Thread.sleep(10); + } + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/PacketSniffer.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/PacketSniffer.java new file mode 100644 index 00000000000..9fe2499ebc5 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/PacketSniffer.java @@ -0,0 +1,75 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import java.util.regex.Pattern; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +/** + * Try to determine packet content by it header fingerprint. + */ +public class PacketSniffer extends BaseElement { + + protected Pair regexps[]=null; + + public PacketSniffer(String id, Pair[] regexps) { + super(id); + this.regexps=regexps; + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + + matchPacket(buf); + + super.handleData(buf, link); + } + + private void matchPacket(ByteBuffer buf) { + String header = buf.toPlainHexString(100); + for (Pair pair : regexps) { + if (pair.regexp.matcher(header).find()) { + System.out.println("[" + this + "] INFO: Packet: " + pair.name + "."); + return; + } + } + + System.out.println("[" + this + "] INFO: Unknown packet: " + header + "."); + } + + protected static class Pair { + String name; + Pattern regexp; + + protected Pair(String name, String regexp) { + this.name = name; + this.regexp = Pattern.compile("^" + replaceShortcuts(regexp), Pattern.CASE_INSENSITIVE); + } + + private static String replaceShortcuts(String regexp) { + String result = regexp; + result = result.replaceAll("XX\\*", "([0-9a-fA-F]{2} )*?"); + result = result.replaceAll("XX\\?", "([0-9a-fA-F]{2} )?"); + result = result.replaceAll("XX", "[0-9a-fA-F]{2}"); + return result; + } + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RLEBitmapDecompression.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RLEBitmapDecompression.java new file mode 100644 index 00000000000..53e6d2f3bb0 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RLEBitmapDecompression.java @@ -0,0 +1,1014 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.AssertingByteBuffer; +import streamer.ByteBuffer; + +/** + * Based on code example from MSDN, @see + * http://msdn.microsoft.com/en-us/library/dd240593.aspx . + */ +public class RLEBitmapDecompression { + + public static final int g_MaskRegularRunLength = 0x1F; + public static final int g_MaskLiteRunLength = 0x0F; + + public static final int g_MaskSpecialFgBg1 = 0x03; + public static final int g_MaskSpecialFgBg2 = 0x05; + + public static final int REGULAR_BG_RUN = 0x00; + public static final int REGULAR_FG_RUN = 0x01; + public static final int REGULAR_FGBG_IMAGE = 0x02; + public static final int REGULAR_COLOR_RUN = 0x03; + public static final int REGULAR_COLOR_IMAGE = 0x04; + + public static final int LITE_SET_FG_FG_RUN = 0x0C; + public static final int LITE_SET_FG_FGBG_IMAGE = 0x0D; + public static final int LITE_DITHERED_RUN = 0x0E; + + public static final int MEGA_MEGA_BG_RUN = 0xF0; + public static final int MEGA_MEGA_FG_RUN = 0xF1; + public static final int MEGA_MEGA_FGBG_IMAGE = 0xF2; + public static final int MEGA_MEGA_COLOR_RUN = 0xF3; + public static final int MEGA_MEGA_COLOR_IMAGE = 0xF4; + public static final int MEGA_MEGA_SET_FG_RUN = 0xF6; + public static final int MEGA_MEGA_SET_FGBG_IMAGE = 0xF7; + public static final int MEGA_MEGA_DITHERED_RUN = 0xF8; + + public static final int SPECIAL_FGBG_1 = 0xF9; + public static final int SPECIAL_FGBG_2 = 0xFA; + + public static final int SPECIAL_WHITE = 0xFD; + public static final int SPECIAL_BLACK = 0xFE; + + /** + * Writes a pixel to the specified buffer and advance cursor by bpp. + * + * @param bpp + * bytes per pixel + */ + private static void writePixel(int bpp, ByteBuffer destBuf, int pixel) { + switch (bpp) { + case 1: + destBuf.writeByte(pixel); + break; + case 2: + destBuf.writeShortLE(pixel); + break; + case 3: + destBuf.writeByte(pixel); + destBuf.writeShortLE(pixel >> 8); + break; + case 4: + destBuf.writeIntLE(pixel); + break; + default: + throw new RuntimeException("Unsupported color depth."); + } + } + + /** + * Reads a pixel from the specified buffer at given offset without changing of + * cursor. + * + * @param bpp + * bytes per pixel + * @param offset + * -rowDelta (i.e. (-width*bpp)) + */ + private static int peekPixel(int bpp, ByteBuffer destBuf, int offset) { + if (offset >= 0 || (-offset) > destBuf.cursor) + throw new RuntimeException("Incorrect value for offset: offset in destination buffer must point to pixel in previous row."); + + // Adjust cursor to point to pixel in previous row + int oldCursor = destBuf.cursor; + destBuf.cursor += offset; + + int pixel; + switch (bpp) { + case 1: + pixel = destBuf.readUnsignedByte(); + break; + case 2: + pixel = destBuf.readUnsignedShortLE(); + break; + case 3: + pixel = destBuf.readUnsignedByte() | (destBuf.readUnsignedShortLE() >> 8); + break; + case 4: + pixel = destBuf.readSignedIntLE(); + break; + default: + throw new RuntimeException("Unsupported color depth."); + } + destBuf.cursor = oldCursor; + + return pixel; + } + + /** + * Reads a pixel from the specified buffer and advance cursor by bpp value. + * + * @param bpp + * bytes per pixel + */ + private static int readPixel(int bpp, ByteBuffer srcBuf) { + int pixel; + switch (bpp) { + case 1: + pixel = srcBuf.readUnsignedByte(); + break; + case 2: + pixel = srcBuf.readUnsignedShortLE(); + break; + case 3: + pixel = srcBuf.readUnsignedByte() | (srcBuf.readUnsignedShortLE() >> 8); + break; + case 4: + pixel = srcBuf.readSignedIntLE(); + break; + default: + throw new RuntimeException("Unsupported color depth."); + } + + return pixel; + } + + /** + * Returns the size of a pixel in bytes. + */ + private static int getPixelSize(int colorDepth) { + switch (colorDepth) { + case 8: + return 1; + case 15: + case 16: + return 2; + case 24: + return 3; + default: + throw new RuntimeException("Unsupported pixel color depth: " + colorDepth + " bpp."); + } + } + + /** + * Reads the supplied order header & extracts the compression order code ID. + */ + private static int extractCodeId(int orderHeader) { + // Taken from FreeRDP code, bitmap.c + switch (orderHeader) { + case MEGA_MEGA_BG_RUN: + case MEGA_MEGA_FG_RUN: + case MEGA_MEGA_SET_FG_RUN: + case MEGA_MEGA_DITHERED_RUN: + case MEGA_MEGA_COLOR_RUN: + case MEGA_MEGA_FGBG_IMAGE: + case MEGA_MEGA_SET_FGBG_IMAGE: + case MEGA_MEGA_COLOR_IMAGE: + case SPECIAL_FGBG_1: + case SPECIAL_FGBG_2: + case SPECIAL_WHITE: + case SPECIAL_BLACK: + return orderHeader; + } + + int code = orderHeader >> 5; + switch (code) { + case REGULAR_BG_RUN: + case REGULAR_FG_RUN: + case REGULAR_COLOR_RUN: + case REGULAR_FGBG_IMAGE: + case REGULAR_COLOR_IMAGE: + return code; + } + + return orderHeader >> 4; + } + + /** + * Returns a black pixel. + */ + private static int getColorBlack() { + return 0x000000; + } + + /** + * Returns a white pixel. + */ + private static int getColorWhite(int colorDepth) { + if (colorDepth == 8) { + // + // Palette entry #255 holds white. + // + return 0xFF; + } else if (colorDepth == 15) { + // + // 5 bits per RGB component: + // 0111 1111 1111 1111 (binary) + // + return 0x7FFF; + } else if (colorDepth == 16) { + // + // 5 bits for red, 6 bits for green, 5 bits for green: + // 1111 1111 1111 1111 (binary) + // + return 0xFFFF; + } else if (colorDepth == 24) { + // + // 8 bits per RGB component: + // 1111 1111 1111 1111 1111 1111 (binary) + // + return 0xFFFFFF; + } else + throw new RuntimeException("Unsupported color depth."); + } + + /** + * Extract the run length of a compression order. + */ + private static int extractRunLength(int code, int orderHeader, ByteBuffer srcBuf) { + switch (code) { + case REGULAR_FGBG_IMAGE: { + int runLength = orderHeader & g_MaskRegularRunLength; + if (runLength == 0) + runLength = srcBuf.readUnsignedByte() + 1; + else + runLength = runLength * 8; + return runLength; + } + case LITE_SET_FG_FGBG_IMAGE: { + int runLength = orderHeader & g_MaskLiteRunLength; + if (runLength == 0) + runLength = srcBuf.readUnsignedByte() + 1; + else + runLength = runLength * 8; + return runLength; + } + case REGULAR_BG_RUN: + case REGULAR_COLOR_IMAGE: + case REGULAR_COLOR_RUN: + case REGULAR_FG_RUN: { + int runLength = orderHeader & g_MaskRegularRunLength; + if (runLength == 0) + // An extended (MEGA) run. + runLength = srcBuf.readUnsignedByte() + 32; + return runLength; + } + case LITE_DITHERED_RUN: + case LITE_SET_FG_FG_RUN: { + int runLength = orderHeader & g_MaskLiteRunLength; + if (runLength == 0) + // An extended (MEGA) run. + runLength = srcBuf.readUnsignedByte() + 16; + return runLength; + } + case MEGA_MEGA_BG_RUN: + case MEGA_MEGA_COLOR_IMAGE: + case MEGA_MEGA_COLOR_RUN: + case MEGA_MEGA_DITHERED_RUN: + case MEGA_MEGA_FG_RUN: + case MEGA_MEGA_FGBG_IMAGE: + case MEGA_MEGA_SET_FG_RUN: + case MEGA_MEGA_SET_FGBG_IMAGE: { + return srcBuf.readUnsignedShortLE(); + } + default: + return 0; + } + + } + + /** + * Write a foreground/background image to a destination buffer. + */ + private static void writeFgBgImage(int bpp, ByteBuffer destBuf, int rowDelta, int bitmask, int fgPel, int cBits) { + for (; cBits > 0; cBits--, bitmask >>= 1) { + int xorPixel = peekPixel(bpp, destBuf, -rowDelta); + writePixel(bpp, destBuf, ((bitmask & 0x1) > 0) ? xorPixel ^ fgPel : xorPixel); + } + } + + /** + * Write a foreground/background image to a destination buffer for the first + * line of compressed data. + */ + private static void writeFirstLineFgBgImage(int bpp, ByteBuffer destBuf, int bitmask, int fgPel, int cBits) { + for (; cBits > 0; cBits--, bitmask >>= 1) { + writePixel(bpp, destBuf, ((bitmask & 0x1) > 0) ? fgPel : getColorBlack()); + } + } + + /** + * Decompress a RLE compressed bitmap and flip decompressed image. + * + * @param srcBuf + * source buffer containing compressed bitmap + * @param imageWidth + * width of destination image in pixels + * @param imageHeight + * height of destination image in pixels + * @param colorDepth + * bits per pixel + * @return destination image buffer + */ + public static ByteBuffer rleDecompress(ByteBuffer srcBuf, int imageWidth, int imageHeight, int colorDepth) { + int bpp = getPixelSize(colorDepth); + + // Decompress image + ByteBuffer destBuf = new ByteBuffer(new byte[imageWidth * imageHeight * bpp]); + rleDecompress(srcBuf, destBuf, imageWidth, imageHeight, colorDepth); + + // Flip image + return flipRawImage(destBuf, imageWidth, imageHeight, bpp); + } + + /** + * Decompress a RLE compressed bitmap. + * + * @param srcBuf + * source buffer containing compressed bitmap + * @param destBuf + * destination buffer + * @param imageWidth + * width of destination image in pixels + * @param imageHeight + * height of destination image in pixels + * @param colorDepth + * bits per pixel + */ + protected static void rleDecompress(final ByteBuffer srcBuf, final ByteBuffer destBuf, final int imageWidth, final int imageHeight, final int colorDepth) { + final int bpp = getPixelSize(colorDepth); + final int rowDelta = imageWidth * bpp; + final int whitePixel = getColorWhite(colorDepth); + final int blackPixel = getColorBlack(); + + int fgPel = whitePixel; + boolean insertFgPel = false; + boolean firstLine = true; + + if (destBuf.length != imageWidth * imageHeight * bpp) + throw new RuntimeException("Incorrect size of destination buffer. Expected size (imageWidth*imageHeight*bpp): " + (imageWidth * imageHeight * bpp) + + ", actual size: " + destBuf.length + "."); + + while (srcBuf.cursor < srcBuf.length) { + // Watch out for the end of the first scanline in destination buffer. + if (firstLine) { + if (destBuf.cursor >= rowDelta) { + firstLine = false; + insertFgPel = false; + } + } + + // Extract the compression order code ID from the compression + // order header. + int orderHeader = srcBuf.readUnsignedByte(); + int code = extractCodeId(orderHeader); + + // Handle Background Run Orders. + if (code == REGULAR_BG_RUN | code == MEGA_MEGA_BG_RUN) { + int runLength = extractRunLength(code, orderHeader, srcBuf); + + if (firstLine) { + if (insertFgPel) { + writePixel(bpp, destBuf, fgPel); + runLength--; + } + + for (; runLength > 0; runLength--) + writePixel(bpp, destBuf, blackPixel); + + } else { + if (insertFgPel) { + writePixel(bpp, destBuf, peekPixel(bpp, destBuf, -rowDelta) ^ fgPel); + runLength--; + } + + // Copy pixels from previous row of destination image + for (; runLength > 0; runLength--) + writePixel(bpp, destBuf, peekPixel(bpp, destBuf, -rowDelta)); + } + + // + // A follow-on background run order will need a + // foreground pel inserted. + // + insertFgPel = true; + continue; + } + + // + // For any of the other run-types a follow-on background run + // order does not need a foreground pel inserted. + // + insertFgPel = false; + + // + // Handle Foreground Run Orders. + // + if (code == REGULAR_FG_RUN | code == MEGA_MEGA_FG_RUN | code == LITE_SET_FG_FG_RUN | code == MEGA_MEGA_SET_FG_RUN) { + int runLength = extractRunLength(code, orderHeader, srcBuf); + + if (code == LITE_SET_FG_FG_RUN | code == MEGA_MEGA_SET_FG_RUN) + fgPel = readPixel(bpp, srcBuf); + + if (firstLine) { + for (; runLength > 0; runLength--) { + writePixel(bpp, destBuf, fgPel); + } + } else { + for (; runLength > 0; runLength--) { + writePixel(bpp, destBuf, peekPixel(bpp, destBuf, -rowDelta) ^ fgPel); + } + } + + continue; + } + + // + // Handle Dithered Run Orders. + // + if (code == LITE_DITHERED_RUN | code == MEGA_MEGA_DITHERED_RUN) { + int runLength = extractRunLength(code, orderHeader, srcBuf); + + int pixelA = readPixel(bpp, srcBuf); + int pixelB = readPixel(bpp, srcBuf); + + for (; runLength > 0; runLength--) { + writePixel(bpp, destBuf, pixelA); + writePixel(bpp, destBuf, pixelB); + } + + continue; + } + + // + // Handle Color Run Orders. + // + if (code == REGULAR_COLOR_RUN | code == MEGA_MEGA_COLOR_RUN) { + int runLength = extractRunLength(code, orderHeader, srcBuf); + + int pixelA = readPixel(bpp, srcBuf); + + for (; runLength > 0; runLength--) + writePixel(bpp, destBuf, pixelA); + + continue; + } + + // + // Handle Foreground/Background Image Orders. + // + if (code == REGULAR_FGBG_IMAGE | code == MEGA_MEGA_FGBG_IMAGE | code == LITE_SET_FG_FGBG_IMAGE | code == MEGA_MEGA_SET_FGBG_IMAGE) { + int runLength = extractRunLength(code, orderHeader, srcBuf); + + if (code == LITE_SET_FG_FGBG_IMAGE | code == MEGA_MEGA_SET_FGBG_IMAGE) { + fgPel = readPixel(bpp, srcBuf); + } + + for (; runLength > 8; runLength -= 8) { + int bitmask = srcBuf.readUnsignedByte(); + + if (firstLine) + writeFirstLineFgBgImage(bpp, destBuf, bitmask, fgPel, 8); + else + writeFgBgImage(bpp, destBuf, rowDelta, bitmask, fgPel, 8); + } + + if (runLength > 0) { + int bitmask = srcBuf.readUnsignedByte(); + + if (firstLine) + writeFirstLineFgBgImage(bpp, destBuf, bitmask, fgPel, runLength); + else + writeFgBgImage(bpp, destBuf, rowDelta, bitmask, fgPel, runLength); + } + + continue; + } + + // + // Handle Color Image Orders. + // + if (code == REGULAR_COLOR_IMAGE | code == MEGA_MEGA_COLOR_IMAGE) { + int runLength = extractRunLength(code, orderHeader, srcBuf); + + /* DEBUG */ + // Copy bytes from source to destination using writeByte(readByte()) + // for (int byteCount = runLength * bpp; byteCount > 0; byteCount--) { + // destBuf.writeByte(srcBuf.readUnsignedByte()); + // } + /* DEBUG */ + + // Copy bytes from source to destination directly using arraycopy() + int lengthInBytes = runLength * bpp; + System.arraycopy(srcBuf.data, srcBuf.offset + srcBuf.cursor, destBuf.data, destBuf.offset + destBuf.cursor, lengthInBytes); + srcBuf.cursor += lengthInBytes; + destBuf.cursor += lengthInBytes; + + continue; + } + + // + // Handle Special Order 1. + // + if (code == SPECIAL_FGBG_1) { + if (firstLine) + writeFirstLineFgBgImage(bpp, destBuf, g_MaskSpecialFgBg1, fgPel, 8); + else + writeFgBgImage(bpp, destBuf, rowDelta, g_MaskSpecialFgBg1, fgPel, 8); + + continue; + } + + // + // Handle Special Order 2. + // + if (code == SPECIAL_FGBG_2) { + if (firstLine) + writeFirstLineFgBgImage(bpp, destBuf, g_MaskSpecialFgBg2, fgPel, 8); + else + writeFgBgImage(bpp, destBuf, rowDelta, g_MaskSpecialFgBg2, fgPel, 8); + + continue; + } + + // + // Handle White Order. + // + if (code == SPECIAL_WHITE) { + writePixel(bpp, destBuf, whitePixel); + + continue; + } + + // + // Handle Black Order. + // + if (code == SPECIAL_BLACK) { + writePixel(bpp, destBuf, blackPixel); + + continue; + } + + throw new RuntimeException("Unknown code: " + code + "."); + } + } + + /** + * Flip image in vertical direction. + */ + public static ByteBuffer flipRawImage(ByteBuffer src, int width, int height, int bpp) { + if (width * height * bpp != src.length) + throw new RuntimeException("Incorrect size of buffer. Expected size (imageWidth*imageHeight*bpp): " + (width * height * bpp) + ", actual size: " + + src.length + "."); + ByteBuffer dest = new ByteBuffer(new byte[src.length]); + + int scanLine = width * bpp; + + for (int i = 0; i < height; i++) { + // Copy one row + System.arraycopy(src.data, (height - i - 1) * scanLine, dest.data, i * scanLine, scanLine); + } + + return dest; + + } + + /** + * Example. + */ + public static void main(String args[]) { + + if (true) { + // 16x1@8bpp, all black + int width = 16, height = 1, depth = 8, bpp = depth / 8; + ByteBuffer src = new ByteBuffer(new byte[] { 0x10 }); + ByteBuffer dest = new AssertingByteBuffer(new byte[width * height * bpp]); + rleDecompress(src, dest, width, height, depth); + } + + if (true) { + // 16x1@16bpp, all black + int width = 16, height = 1, depth = 16, bpp = depth / 8; + ByteBuffer src = new ByteBuffer(new byte[] { 0x0c, (byte) 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); + ByteBuffer dest = new AssertingByteBuffer(new byte[width * height * bpp]); + rleDecompress(src, dest, width, height, depth); + } + + if (true) { + // 32x32@8 + int width = 32, height = 32, depth = 8, bpp = depth / 8; + + ByteBuffer src = new ByteBuffer(new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x80, (byte) 0x00, (byte) 0x06, (byte) 0x06, + (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xec, (byte) 0x6c, (byte) 0x0e, + (byte) 0x0e, (byte) 0x44, (byte) 0x0e, (byte) 0x0e, (byte) 0x0e, (byte) 0x13, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, + (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0xe4, (byte) 0x04, (byte) 0x06, + (byte) 0x8e, (byte) 0x60, (byte) 0x0e, (byte) 0x60, (byte) 0x8c, (byte) 0xb4, (byte) 0xb5, (byte) 0xdc, (byte) 0xdc, (byte) 0xbb, (byte) 0xb4, + (byte) 0x8c, (byte) 0x66, (byte) 0x0b, (byte) 0x6c, (byte) 0xe4, (byte) 0x04, (byte) 0x06, (byte) 0x02, (byte) 0x8b, (byte) 0x06, (byte) 0x06, + (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xf8, (byte) 0x0e, (byte) 0x66, (byte) 0xb4, (byte) 0xdc, (byte) 0x68, (byte) 0xe2, + (byte) 0x97, (byte) 0xdd, (byte) 0xb4, (byte) 0xa7, (byte) 0x16, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xed, + (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x0b, (byte) 0xae, + (byte) 0xdc, (byte) 0xe9, (byte) 0x6a, (byte) 0xdc, (byte) 0x96, (byte) 0xe9, (byte) 0xe9, (byte) 0xb4, (byte) 0x0e, (byte) 0x00, (byte) 0x06, + (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, + (byte) 0x0e, (byte) 0xae, (byte) 0xdc, (byte) 0xdb, (byte) 0xdb, (byte) 0xd0, (byte) 0x09, (byte) 0x07, (byte) 0xcf, (byte) 0x03, (byte) 0x95, + (byte) 0xdb, (byte) 0xdb, (byte) 0xdc, (byte) 0xb4, (byte) 0x66, (byte) 0x6c, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x00, + (byte) 0x00, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x0b, (byte) 0xae, (byte) 0xdb, (byte) 0xd4, (byte) 0xd5, (byte) 0x6c, + (byte) 0xdb, (byte) 0x80, (byte) 0xaf, (byte) 0xd5, (byte) 0xd4, (byte) 0xdb, (byte) 0xb4, (byte) 0x66, (byte) 0x04, (byte) 0x06, (byte) 0x04, + (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x66, (byte) 0xae, (byte) 0xd5, (byte) 0xad, (byte) 0xd4, + (byte) 0xd4, (byte) 0xd5, (byte) 0xd5, (byte) 0xd5, (byte) 0xdb, (byte) 0xb4, (byte) 0xb4, (byte) 0xb4, (byte) 0xb4, (byte) 0xb4, (byte) 0xd5, + (byte) 0xd5, (byte) 0xd5, (byte) 0xd4, (byte) 0xd4, (byte) 0xad, (byte) 0xd5, (byte) 0xb4, (byte) 0x0e, (byte) 0x06, (byte) 0x06, (byte) 0x06, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x60, (byte) 0xa7, (byte) 0xb4, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xb3, + (byte) 0xb3, (byte) 0xd4, (byte) 0xd4, (byte) 0xb3, (byte) 0x8c, (byte) 0xb6, (byte) 0x07, (byte) 0xb6, (byte) 0x8c, (byte) 0xb3, (byte) 0xd4, + (byte) 0xb3, (byte) 0xb3, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xb4, (byte) 0xad, (byte) 0x66, (byte) 0x00, (byte) 0x06, (byte) 0x00, + (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0x66, (byte) 0xae, (byte) 0xad, (byte) 0x8b, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, + (byte) 0xad, (byte) 0xb3, (byte) 0xad, (byte) 0xb5, (byte) 0x07, (byte) 0x07, (byte) 0x07, (byte) 0xf0, (byte) 0x8b, (byte) 0xad, (byte) 0xad, + (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0x8b, (byte) 0xa7, (byte) 0xae, (byte) 0xa7, (byte) 0x6c, (byte) 0x06, (byte) 0x00, (byte) 0x00, + (byte) 0x04, (byte) 0x6c, (byte) 0xa7, (byte) 0xad, (byte) 0xa7, (byte) 0xa7, (byte) 0x8b, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, + (byte) 0xad, (byte) 0xad, (byte) 0xb5, (byte) 0xbd, (byte) 0xbd, (byte) 0xbd, (byte) 0xbd, (byte) 0xf0, (byte) 0x8b, (byte) 0x8b, (byte) 0xad, + (byte) 0x8b, (byte) 0x8b, (byte) 0xa7, (byte) 0xa7, (byte) 0xc8, (byte) 0xc8, (byte) 0x60, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, + (byte) 0x66, (byte) 0xc8, (byte) 0xa7, (byte) 0x66, (byte) 0xa7, (byte) 0xa7, (byte) 0x8b, (byte) 0x8b, (byte) 0x8b, (byte) 0x8b, (byte) 0xad, + (byte) 0x8b, (byte) 0x92, (byte) 0xf1, (byte) 0xf1, (byte) 0xf1, (byte) 0xf1, (byte) 0xf2, (byte) 0x07, (byte) 0xa7, (byte) 0xa7, (byte) 0x8b, + (byte) 0xa7, (byte) 0xa7, (byte) 0x66, (byte) 0x66, (byte) 0xc8, (byte) 0x66, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x60, + (byte) 0xa7, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0xa7, (byte) 0xa7, (byte) 0xa7, (byte) 0xa7, (byte) 0x8b, (byte) 0x8b, (byte) 0x8b, + (byte) 0xa7, (byte) 0xb6, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0x07, (byte) 0x66, (byte) 0xa7, (byte) 0xa7, + (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0xa7, (byte) 0xa7, (byte) 0x6c, (byte) 0x00, (byte) 0x00, (byte) 0x6c, (byte) 0x04, (byte) 0xa7, + (byte) 0x60, (byte) 0x6b, (byte) 0x66, (byte) 0x99, (byte) 0xb6, (byte) 0xf5, (byte) 0xf5, (byte) 0xf5, (byte) 0xf5, (byte) 0xf5, (byte) 0xef, + (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0xa7, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x60, + (byte) 0xa7, (byte) 0x66, (byte) 0x60, (byte) 0x66, (byte) 0x66, (byte) 0x8c, (byte) 0xf1, (byte) 0x6e, (byte) 0xff, (byte) 0x85, (byte) 0xbd, + (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x60, (byte) 0x05, (byte) 0x87, (byte) 0x13, (byte) 0x04, (byte) 0x66, (byte) 0x66, (byte) 0x66, + (byte) 0x66, (byte) 0xf4, (byte) 0x70, (byte) 0xff, (byte) 0x84, (byte) 0xbd, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x05, (byte) 0x85, + (byte) 0x0b, (byte) 0xa7, (byte) 0xb5, (byte) 0xae, (byte) 0x8c, (byte) 0xd0, (byte) 0x13, (byte) 0xc1, (byte) 0x01, (byte) 0x00, (byte) 0x08, + (byte) 0x8e, (byte) 0x8c, (byte) 0xae, (byte) 0xb5, (byte) 0xae, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x6c, (byte) 0xae, (byte) 0xbc, + (byte) 0xb5, (byte) 0xb5, (byte) 0xae, (byte) 0xb5, (byte) 0xd0, (byte) 0x0e, (byte) 0x0c, (byte) 0x01, (byte) 0x00, (byte) 0x90, (byte) 0xf2, + (byte) 0xae, (byte) 0xae, (byte) 0xb5, (byte) 0xb5, (byte) 0xbc, (byte) 0xb5, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0xae, + (byte) 0x0a, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0x68, (byte) 0xae, (byte) 0x82, (byte) 0x8c, (byte) 0x0a, (byte) 0x05, (byte) 0x8c, + (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xbc, (byte) 0xb5, (byte) 0x6c, (byte) 0x00, (byte) 0x00, + (byte) 0x06, (byte) 0x05, (byte) 0x81, (byte) 0xd0, (byte) 0x06, (byte) 0x9a, (byte) 0x8c, (byte) 0x0a, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xd0, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0x0a, (byte) 0xb5, + (byte) 0x6c, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x8b, (byte) 0x0a, (byte) 0xbc, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0x06, + (byte) 0x9b, (byte) 0xb6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xae, + (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0x0a, (byte) 0x8c, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x6c, + (byte) 0xb5, (byte) 0x0a, (byte) 0xb6, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0x05, (byte) 0x80, (byte) 0x7d, (byte) 0xbc, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, + (byte) 0x0a, (byte) 0x0a, (byte) 0x8b, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x06, (byte) 0x87, (byte) 0x0a, (byte) 0xbc, + (byte) 0xb6, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xd0, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xb6, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xf2, (byte) 0xd0, (byte) 0xae, (byte) 0xd0, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0xbc, (byte) 0x1a, + (byte) 0xb5, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0xed, (byte) 0x06, (byte) 0x6e, (byte) 0xb5, (byte) 0x0a, (byte) 0xbc, + (byte) 0xb6, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xd0, (byte) 0xd0, (byte) 0xd0, (byte) 0xb5, (byte) 0xf4, (byte) 0xff, (byte) 0xf2, + (byte) 0xd0, (byte) 0xd0, (byte) 0xd0, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0xbc, (byte) 0x0a, (byte) 0x0a, (byte) 0x8b, + (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x8b, (byte) 0xbc, (byte) 0x1a, (byte) 0x0a, + (byte) 0xb6, (byte) 0xb6, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xd0, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, + (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0xb6, (byte) 0x0a, (byte) 0xde, (byte) 0x0a, (byte) 0xa7, (byte) 0x06, (byte) 0x00, + (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x8b, (byte) 0xbc, (byte) 0xf2, (byte) 0x0a, + (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, + (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0x0a, (byte) 0xf2, (byte) 0x1a, (byte) 0x8c, (byte) 0xec, (byte) 0x06, (byte) 0x06, (byte) 0x06, + (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0xa7, (byte) 0xbc, (byte) 0x1a, (byte) 0x0a, + (byte) 0x0a, (byte) 0x6a, (byte) 0xb6, (byte) 0x96, (byte) 0x0a, (byte) 0x0a, (byte) 0xf2, (byte) 0x0a, (byte) 0x87, (byte) 0x06, (byte) 0x04, + (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x06, + (byte) 0x8c, (byte) 0xb6, (byte) 0xf4, (byte) 0xf2, (byte) 0xd0, (byte) 0x09, (byte) 0xbc, (byte) 0x87, (byte) 0x03, (byte) 0x80, (byte) 0x2c, + (byte) 0xde, (byte) 0xf4, (byte) 0x0a, (byte) 0x8b, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x6c, (byte) 0x87, (byte) 0x0a, + (byte) 0xf4, (byte) 0xf4, (byte) 0xf2, (byte) 0xde, (byte) 0xbd, (byte) 0xbd, (byte) 0xde, (byte) 0xf2, (byte) 0xf4, (byte) 0xf4, (byte) 0x0a, + (byte) 0xd0, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x00, + (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x6c, (byte) 0x8c, + (byte) 0xb5, (byte) 0xbc, (byte) 0x0a, (byte) 0xde, (byte) 0xf2, (byte) 0xbd, (byte) 0x0a, (byte) 0xb5, (byte) 0x8c, (byte) 0x6c, (byte) 0x06, + (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0xe6, + (byte) 0x04, (byte) 0x06, (byte) 0x86, (byte) 0x04, (byte) 0x6c, (byte) 0x04, (byte) 0x8b, (byte) 0x04, (byte) 0x6c, (byte) 0xe6, (byte) 0x04, + (byte) 0x06, (byte) 0x82, (byte) 0x00, (byte) 0x00 + + }); + + ByteBuffer flippedImage = new ByteBuffer(new byte[] { (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, + (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x6c, (byte) 0x04, (byte) 0x8b, (byte) 0x04, (byte) 0x6c, + (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, + (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, + (byte) 0x06, (byte) 0x6c, (byte) 0x8c, (byte) 0xb5, (byte) 0xbc, (byte) 0x0a, (byte) 0xde, (byte) 0xf2, (byte) 0xbd, (byte) 0x0a, (byte) 0xb5, + (byte) 0x8c, (byte) 0x6c, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x6c, (byte) 0x87, + (byte) 0x0a, (byte) 0xf4, (byte) 0xf4, (byte) 0xf2, (byte) 0xde, (byte) 0xbd, (byte) 0xbd, (byte) 0xde, (byte) 0xf2, (byte) 0xf4, (byte) 0xf4, + (byte) 0x0a, (byte) 0xd0, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x00, + (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x8c, (byte) 0xb6, (byte) 0xf4, (byte) 0xf2, + (byte) 0x0a, (byte) 0x0a, (byte) 0x0a, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0x0a, (byte) 0x0a, (byte) 0x0a, (byte) 0xde, + (byte) 0xf4, (byte) 0x0a, (byte) 0x8b, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x00, (byte) 0x00, + (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0xa7, (byte) 0xbc, (byte) 0x1a, (byte) 0x0a, (byte) 0x0a, (byte) 0xb6, + (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0x0a, (byte) 0x0a, + (byte) 0xf2, (byte) 0x0a, (byte) 0x87, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, + (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x8b, (byte) 0xbc, (byte) 0xf2, (byte) 0x0a, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, + (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0xb6, (byte) 0x0a, + (byte) 0xf2, (byte) 0x1a, (byte) 0x8c, (byte) 0xec, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, + (byte) 0x04, (byte) 0x8b, (byte) 0xbc, (byte) 0x1a, (byte) 0x0a, (byte) 0xb6, (byte) 0xb6, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, + (byte) 0xb5, (byte) 0xd0, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0xb6, (byte) 0x0a, + (byte) 0xde, (byte) 0x0a, (byte) 0xa7, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0xed, (byte) 0x06, (byte) 0x6e, + (byte) 0xb5, (byte) 0x0a, (byte) 0xbc, (byte) 0xb6, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xd0, (byte) 0xd0, (byte) 0xd0, (byte) 0xb5, + (byte) 0xf4, (byte) 0xff, (byte) 0xf2, (byte) 0xd0, (byte) 0xd0, (byte) 0xd0, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0xbc, + (byte) 0x0a, (byte) 0x0a, (byte) 0x8b, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x06, (byte) 0x87, (byte) 0x0a, + (byte) 0xbc, (byte) 0xb6, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xd0, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xb6, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xd0, (byte) 0xae, (byte) 0xd0, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0xbc, + (byte) 0x1a, (byte) 0xb5, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x6c, (byte) 0xb5, (byte) 0x0a, (byte) 0xb6, + (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xbc, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0x0a, + (byte) 0x0a, (byte) 0x8b, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x8b, (byte) 0x0a, (byte) 0xbc, (byte) 0xb5, (byte) 0xb5, + (byte) 0xb5, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xb6, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xb6, (byte) 0x0a, + (byte) 0x8c, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0xae, (byte) 0x0a, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xd0, + (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0x8c, (byte) 0x0a, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xd0, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0x0a, (byte) 0xb5, + (byte) 0x6c, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0xae, (byte) 0x0a, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xae, (byte) 0xae, + (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0xae, (byte) 0x8c, (byte) 0x0a, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xb5, (byte) 0xb5, (byte) 0xb5, (byte) 0xbc, (byte) 0xb5, (byte) 0x6c, + (byte) 0x00, (byte) 0x00, (byte) 0x6c, (byte) 0xae, (byte) 0xbc, (byte) 0xb5, (byte) 0xb5, (byte) 0xae, (byte) 0xb5, (byte) 0xf3, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xf2, (byte) 0xae, (byte) 0xae, (byte) 0xb5, (byte) 0xb5, (byte) 0xbc, (byte) 0xb5, (byte) 0x66, (byte) 0x00, + (byte) 0x00, (byte) 0x0b, (byte) 0xa7, (byte) 0xb5, (byte) 0xae, (byte) 0x8c, (byte) 0xa7, (byte) 0xf4, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xbd, (byte) 0xa7, (byte) 0x8c, (byte) 0xae, (byte) 0xb5, (byte) 0xae, (byte) 0x66, (byte) 0x00, (byte) 0x00, + (byte) 0x13, (byte) 0x04, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0xf4, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xbd, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0xa7, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x60, + (byte) 0xa7, (byte) 0x66, (byte) 0x60, (byte) 0x66, (byte) 0x66, (byte) 0x8c, (byte) 0xf1, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xbd, + (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x60, (byte) 0x66, (byte) 0xa7, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x6c, (byte) 0x04, + (byte) 0xa7, (byte) 0x60, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, + (byte) 0x66, (byte) 0x66, (byte) 0xb6, (byte) 0xf5, (byte) 0xf5, (byte) 0xf5, (byte) 0xf5, (byte) 0xf5, (byte) 0xef, (byte) 0x66, (byte) 0x66, + (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0xa7, (byte) 0x66, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x60, (byte) 0xa7, + (byte) 0x66, (byte) 0x66, (byte) 0x66, (byte) 0xa7, (byte) 0xa7, (byte) 0xa7, (byte) 0xa7, (byte) 0x8b, (byte) 0x8b, (byte) 0x8b, (byte) 0xa7, + (byte) 0xb6, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0xf3, (byte) 0x07, (byte) 0x66, (byte) 0xa7, (byte) 0xa7, (byte) 0x66, + (byte) 0x66, (byte) 0x66, (byte) 0xa7, (byte) 0xa7, (byte) 0x6c, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x66, (byte) 0xc8, (byte) 0xa7, + (byte) 0x66, (byte) 0xa7, (byte) 0xa7, (byte) 0x8b, (byte) 0x8b, (byte) 0x8b, (byte) 0x8b, (byte) 0xad, (byte) 0x8b, (byte) 0x92, (byte) 0xf1, + (byte) 0xf1, (byte) 0xf1, (byte) 0xf1, (byte) 0xf2, (byte) 0x07, (byte) 0xa7, (byte) 0xa7, (byte) 0x8b, (byte) 0xa7, (byte) 0xa7, (byte) 0x66, + (byte) 0x66, (byte) 0xc8, (byte) 0x66, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x6c, (byte) 0xa7, (byte) 0xad, (byte) 0xa7, + (byte) 0xa7, (byte) 0x8b, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xb5, (byte) 0xbd, (byte) 0xbd, + (byte) 0xbd, (byte) 0xbd, (byte) 0xf0, (byte) 0x8b, (byte) 0x8b, (byte) 0xad, (byte) 0x8b, (byte) 0x8b, (byte) 0xa7, (byte) 0xa7, (byte) 0xc8, + (byte) 0xc8, (byte) 0x60, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0x66, (byte) 0xae, (byte) 0xad, (byte) 0x8b, + (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xb3, (byte) 0xad, (byte) 0xb5, (byte) 0x07, (byte) 0x07, (byte) 0x07, + (byte) 0xf0, (byte) 0x8b, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0x8b, (byte) 0xa7, (byte) 0xae, (byte) 0xa7, + (byte) 0x6c, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x60, (byte) 0xa7, (byte) 0xb4, (byte) 0xad, (byte) 0xad, + (byte) 0xad, (byte) 0xb3, (byte) 0xb3, (byte) 0xd4, (byte) 0xd4, (byte) 0xb3, (byte) 0x8c, (byte) 0xb6, (byte) 0x07, (byte) 0xb6, (byte) 0x8c, + (byte) 0xb3, (byte) 0xd4, (byte) 0xb3, (byte) 0xb3, (byte) 0xad, (byte) 0xad, (byte) 0xad, (byte) 0xb4, (byte) 0xad, (byte) 0x66, (byte) 0x00, + (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x66, (byte) 0xae, (byte) 0xd5, (byte) 0xad, (byte) 0xd4, + (byte) 0xd4, (byte) 0xd5, (byte) 0xd5, (byte) 0xd5, (byte) 0xdb, (byte) 0xb4, (byte) 0xb4, (byte) 0xb4, (byte) 0xb4, (byte) 0xb4, (byte) 0xd5, + (byte) 0xd5, (byte) 0xd5, (byte) 0xd4, (byte) 0xd4, (byte) 0xad, (byte) 0xd5, (byte) 0xb4, (byte) 0x0e, (byte) 0x06, (byte) 0x06, (byte) 0x06, + (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x0b, (byte) 0xae, (byte) 0xdb, (byte) 0xd4, (byte) 0xd5, + (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, + (byte) 0xdb, (byte) 0xd5, (byte) 0xd4, (byte) 0xdb, (byte) 0xb4, (byte) 0x66, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, + (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x0e, (byte) 0xae, (byte) 0xdc, (byte) 0xdb, (byte) 0xdb, + (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdc, (byte) 0xdc, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, (byte) 0xdb, + (byte) 0xdb, (byte) 0xdc, (byte) 0xb4, (byte) 0x66, (byte) 0x6c, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x0b, (byte) 0xae, (byte) 0xdc, (byte) 0xe9, (byte) 0xdc, + (byte) 0xdc, (byte) 0xdc, (byte) 0xdc, (byte) 0xdc, (byte) 0xdc, (byte) 0xdc, (byte) 0xdc, (byte) 0xdc, (byte) 0xdc, (byte) 0xe9, (byte) 0xe9, + (byte) 0xb4, (byte) 0x0e, (byte) 0x00, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, + (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xf8, (byte) 0x0e, (byte) 0x66, (byte) 0xb4, (byte) 0xdc, (byte) 0xe2, + (byte) 0xe2, (byte) 0xe2, (byte) 0xe2, (byte) 0xe2, (byte) 0xe2, (byte) 0xe2, (byte) 0xe2, (byte) 0xdd, (byte) 0xb4, (byte) 0xa7, (byte) 0x16, + (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x04, (byte) 0x06, + (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x60, (byte) 0x0e, (byte) 0x60, (byte) 0x8c, (byte) 0xb4, + (byte) 0xb5, (byte) 0xdc, (byte) 0xdc, (byte) 0xbb, (byte) 0xb4, (byte) 0x8c, (byte) 0x66, (byte) 0x0b, (byte) 0x6c, (byte) 0x04, (byte) 0x06, + (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x04, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x06, (byte) 0x06, (byte) 0xed, + (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xec, (byte) 0x6c, (byte) 0x0e, (byte) 0x0e, + (byte) 0x44, (byte) 0x0e, (byte) 0x0e, (byte) 0x0e, (byte) 0x13, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, + (byte) 0x06, (byte) 0xed, (byte) 0x06, (byte) 0x06, (byte) 0x06, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 }); + ByteBuffer dest = new AssertingByteBuffer(flipRawImage(flippedImage, width, height, bpp).data); + + rleDecompress(src, dest, width, height, depth); + + } + + if (true) { + // 32x32@16 + int width = 32, height = 32, depth = 16; + + ByteBuffer src = new ByteBuffer(new byte[] { (byte) 0x85, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x06, (byte) 0x8b, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x06, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0x16, (byte) 0x69, (byte) 0x99, (byte) 0xd6, (byte) 0x06, (byte) 0x69, (byte) 0x99, + (byte) 0xd6, (byte) 0x04, (byte) 0xcc, (byte) 0x89, (byte) 0x52, (byte) 0x03, (byte) 0x6e, (byte) 0xff, (byte) 0xff, (byte) 0x02, (byte) 0x6e, + (byte) 0x08, (byte) 0x42, (byte) 0x01, (byte) 0x70, (byte) 0x08, (byte) 0x42, (byte) 0x71, (byte) 0xff, (byte) 0xff, (byte) 0xce, (byte) 0x18, + (byte) 0xc6, (byte) 0x01, (byte) 0x81, (byte) 0x08, (byte) 0x42, (byte) 0xce, (byte) 0x66, (byte) 0x29, (byte) 0x02, (byte) 0xcd, (byte) 0x89, + (byte) 0x52, (byte) 0x03, (byte) 0x88, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xd8, (byte) 0x99, (byte) 0xd6, + (byte) 0x03, (byte) 0xf8, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xf0, (byte) 0x66, (byte) 0x99, (byte) 0xd6, + (byte) 0x05, (byte) 0x6a, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0xc4, (byte) 0xcc, (byte) 0x89, (byte) 0x52, (byte) 0x03, (byte) 0x6e, + (byte) 0xff, (byte) 0xff, (byte) 0x02, (byte) 0x6e, (byte) 0x08, (byte) 0x42, (byte) 0x01, (byte) 0x70, (byte) 0x08, (byte) 0x42, (byte) 0x71, + (byte) 0xff, (byte) 0xff, (byte) 0xce, (byte) 0x18, (byte) 0xc6, (byte) 0x01, (byte) 0x81, (byte) 0x08, (byte) 0x42, (byte) 0xce, (byte) 0x66, + (byte) 0x29, (byte) 0x02, (byte) 0xcd, (byte) 0x89, (byte) 0x52, (byte) 0x03, (byte) 0x00, (byte) 0x04, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0xc3, (byte) 0x80, (byte) 0x61, (byte) 0x00, (byte) 0xa5, (byte) 0x80, (byte) 0x40, (byte) 0xec, (byte) 0x52, (byte) 0x00, (byte) 0x5a, + (byte) 0x00, (byte) 0x2d, (byte) 0x00, (byte) 0x24, (byte) 0x00, (byte) 0x12, (byte) 0x00, (byte) 0x24, (byte) 0x00, (byte) 0x12, (byte) 0x00, + (byte) 0x5a, (byte) 0x00, (byte) 0x2d, (byte) 0x00, (byte) 0xa5, (byte) 0x80, (byte) 0x52, (byte) 0x00, (byte) 0xc3, (byte) 0x80, (byte) 0x61, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xcc, (byte) 0x89, (byte) 0x52, (byte) 0x03, (byte) 0x6e, (byte) 0xff, + (byte) 0xff, (byte) 0x02, (byte) 0xcb, (byte) 0x18, (byte) 0xc6, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0xff, (byte) 0xff, }); + + ByteBuffer dest = new AssertingByteBuffer(new byte[] { (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, + (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, + (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, + (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0xff, (byte) 0xff, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, + (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, + (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, + (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, + (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, + (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, + (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, + (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x99, + (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0xff, + (byte) 0xff, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, + (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, + (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, + (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, + (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, + (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, + (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x99, (byte) 0xd6, (byte) 0x10, (byte) 0x84, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, + (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, + (byte) 0x10, (byte) 0x84, (byte) 0x10, (byte) 0x84, (byte) 0x99, (byte) 0xd6, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, + (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, + (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, + (byte) 0x08, (byte) 0x42, (byte) 0x08, (byte) 0x42, (byte) 0xff, (byte) 0xff, }); + + rleDecompress(src, dest, width, height, depth); + + } + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpClient.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpClient.java new file mode 100644 index 00000000000..cc8d1f16acc --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpClient.java @@ -0,0 +1,214 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.PipelineImpl; +import streamer.Queue; + +import common.AwtCanvasAdapter; +import common.AwtKeyEventSource; +import common.AwtMouseEventSource; +import common.BufferedImageCanvas; +import common.ScreenDescription; + +public class RdpClient extends PipelineImpl { + + /** + * Name of last OneTimePacket in handshake sequence. + */ + private static final String HANDSHAKE_END = "server_valid_client"; + + public RdpClient(String id, String userName, ScreenDescription screen, BufferedImageCanvas canvas) { + super(id); + assembleRDPPipeline(userName, screen, canvas); + } + +// /* DEBUG */ +// @Override +// protected HashMap initElementMap(String id) { +// HashMap map = new HashMap(); +// map.put("IN", new ServerPacketSniffer("server <")); +// map.put("OUT", new ClientPacketSniffer("> client")); +// return map; +// } + + private void assembleRDPPipeline(String userName, ScreenDescription screen, BufferedImageCanvas canvas) { + // + // Handshake chain + // + + RdpState state = new RdpState(); + int[] channelsToJoin = new int[] { RdpConstants.CHANNEL_RDPRDR, RdpConstants.CHANNEL_IO }; + + // Add elements + + add( + + new ClientX224ConnectionRequestPDU("client_connection_req", userName), new ServerX224ConnectionConfirmPDU("server_connection_conf"), + + new UpgradeSocketToSSL("upgrade_to_ssl"), + + new ClientMCSConnectInitial("client_initial_conference_create"), new ServerMCSConnectResponse("server_initial_conference_create"), + + new ClientMCSErectDomainRequest("client_erect_domain"), + + new ClientMCSAttachUserRequest("client_atach_user"), new ServerMCSAttachUserConfirmPDU("server_atach_user_confirm", state), + + new ClientMCSChannelJoinRequest_ServerMCSChannelConfirmPDUs("client_channel_join_rdprdr", channelsToJoin, state), + + new ClientInfoPDU("client_info_req", userName), + + new ServerLicenseErrorPDUValidClient("server_valid_client"), + + new ServerFastPath("server_fastpath"), + + new ServerTpkt("server_tpkt"), + + new ServerX224DataPdu("server_x224_data"), + + // These TPKT and X224 wrappers are connected directly to OUT for handshake + // sequence + new ClientTpkt("client_tpkt_ot"), + + new ClientX224DataPdu("client_x224_data_ot") + + ); + + // Handshake sequence (via SlowPath) + link("IN", + + "server_fastpath >tpkt", "server_tpkt", + + "client_connection_req", "server_connection_conf", + + "upgrade_to_ssl", + + "client_initial_conference_create", "server_initial_conference_create", + + "client_erect_domain", + + "server_x224_data", + + "client_atach_user", "server_atach_user_confirm", + + "client_channel_join_rdprdr", + + "client_info_req", + + "server_valid_client" + + ); + + // Chain for direct handshake responses (without involving of queue) + link("client_x224_data_ot", "client_tpkt_ot", "client_tpkt_ot< OUT"); + + // Connect one time outputs to client TPKT input + String tpkt_peers[] = new String[] { "client_connection_req", "server_connection_conf", "upgrade_to_ssl", "client_x224_data_ot" }; + for (String element : tpkt_peers) { + link(element + " >otout", element + "< client_tpkt_ot"); + } + + // Connect one time outputs to client X224 input + String x224_peers[] = new String[] { "client_initial_conference_create", "server_initial_conference_create", "client_erect_domain", "client_atach_user", + "server_atach_user_confirm", "client_channel_join_rdprdr", "client_info_req", "server_valid_client" }; + for (String element : x224_peers) { + link(element + " >otout", element + "< client_x224_data_ot"); + } + + // + // Transition + // + + add( + // To transfer packets between input threads and output thread. + new Queue("queue"), + + // Slow path: MultiChannel Support + new ServerMCSPDU("server_mcs") + + ); + + // Last element of handshake sequence will wake up queue and and socket + // output pull loop, which will switch links, between socket output and + // queue, from push mode to pull mode. + link(HANDSHAKE_END + " >queue", "queue", "OUT"); + + // Transition from handshake sequence for slow path packets + link(HANDSHAKE_END, "server_mcs"); + + // + // Main network + // + + AwtMouseEventSource mouseEventSource = new AwtMouseEventSource("mouse"); + AwtKeyEventSource keyEventSource = new AwtKeyEventSource("keyboard"); + + // Subscribe packet sender to various events + canvas.addMouseListener(mouseEventSource); + canvas.addMouseMotionListener(mouseEventSource); + canvas.addKeyListener(keyEventSource); + + // Add elements + add( + + new ServerChannel1003Router("server_channel_1003", state), + + new ServerDemandActivePDU("server_demand_active", screen, state), + + new ClientConfirmActivePDU("client_confirm_active", screen, state), + + new ServerBitmapUpdate("server_bitmap_update"), + + new AwtCanvasAdapter("canvas_adapter", canvas, screen), + + new ServerPaletteUpdate("server_palette", screen), + + keyEventSource, new AwtRdpKeyboardAdapter("keyboard_adapter"), + + mouseEventSource, new AwtRdpMouseAdapter("mouse_adapter"), + + // These FastPath, TPKT, and X224 wrappers are connected to queue + new ClientTpkt("client_tpkt_queue"), + + new ClientX224DataPdu("client_x224_data_queue"), + + new ClientFastPathPDU("client_fastpath_queue")); + + // Server packet handlers + link("server_mcs >channel_1003", "server_channel_1003"); + link("server_fastpath >bitmap", "fastpath< server_bitmap_update", "server_bitmap_update< canvas_adapter"); + link("server_channel_1003 >bitmap", "slowpath< server_bitmap_update"); + + link("server_fastpath >palette", "fastpath< server_palette"); + link("server_channel_1003 >palette", "slowpath< server_palette"); + + link("server_channel_1003 >demand_active", "slowpath< server_demand_active"); + // link("server_demand_active >confirm_active", "client_confirm_active", + // "confirm_active< client_channel_1003"); + link("server_demand_active >confirm_active", "client_confirm_active", "confirm_active< client_x224_data_queue"); + + // Link mouse and keyboard to socket via adapters and send them using + // FastPath protocol + link(mouseEventSource.getId(), "mouse_adapter", "mouse_adapter< client_fastpath_queue"); + link(keyEventSource.getId(), "keyboard_adapter", "keyboard_adapter< client_fastpath_queue"); + + // Link packet wrappers to outgoing queue + link("client_fastpath_queue", "client_fastpath_queue< queue"); + link("client_x224_data_queue", "client_tpkt_queue", "client_tpkt_queue< queue"); + + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpConstants.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpConstants.java new file mode 100644 index 00000000000..1e3646a9ac4 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpConstants.java @@ -0,0 +1,74 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import java.nio.charset.Charset; + +public interface RdpConstants { + + /** + * Default charset to use when communicating with server using 8 bit strings. + */ + public static final Charset CHARSET_8 = Charset.availableCharsets().get("US-ASCII"); + + /** + * Default charset to use when communicating with server using 16 bit strings. + */ + public static final Charset CHARSET_16 = Charset.availableCharsets().get("UTF-16LE"); + + + /** + * Negotiate SSL protocol to use to protect RDP connection. + * @see http://msdn.microsoft.com/en-us/library/cc240500.aspx + */ + public static final int RDP_NEG_REQ_PROTOCOL_SSL = 1; + + /** + * Negotiate CredSSP protocol to use to protect RDP connection. + * @see http://msdn.microsoft.com/en-us/library/cc240500.aspx + * When used, client must set @see RDP_NEG_REQ_PROTOCOL_SSL too. + */ + public static final int RDP_NEG_REQ_PROTOCOL_HYBRID = 2; + + /** + * RDP negotiation: flags (not used, always 0). + */ + public static final int RDP_NEG_REQ_FLAGS = 0; + + /** + * RDP Negotiation: request. + */ + public static final int RDP_NEG_REQ_TYPE_NEG_REQ = 1; + + /** + * RDP Negotiation: response. + */ + public static final int RDP_NEG_REQ_TYPE_NEG_RSP = 2; + + /** + * RDP Negotiation: failure. + */ + public static final int RDP_NEG_REQ_TYPE_NEG_FAILURE = 3; + + + public static final int CHANNEL_IO = 1003; + + public static final int CHANNEL_RDPRDR = 1004; + + + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpState.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpState.java new file mode 100644 index 00000000000..c85972de7da --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/RdpState.java @@ -0,0 +1,33 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import java.util.HashSet; +import java.util.Set; + +public class RdpState { + + public long serverShareId; + public int serverUserChannelId; + + public Set channels=new HashSet(); + + public void channelJoined(int actualChannel) { + channels.add(actualChannel); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerBitmapUpdate.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerBitmapUpdate.java new file mode 100644 index 00000000000..0e5b79aff28 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerBitmapUpdate.java @@ -0,0 +1,201 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import common.BitmapOrder; +import common.BitmapRectangle; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.FakeSink; +import streamer.Link; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240624.aspx + */ +public class ServerBitmapUpdate extends BaseElement { + public static final int UPDATETYPE_BITMAP = 0x0001; + + /** + * Indicates that the bitmap data is compressed. The bitmapComprHdr field MUST + * be present if the NO_BITMAP_COMPRESSION_HDR (0x0400) flag is not set. + */ + public static final int BITMAP_COMPRESSION = 0x0001; + + /** + * Indicates that the bitmapComprHdr field is not present (removed for + * bandwidth efficiency to save 8 bytes). + */ + private static final int NO_BITMAP_COMPRESSION_HDR = 0x0400; + + public ServerBitmapUpdate(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // * DEBUG */System.out.println(buf.toHexString(buf.length)); + + BitmapOrder order = new BitmapOrder(); + + // (2 bytes): A 16-bit, unsigned integer. The update type. This field MUST + // be set to UPDATETYPE_BITMAP (0x0001). + int updateType = buf.readSignedShortLE(); + if (updateType != UPDATETYPE_BITMAP) + throw new RuntimeException("Unknown update type. Expected update type: UPDATETYPE_BITMAP (0x1). Actual update type: " + updateType + ", buf: " + buf + + "."); + + // (2 bytes): A 16-bit, unsigned integer. The number of screen rectangles + // present in the rectangles field. + int numberRectangles = buf.readSignedShortLE(); + + // (variable): Variable-length array of TS_BITMAP_DATA structures, each of + // which contains a rectangular clipping taken from the server-side screen + // frame buffer. The number of screen clippings in the array is specified by + // the numberRectangles field. + BitmapRectangle[] rectangles = new BitmapRectangle[numberRectangles]; + for (int i = 0; i < numberRectangles; i++) { + rectangles[i] = readRectangle(buf); + } + order.rectangles = rectangles; + + buf.assertThatBufferIsFullyRead(); + + ByteBuffer data = new ByteBuffer(0); + data.setOrder(order); + pushDataToAllOuts(data); + + buf.unref(); + } + + public BitmapRectangle readRectangle(ByteBuffer buf) { + + BitmapRectangle rectangle = new BitmapRectangle(); + + // (2 bytes): A 16-bit, unsigned integer. Left bound of the rectangle. + rectangle.x = buf.readSignedShortLE(); + + // (2 bytes): A 16-bit, unsigned integer. Top bound of the rectangle. + rectangle.y = buf.readSignedShortLE(); + + // (2 bytes): A 16-bit, unsigned integer. Inclusive right bound of the + // rectangle. + int destRight = buf.readSignedShortLE(); + rectangle.width=destRight-rectangle.x+1; + + // (2 bytes): A 16-bit, unsigned integer. Inclusive bottom bound of the + // rectangle. + int destBottom = buf.readSignedShortLE(); + rectangle.height=destBottom-rectangle.y+1; + + // (2 bytes): A 16-bit, unsigned integer. The width of the rectangle. + rectangle.bufferWidth = buf.readSignedShortLE(); + + // (2 bytes): A 16-bit, unsigned integer. The height of the rectangle. + rectangle.bufferHeight = buf.readSignedShortLE(); + + // (2 bytes): A 16-bit, unsigned integer. The color depth of the rectangle + // data in bits-per-pixel. + rectangle.colorDepth = buf.readSignedShortLE(); + + // (2 bytes): A 16-bit, unsigned integer. The flags describing the format of + // the bitmap data in the bitmapDataStream field. + int flags = buf.readSignedShortLE(); + + // BITMAP_COMPRESSION 0x0001 + // Indicates that the bitmap data is compressed. The bitmapComprHdr field + // MUST be present if the NO_BITMAP_COMPRESSION_HDR (0x0400) flag is not + // set. + boolean compressed=((flags & BITMAP_COMPRESSION) > 0); + + // (2 bytes): A 16-bit, unsigned integer. The size in bytes of the data in + // the bitmapComprHdr and bitmapDataStream fields. + int bitmapLength = buf.readSignedShortLE(); + + // NO_BITMAP_COMPRESSION_HDR 0x0400 + // Indicates that the bitmapComprHdr field is not present (removed for + // bandwidth efficiency to save 8 bytes). + if (compressed && (flags & NO_BITMAP_COMPRESSION_HDR) == 0) { + // (8 bytes): Optional Compressed Data Header structure specifying the + // bitmap data in the bitmapDataStream. + // This field MUST be present if the BITMAP_COMPRESSION (0x0001) flag is + // present in the Flags field, but the NO_BITMAP_COMPRESSION_HDR (0x0400) + // flag is not. + + // Note: Even when compression header is enabled, server sends nothing. + // rectangle.compressedBitmapHeader = buf.readBytes(8); + } + + // (variable): A variable-length array of bytes describing a bitmap image. + // Bitmap data is either compressed or uncompressed, depending on whether + // the BITMAP_COMPRESSION flag is present in the Flags field. Uncompressed + // bitmap data is formatted as a bottom-up, left-to-right series of pixels. + // Each pixel is a whole number of bytes. Each row contains a multiple of + // four bytes (including up to three bytes of padding, as necessary). + // Compressed bitmaps not in 32 bpp format are compressed using Interleaved + // RLE and encapsulated in an RLE Compressed Bitmap Stream structure, + // while compressed bitmaps at a color depth of 32 bpp are compressed + // using RDP 6.0 Bitmap Compression and stored inside + // an RDP 6.0 Bitmap Compressed Stream structure. + if (!compressed) { + rectangle.bitmapDataStream = buf.readBytes(bitmapLength); + } else { + ByteBuffer compressedImage = buf.readBytes(bitmapLength); + //* DEBUG */System.out.println("Compressed image: " + compressedImage + ", depth: " + rectangle.bitsPerPixel + "."); + rectangle.bitmapDataStream = RLEBitmapDecompression.rleDecompress(compressedImage, rectangle.bufferWidth, rectangle.bufferHeight, rectangle.colorDepth); + compressedImage.unref(); + } + + return rectangle; + } + + /** + * Example. + */ + public static void main(String args[]) { + ByteBuffer packet = new ByteBuffer(new byte[] { 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x00, + 0x01, 0x04, 0x0a, 0x00, 0x0c, (byte) 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }); + + Element bitmap = new ServerBitmapUpdate("bitmap") { + { + verbose = true; + } + }; + FakeSink fakeSink = new FakeSink("sink") { + { + verbose = true; + } + }; + Pipeline pipeline = new PipelineImpl("test"); + + // BufferedImageCanvas canvas = new BufferedImageCanvas(1024, 768); + // Element adapter = new AwtRdpAdapter("test",canvas ); + // pipeline.addAndLink(bitmap, adapter); + pipeline.addAndLink(bitmap, fakeSink); + + bitmap.handleData(packet, null); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerChannel1003Router.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerChannel1003Router.java new file mode 100644 index 00000000000..fdad522a269 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerChannel1003Router.java @@ -0,0 +1,530 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.Pipeline; +import streamer.PipelineImpl; + +public class ServerChannel1003Router extends BaseElement { + + /** + * Demand Active PDU. + */ + public static final int PDUTYPE_DEMANDACTIVEPDU = 0x1; + + /** + * Confirm Active PDU. + */ + public static final int PDUTYPE_CONFIRMACTIVEPDU = 0x3; + + /** + * Deactivate All PDU. + */ + public static final int PDUTYPE_DEACTIVATEALLPDU = 0x6; + + /** + * Data PDU (actual type is revealed by the pduType2 field in the Share Data + * Header). + */ + public static final int PDUTYPE_DATAPDU = 0x7; + + /** + * Enhanced Security Server Redirection PDU. + */ + public static final int PDUTYPE_SERVER_REDIR_PKT = 0xA; + + protected RdpState state; + + public ServerChannel1003Router(String id, RdpState state) { + super(id); + this.state=state; + } + + /** + * @see http://msdn.microsoft.com/en-us/library/cc240576.aspx + */ + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + int length = buf.readUnsignedShortLE(); + if(buf.length!=length) + { + // It is ServerErrorAlert-ValidClient + // Ignore it + //throw new RuntimeException("[" + this + "] ERROR: Incorrect PDU length: " + length + ", data: " + buf + "."); + } + + int type = buf.readUnsignedShortLE() & 0xf; + + // int sourceId = buf.readUnsignedShortLE(); + buf.skipBytes(2); + + switch (type) { + case PDUTYPE_DEMANDACTIVEPDU: + pushDataToPad("demand_active", buf); + break; + case PDUTYPE_CONFIRMACTIVEPDU: + throw new RuntimeException("Unexpected client CONFIRM ACTIVE PDU. Data: " + buf + "."); + case PDUTYPE_DEACTIVATEALLPDU: + // pushDataToPad("deactivate_all", buf); + /* ignore */buf.unref(); + break; + case PDUTYPE_DATAPDU: + handleDataPdu(buf); + break; + case PDUTYPE_SERVER_REDIR_PKT: + // pushDataToPad("server_redir", buf); + /* ignore */buf.unref(); + break; + default: + throw new RuntimeException("[" + this + "] ERROR: Unknown PDU type: " + type + ", data: " + buf + "."); + } + + } + + /** + * Graphics Update PDU. + */ + public static final int PDUTYPE2_UPDATE = 0x02; + + /** + * Control PDU. + */ + public static final int PDUTYPE2_CONTROL = 0x14; + + /** + * Pointer Update PDU. + */ + public static final int PDUTYPE2_POINTER = 0x1B; + + /** + * Input Event PDU. + */ + public static final int PDUTYPE2_INPUT = 0x1C; + + /** + * Synchronize PDU. + */ + public static final int PDUTYPE2_SYNCHRONIZE = 0x1F; + + /** + * Refresh Rect PDU. + */ + public static final int PDUTYPE2_REFRESH_RECT = 0x21; + + /** + * Play Sound PDU. + */ + public static final int PDUTYPE2_PLAY_SOUND = 0x22; + + /** + * Suppress Output PDU. + */ + public static final int PDUTYPE2_SUPPRESS_OUTPUT = 0x23; + + /** + * Shutdown Request PDU. + */ + public static final int PDUTYPE2_SHUTDOWN_REQUEST = 0x24; + + /** + * Shutdown Request Denied PDU. + */ + public static final int PDUTYPE2_SHUTDOWN_DENIED = 0x25; + + /** + * Save Session Info PDU. + */ + public static final int PDUTYPE2_SAVE_SESSION_INFO = 0x26; + + /** + * Font List PDU. + */ + public static final int PDUTYPE2_FONTLIST = 0x27; + + /** + * Font Map PDU. + */ + public static final int PDUTYPE2_FONTMAP = 0x28; + + /** + * Set Keyboard Indicators PDU. + */ + public static final int PDUTYPE2_SET_KEYBOARD_INDICATORS = 0x29; + + /** + * Persistent Key List PDU. + */ + public static final int PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST = 0x2B; + + /** + * Bitmap Cache Error PDU. + */ + public static final int PDUTYPE2_BITMAPCACHE_ERROR_PDU = 0x2C; + + /** + * Set Keyboard IME Status PDU. + */ + public static final int PDUTYPE2_SET_KEYBOARD_IME_STATUS = 0x2D; + + /** + * Offscreen Bitmap Cache Error PDU. + */ + public static final int PDUTYPE2_OFFSCRCACHE_ERROR_PDU = 0x2E; + + /** + * Set Error Info PDU. + */ + public static final int PDUTYPE2_SET_ERROR_INFO_PDU = 0x2F; + + /** + * DrawNineGrid Cache Error PDU. + */ + public static final int PDUTYPE2_DRAWNINEGRID_ERROR_PDU = 0x30; + + /** + * GDI+ Error PDU. + */ + public static final int PDUTYPE2_DRAWGDIPLUS_ERROR_PDU = 0x31; + + /** + * Auto-Reconnect Status PDU. + */ + public static final int PDUTYPE2_ARC_STATUS_PDU = 0x32; + + /** + * Status Info PDU. + */ + public static final int PDUTYPE2_STATUS_INFO_PDU = 0x36; + + /** + * Monitor Layout PDU. + */ + public static final int PDUTYPE2_MONITOR_LAYOUT_PDU = 0x37; + + /** + * Indicates an Orders Update. + */ + public static final int UPDATETYPE_ORDERS = 0x0000; + + /** + * Indicates a Bitmap Graphics Update. + */ + public static final int UPDATETYPE_BITMAP = 0x0001; + + /** + * Indicates a Palette Update. + */ + public static final int UPDATETYPE_PALETTE = 0x0002; + + /** + * Indicates a Synchronize Update. + */ + public static final int UPDATETYPE_SYNCHRONIZE = 0x0003; + + /** + * @see http://msdn.microsoft.com/en-us/library/cc240577.aspx + */ + protected void handleDataPdu(ByteBuffer buf) { + + // (4 bytes): A 32-bit, unsigned integer. Share identifier for the packet. + long shareId = buf.readUnsignedIntLE(); + if(shareId!=state.serverShareId) + throw new RuntimeException("Unexpected share ID: "+shareId+"."); +// buf.skipBytes(4); + + // Padding. + buf.skipBytes(1); + + // (1 byte): An 8-bit, unsigned integer. The stream identifier for the + // packet. + // int streamId = buf.readUnsignedByte(); + buf.skipBytes(1); + + // (2 bytes): A 16-bit, unsigned integer. The uncompressed length of the + // packet in bytes. + int uncompressedLength = buf.readUnsignedShortLE(); + + // (1 byte): An 8-bit, unsigned integer. The type of Data PDU. + int type2 = buf.readUnsignedByte(); + + // (1 byte): An 8-bit, unsigned integer. The compression type and flags + // specifying the data following the Share Data Header + int compressedType = buf.readUnsignedByte(); + if (compressedType != 0) + throw new RuntimeException("Compression of protocol packets is not supported. Data: " + buf + "."); + + // (2 bytes): A 16-bit, unsigned integer. The compressed length of the + // packet in bytes. + int compressedLength = buf.readUnsignedShortLE(); + if (compressedLength != 0) + throw new RuntimeException("Compression of protocol packets is not supported. Data: " + buf + "."); + + ByteBuffer data = buf.readBytes(uncompressedLength-18); + buf.unref(); + + switch (type2) { + + case PDUTYPE2_UPDATE: { + + // (2 bytes): A 16-bit, unsigned integer. Type of the graphics update. + int updateType = data.readUnsignedShortLE(); + ByteBuffer data2 = data.readBytes(data.length - data.cursor); + data.unref(); + + switch (updateType) { + case UPDATETYPE_ORDERS: + pushDataToPad("orders", data2); + break; + case UPDATETYPE_BITMAP: + pushDataToPad("bitmap", data2); + break; + case UPDATETYPE_PALETTE: + pushDataToPad("palette", data2); + break; + case UPDATETYPE_SYNCHRONIZE: + // Ignore + data2.unref(); + break; + } + + break; + } + case PDUTYPE2_CONTROL: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_CONTROL ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_POINTER: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_POINTER ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_INPUT: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_INPUT ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_SYNCHRONIZE: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_SYNCHRONIZE ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_REFRESH_RECT: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_REFRESH_RECT ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_PLAY_SOUND: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_PLAY_SOUND ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_SUPPRESS_OUTPUT: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_SUPPRESS_OUTPUT ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_SHUTDOWN_REQUEST: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_SHUTDOWN_REQUEST ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_SHUTDOWN_DENIED: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_SHUTDOWN_DENIED ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_SAVE_SESSION_INFO: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_SAVE_SESSION_INFO ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_FONTLIST: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_FONTLIST ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_FONTMAP: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_FONTMAP ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_SET_KEYBOARD_INDICATORS: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_SET_KEYBOARD_INDICATORS ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_BITMAPCACHE_ERROR_PDU: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_BITMAPCACHE_ERROR_PDU ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_SET_KEYBOARD_IME_STATUS: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_SET_KEYBOARD_IME_STATUS ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_OFFSCRCACHE_ERROR_PDU: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_OFFSCRCACHE_ERROR_PDU ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_SET_ERROR_INFO_PDU: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_SET_ERROR_INFO_PDU ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_DRAWNINEGRID_ERROR_PDU: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_DRAWNINEGRID_ERROR_PDU ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_DRAWGDIPLUS_ERROR_PDU: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_DRAWGDIPLUS_ERROR_PDU ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_ARC_STATUS_PDU: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_ARC_STATUS_PDU ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_STATUS_INFO_PDU: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_STATUS_INFO_PDU ignored."); + // Ignore + data.unref(); + break; + case PDUTYPE2_MONITOR_LAYOUT_PDU: + if (verbose) + System.out.println("[" + this + "] INFO: Packet PDUTYPE2_MONITOR_LAYOUT_PDU ignored."); + // Ignore + data.unref(); + break; + + default: + throw new RuntimeException("Unknow data PDU type: " + type2 + ", data: " + buf + "."); + } + } + + /** + * Example. + * + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + byte[] packet = new byte[] { + // TPKT + (byte) 0x03, (byte) 0x00, // TPKT Header: TPKT version = 3 + (byte) 0x00, (byte) 0x1B, // TPKT length: 27 bytes + + // X224 + (byte) 0x02, // X224 Length: 2 bytes + (byte) 0xF0, // X224 Type: Data + (byte) 0x80, // X224 EOT + + // MCS + // Type: send data indication: 26 (0x1a, top 6 bits) + (byte) 0x68, // ?? + + (byte) 0x00, (byte) 0x01, // User ID: 1002 (1001+1) + (byte) 0x03, (byte) 0xEB, // Channel ID: 1003 + (byte) 0x70, // Data priority: high, segmentation: begin|end + (byte) 0x0D, // Payload length: 13 bytes + + // Deactivate all PDU + (byte) 0x0D, (byte) 0x00, // Length: 13 bytes (LE) + + // - PDUType: (0x16, LE) + // Type: (............0110) TS_PDUTYPE_DEACTIVATEALLPDU + // ProtocolVersion: (000000000001....) 1 + (byte) 0x16, (byte) 0x00, + + (byte) 0xEA, (byte) 0x03, // PDU source: 1002 (LE) + (byte) 0xEA, (byte) 0x03, (byte) 0x01, (byte) 0x00, // ShareID = 66538 + + (byte) 0x01, (byte) 0x00, // Length if source descriptor: 1 (LE) + (byte) 0x00, // Source descriptor (should be set to 0): 0 + }; + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(packet)); + RdpState rdpState =new RdpState() {{serverShareId=66538;}}; + Element channel1003 = new ServerChannel1003Router("channel_1003", rdpState ); + Element mcs = new ServerMCSPDU("mcs"); + Element tpkt = new ServerTpkt("tpkt"); + Element x224 = new ServerX224DataPdu("x224"); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { + // Deactivate all PDU + (byte) 0x0D, (byte) 0x00, // Length: 13 bytes (LE) + + // - PDUType: 22 (0x16, LE) + // Type: (............0110) TS_PDUTYPE_DEACTIVATEALLPDU + // ProtocolVersion: (000000000001....) 1 + (byte) 0x16, (byte) 0x00, + + (byte) 0xEA, (byte) 0x03, // PDU source: 1002 (LE) + (byte) 0xEA, (byte) 0x03, (byte) 0x01, (byte) 0x00, // ShareID = 66538 + + (byte) 0x01, (byte) 0x00, // Length if source descriptor: 1 (LE) + (byte) 0x00, // Source descriptor (should be set to 0): 0 + })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, tpkt, x224, mcs, channel1003, sink); + pipeline.link("source", "tpkt", "x224", "mcs >channel_1003", "channel_1003 >deactivate_all", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerControlPDUCooperate.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerControlPDUCooperate.java new file mode 100644 index 00000000000..f2d3d368f00 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerControlPDUCooperate.java @@ -0,0 +1,117 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Link; +import streamer.OneTimeSwitch; + +public class ServerControlPDUCooperate extends OneTimeSwitch { + + public ServerControlPDUCooperate(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Ignore packet + buf.unref(); + switchOff(); + } + +} + +/* @formatter:off */ +/* +03 00 00 28 02 F0 80 68 00 01 03 EB 70 1A 1A 00 17 00 EA 03 EA 03 01 00 9A 02 1A 00 14 00 00 00 04 00 00 00 00 00 00 00 + + + Frame: Number = 38, Captured Frame Length = 97, MediaType = DecryptedPayloadHeader ++ DecryptedPayloadHeader: FrameCount = 1, ErrorStatus = SUCCESS + TLSSSLData: Transport Layer Security (TLS) Payload Data ++ TLS: TLS Rec Layer-1 SSL Application Data + ISOTS: TPKTCount = 1 +- TPKT: version: 3, Length: 40 + version: 3 (0x3) + Reserved: 0 (0x0) + PacketLength: 40 (0x28) +- X224: Data + Length: 2 (0x2) + Type: Data + EOT: 128 (0x80) +- T125: Data Packet + - MCSHeader: Type=Send Data Indication, UserID=1002, ChannelID=1003 + - Type: Send Data Indication + - RootIndex: 26 + Value: (011010..) 0x1a + - UserID: 0x3ea + - UserID: 0x3ea + - ChannelId: 1002 + - Align: No Padding + Padding2: (00......) 0x0 + Value: 1 (0x1) + - Channel: 0x3eb + - ChannelId: 1003 + Align: No Padding + Value: 1003 (0x3EB) + - DataPriority: high + - DataPriority: high + - RootIndex: 1 + Value: (01......) 0x1 + - Segmentation: Begin End + Begin: (1.......) Begin + End: (.1......) End + - Length: 26 + - Align: No Padding + Padding4: (0000....) 0x0 + Length: 26 + RDP: RDPBCGR +- RDPBCGR: TsControlPDU + - SlowPathPacket: TsControlPDU + - SlowPath: Type = TS_PDUTYPE_DATAPDU + - TsShareControlHeader: Type = TS_PDUTYPE_DATAPDU + TotalLength: 26 (0x1A) + - PDUType: 23 (0x17) + Type: (............0111) TS_PDUTYPE_DATAPDU + ProtocolVersion: (000000000001....) 1 + PDUSource: 1002 (0x3EA) + - SlowPathIoPacket: 0x0 + - ShareDataHeader: TS_PDUTYPE2_CONTROL + ShareID: 66538 (0x103EA) + Pad1: 154 (0x9A) + StreamID: TS_STREAM_MED + UncompressedLength: 26 (0x1A) + PDUType2: TS_PDUTYPE2_CONTROL + - CompressedType: Not Compressed + MPPC: (....0000) MPPC 8K + Reserved: (...0....) + Compressed: (..0.....) Not Compressed + Front: (.0......) Not At Front + Flush: (0.......) Not Flushed + CompressedLength: 0 (0x0) + - TsControlPDU: Action = Cooperate + Action: Cooperate + GrantID: 0 (0x0) + ControlID: 0 (0x0) + + */ diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerControlPDUGrantedControl.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerControlPDUGrantedControl.java new file mode 100644 index 00000000000..e050e8a8ae8 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerControlPDUGrantedControl.java @@ -0,0 +1,114 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Link; +import streamer.OneTimeSwitch; + +public class ServerControlPDUGrantedControl extends OneTimeSwitch { + + public ServerControlPDUGrantedControl(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Ignore packet + buf.unref(); + switchOff(); + } + +} +/* @formatter:off */ +/* +03 00 00 28 02 F0 80 68 00 01 03 EB 70 1A 1A 00 17 00 EA 03 EA 03 01 00 50 02 1A 00 14 00 00 00 02 00 EC 03 EA 03 00 00 + + Frame: Number = 45, Captured Frame Length = 97, MediaType = DecryptedPayloadHeader ++ DecryptedPayloadHeader: FrameCount = 1, ErrorStatus = SUCCESS + TLSSSLData: Transport Layer Security (TLS) Payload Data ++ TLS: TLS Rec Layer-1 SSL Application Data + ISOTS: TPKTCount = 1 +- TPKT: version: 3, Length: 40 + version: 3 (0x3) + Reserved: 0 (0x0) + PacketLength: 40 (0x28) +- X224: Data + Length: 2 (0x2) + Type: Data + EOT: 128 (0x80) +- T125: Data Packet + - MCSHeader: Type=Send Data Indication, UserID=1002, ChannelID=1003 + - Type: Send Data Indication + - RootIndex: 26 + Value: (011010..) 0x1a + - UserID: 0x3ea + - UserID: 0x3ea + - ChannelId: 1002 + - Align: No Padding + Padding2: (00......) 0x0 + Value: 1 (0x1) + - Channel: 0x3eb + - ChannelId: 1003 + Align: No Padding + Value: 1003 (0x3EB) + - DataPriority: high + - DataPriority: high + - RootIndex: 1 + Value: (01......) 0x1 + - Segmentation: Begin End + Begin: (1.......) Begin + End: (.1......) End + - Length: 26 + - Align: No Padding + Padding4: (0000....) 0x0 + Length: 26 + RDP: RDPBCGR +- RDPBCGR: TsControlPDU + - SlowPathPacket: TsControlPDU + - SlowPath: Type = TS_PDUTYPE_DATAPDU + - TsShareControlHeader: Type = TS_PDUTYPE_DATAPDU + TotalLength: 26 (0x1A) + - PDUType: 23 (0x17) + Type: (............0111) TS_PDUTYPE_DATAPDU + ProtocolVersion: (000000000001....) 1 + PDUSource: 1002 (0x3EA) + - SlowPathIoPacket: 0x0 + - ShareDataHeader: TS_PDUTYPE2_CONTROL + ShareID: 66538 (0x103EA) + Pad1: 80 (0x50) + StreamID: TS_STREAM_MED + UncompressedLength: 26 (0x1A) + PDUType2: TS_PDUTYPE2_CONTROL + - CompressedType: Not Compressed + MPPC: (....0000) MPPC 8K + Reserved: (...0....) + Compressed: (..0.....) Not Compressed + Front: (.0......) Not At Front + Flush: (0.......) Not Flushed + CompressedLength: 0 (0x0) + - TsControlPDU: Action = Granted Control + Action: Granted Control + GrantID: 1004 (0x3EC) + ControlID: 1002 (0x3EA) + */ diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerDemandActivePDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerDemandActivePDU.java new file mode 100644 index 00000000000..9ce87d31881 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerDemandActivePDU.java @@ -0,0 +1,661 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.FakeSink; +import streamer.Link; +import streamer.MockSource; +import streamer.Order; +import streamer.Pipeline; +import streamer.PipelineImpl; + +import common.ScreenDescription; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240669.aspx + * @see http://msdn.microsoft.com/en-us/library/cc240484.aspx + */ +public class ServerDemandActivePDU extends BaseElement { + + /** + * Demand Active PDU. + */ + public static final int PDUTYPE_DEMANDACTIVEPDU = 0x1; + + protected RdpState state; + protected ScreenDescription screen; + + public ServerDemandActivePDU(String id, ScreenDescription screen, RdpState state) { + super(id); + this.state = state; + this.screen = screen; + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Total length of packet + int length = buf.readSignedShortLE(); // Ignore + if (buf.length != length) + throw new RuntimeException("Incorrect length of packet. Length: " + length + ", data: " + buf + "."); + + int type = buf.readSignedShortLE() & 0xf; + if (type != PDUTYPE_DEMANDACTIVEPDU) + throw new RuntimeException("Unknown PDU type. Expected type: Demand Active PDU (0x1), actual tyoe: " + type + ", data: " + buf + "."); + + // TS_SHARECONTROLHEADER::pduSource = 0x03ea (1002) + int pduSource = buf.readSignedShortLE(); + if (pduSource != 1002) + throw new RuntimeException("Unexepcted source of demand active PDU. Expected source: 1002, actual source: " + pduSource + "."); + + // (4 bytes): A 32-bit, unsigned integer. The share identifier for the + // packet (see [T128] section 8.4.2 for more information regarding share + // IDs). + long shareId = buf.readUnsignedIntLE(); + state.serverShareId = shareId; + + // Ignore rest of server data because it is not used by this client. + // (2 bytes): A 16-bit, unsigned integer. The size in bytes of the + // sourceDescriptor field. + int lengthSourceDescriptor = buf.readUnsignedShortLE(); + + // (2 bytes): A 16-bit, unsigned integer. The combined size in bytes of the + // numberCapabilities, pad2Octets, and capabilitySets fields. + int lengthCombinedCapabilities = buf.readUnsignedShortLE(); + + // (variable): A variable-length array of bytes containing a source + // descriptor, + // ByteBuffer sourceDescriptor = buf.readBytes(lengthSourceDescriptor); + buf.skipBytes(lengthSourceDescriptor); + + // (variable): An array of Capability Set (section 2.2.1.13.1.1.1) + // structures. The number of capability sets is specified by the + // numberCapabilities field. + handleCapabiltySets(buf.readBytes(lengthCombinedCapabilities)); + + // (4 bytes): A 32-bit, unsigned integer. The session identifier. This field + // is ignored by the client. + buf.skipBytes(4); + + /* DEBUG */buf.assertThatBufferIsFullyRead(); + + buf.unref(); + + sendHandshakePackets(); + } + + /** + * General Capability Set + */ + public static final int CAPSTYPE_GENERAL = 0x0001; + /** + * Bitmap Capability Set + */ + public static final int CAPSTYPE_BITMAP = 0x0002; + /** + * Order Capability Set + */ + public static final int CAPSTYPE_ORDER = 0x0003; + /** + * Revision 1 Bitmap Cache Capability Set + */ + public static final int CAPSTYPE_BITMAPCACHE = 0x0004; + /** + * Control Capability Set + */ + public static final int CAPSTYPE_CONTROL = 0x0005; + /** + * Window Activation Capability Set + */ + public static final int CAPSTYPE_ACTIVATION = 0x0007; + /** + * Pointer Capability Set + */ + public static final int CAPSTYPE_POINTER = 0x0008; + /** + * Share Capability Set + */ + public static final int CAPSTYPE_SHARE = 0x0009; + /** + * Color Table Cache Capability Set + */ + public static final int CAPSTYPE_COLORCACHE = 0x000A; + /** + * Sound Capability Set + */ + public static final int CAPSTYPE_SOUND = 0x000C; + /** + * Input Capability Set + */ + public static final int CAPSTYPE_INPUT = 0x000D; + /** + * Font Capability Set + */ + public static final int CAPSTYPE_FONT = 0x000E; + /** + * Brush Capability Set + */ + public static final int CAPSTYPE_BRUSH = 0x000F; + /** + * Glyph Cache Capability Set + */ + public static final int CAPSTYPE_GLYPHCACHE = 0x0010; + /** + * Offscreen Bitmap Cache Capability Set + */ + public static final int CAPSTYPE_OFFSCREENCACHE = 0x0011; + /** + * Bitmap Cache Host Support Capability Set + */ + public static final int CAPSTYPE_BITMAPCACHE_HOSTSUPPORT = 0x0012; + /** + * Revision 2 Bitmap Cache Capability Set + */ + public static final int CAPSTYPE_BITMAPCACHE_REV2 = 0x0013; + /** + * Virtual Channel Capability Set + */ + public static final int CAPSTYPE_VIRTUALCHANNEL = 0x0014; + /** + * DrawNineGrid Cache Capability Set + */ + public static final int CAPSTYPE_DRAWNINEGRIDCACHE = 0x0015; + /** + * Draw GDI+ Cache Capability Set + */ + public static final int CAPSTYPE_DRAWGDIPLUS = 0x0016; + /** + * Remote Programs Capability Set + */ + public static final int CAPSTYPE_RAIL = 0x0017; + /** + * Window List Capability Set + */ + public static final int CAPSTYPE_WINDOW = 0x0018; + /** + * Desktop Composition Extension Capability Set + */ + public static final int CAPSETTYPE_COMPDESK = 0x0019; + /** + * Multifragment Update Capability Set + */ + public static final int CAPSETTYPE_MULTIFRAGMENTUPDATE = 0x001A; + /** + * Large Pointer Capability Set + */ + public static final int CAPSETTYPE_LARGE_POINTER = 0x001B; + /** + * Surface Commands Capability Set + */ + public static final int CAPSETTYPE_SURFACE_COMMANDS = 0x001C; + /** + * Bitmap Codecs Capability Set + */ + public static final int CAPSETTYPE_BITMAP_CODECS = 0x001D; + /** + * Frame Acknowledge Capability Set + */ + public static final int CAPSSETTYPE_FRAME_ACKNOWLEDGE = 0x001E; + + /** + * @see http://msdn.microsoft.com/en-us/library/cc240486.aspx + */ + protected void handleCapabiltySets(ByteBuffer buf) { + // (2 bytes): A 16-bit, unsigned integer. The number of capability sets + // included in the Demand Active PDU. + int numberCapabilities = buf.readSignedShortLE(); + + // (2 bytes): Padding. + buf.skipBytes(2); + + for (int i = 0; i < numberCapabilities; i++) { + // (2 bytes): A 16-bit, unsigned integer. The type identifier of the + // capability set. + int capabilitySetType = buf.readUnsignedShortLE(); + + // (2 bytes): A 16-bit, unsigned integer. The length in bytes of the + // capability data, including the size of the capabilitySetType and + // lengthCapability fields. + int lengthCapability = buf.readUnsignedShortLE(); + + // (variable): Capability set data which conforms to the structure of the + // type given by the capabilitySetType field. + ByteBuffer capabilityData = buf.readBytes(lengthCapability - 4); + + switch (capabilitySetType) { + case CAPSTYPE_GENERAL: + break; + case CAPSTYPE_BITMAP: + handleBitmapCapabilities(capabilityData); + break; + case CAPSTYPE_ORDER: + break; + case CAPSTYPE_BITMAPCACHE: + break; + case CAPSTYPE_CONTROL: + break; + case CAPSTYPE_ACTIVATION: + break; + case CAPSTYPE_POINTER: + break; + case CAPSTYPE_SHARE: + break; + case CAPSTYPE_COLORCACHE: + break; + case CAPSTYPE_SOUND: + break; + case CAPSTYPE_INPUT: + break; + case CAPSTYPE_FONT: + break; + case CAPSTYPE_BRUSH: + break; + case CAPSTYPE_GLYPHCACHE: + break; + case CAPSTYPE_OFFSCREENCACHE: + break; + case CAPSTYPE_BITMAPCACHE_HOSTSUPPORT: + break; + case CAPSTYPE_BITMAPCACHE_REV2: + break; + case CAPSTYPE_VIRTUALCHANNEL: + break; + case CAPSTYPE_DRAWNINEGRIDCACHE: + break; + case CAPSTYPE_DRAWGDIPLUS: + break; + case CAPSTYPE_RAIL: + break; + case CAPSTYPE_WINDOW: + break; + case CAPSETTYPE_COMPDESK: + break; + case CAPSETTYPE_MULTIFRAGMENTUPDATE: + break; + case CAPSETTYPE_LARGE_POINTER: + break; + case CAPSETTYPE_SURFACE_COMMANDS: + break; + case CAPSETTYPE_BITMAP_CODECS: + break; + case CAPSSETTYPE_FRAME_ACKNOWLEDGE: + break; + default: + // Ignore + break; + } + + capabilityData.unref(); + } + + // TODO + + buf.unref(); + } + + /** + * @see http://msdn.microsoft.com/en-us/library/cc240554.aspx + */ + protected void handleBitmapCapabilities(ByteBuffer buf) { + + // (2 bytes): A 16-bit, unsigned integer. The server MUST set this field to + // the color depth of the session, while the client SHOULD set this field to + // the color depth requested in the Client Core Data (section 2.2.1.3.2). + int preferredBitsPerPixel = buf.readUnsignedShortLE(); + screen.setPixelFormatRGBTrueColor(preferredBitsPerPixel); + + // receive1BitPerPixel (2 bytes): A 16-bit, unsigned integer. Indicates + // whether the client can receive 1 bpp. This field is ignored and SHOULD be + // set to TRUE (0x0001). + buf.skipBytes(2); + + // receive4BitsPerPixel(2 bytes): A 16-bit, unsigned integer. Indicates + // whether the client can receive 4 bpp. This field is ignored and SHOULD be + // set to TRUE (0x0001). + buf.skipBytes(2); + + // receive8BitsPerPixel (2 bytes): A 16-bit, unsigned integer. Indicates + // whether the client can receive 8 bpp. This field is ignored and SHOULD be + // set to TRUE (0x0001). + buf.skipBytes(2); + + // (2 bytes): A 16-bit, unsigned integer. The width of the desktop in the + // session. + int desktopWidth = buf.readUnsignedShortLE(); + + // (2 bytes): A 16-bit, unsigned integer. The height of the desktop in the + // session. + int desktopHeight = buf.readUnsignedShortLE(); + + screen.setFramebufferSize(desktopWidth, desktopHeight); + + // pad2octets (2 bytes): A 16-bit, unsigned integer. Padding. Values in this + // field MUST be ignored. + + // desktopResizeFlag (2 bytes): A 16-bit, unsigned integer. Indicates + // whether resizing the desktop by using a Deactivation-Reactivation + // Sequence is supported. + + // bitmapCompressionFlag (2 bytes): A 16-bit, unsigned integer. Indicates + // whether bitmap compression is supported. This field MUST be set to TRUE + // (0x0001) because support for compressed bitmaps is required for a + // connection to proceed. + + // highColorFlags (1 byte): An 8-bit, unsigned integer. Client support for + // 16 bpp color modes. This field is ignored and SHOULD be set to zero. + + // drawingFlags (1 byte): An 8-bit, unsigned integer. Flags describing + // support for 32 bpp bitmaps. + + // multipleRectangleSupport (2 bytes): A 16-bit, unsigned integer. Indicates + // whether the use of multiple bitmap rectangles is supported in the Bitmap + // Update (section 2.2.9.1.1.3.1.2). This field MUST be set to TRUE (0x0001) + // because multiple rectangle support is required for a connection to + // proceed. + + // pad2octetsB (2 bytes): A 16-bit, unsigned integer. Padding. Values in + // this field MUST be ignored. + } + + /** + * Send all client requests in one hop, to simplify logic. + */ + protected void sendHandshakePackets() { + // Send reactivation sequence in bulk + pushDataToPad("confirm_active", new ByteBuffer((Order) null)); + } + + /** + * Example. + * + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + /* @formatter:off */ + byte[] packet = new byte[] { + 0x67, 0x01, // TS_SHARECONTROLHEADER::totalLength = 0x0167 = 359 bytes + 0x11, 0x00, // TS_SHARECONTROLHEADER::pduType = 0x0011 0x0011 = 0x0010 | 0x0001 = TS_PROTOCOL_VERSION | PDUTYPE_DEMANDACTIVEPDU + + (byte) 0xea, 0x03, // TS_SHARECONTROLHEADER::pduSource = 0x03ea (1002) + + (byte) 0xea, 0x03, 0x01, 0x00, // TS_DEMAND_ACTIVE_PDU::shareId + 0x04, 0x00, // TS_DEMAND_ACTIVE_PDU::lengthSourceDescriptor = 4 bytes + 0x51, 0x01, // TS_DEMAND_ACTIVE_PDU::lengthCombinedCapabilities = 0x151 = 337 bytes + + 0x52, 0x44, 0x50, 0x00, // TS_DEMAND_ACTIVE_PDU::sourceDescriptor = "RDP" + + 0x0d, 0x00, // TS_DEMAND_ACTIVE_PDU::numberCapabilities = 13 + 0x00, 0x00, // TS_DEMAND_ACTIVE_PDU::pad2octets + + // Share Capability Set (8 bytes) + // 0x09, 0x00, 0x08, 0x00, (byte) 0xea, 0x03, (byte) 0xdc, (byte) 0xe2, + // + 0x09, 0x00, // TS_SHARE_CAPABILITYSET::capabilitySetType = CAPSTYPE_SHARE (9) + 0x08, 0x00, // TS_SHARE_CAPABILITYSET::lengthCapability = 8 bytes + (byte) 0xea, 0x03, // TS_SHARE_CAPABILITYSET::nodeID = 0x03ea (1002) + (byte) 0xdc, (byte) 0xe2, // TS_SHARE_CAPABILITYSET::pad2octets + + // General Capability Set (24 bytes) + // 0x01, 0x00, 0x18, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x04, + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, + // + 0x01, 0x00, // TS_GENERAL_CAPABILITYSET::capabilitySetType = CAPSTYPE_GENERAL (1) + 0x18, 0x00, // TS_GENERAL_CAPABILITYSET::lengthCapability = 24 bytes + + 0x01, 0x00, // TS_GENERAL_CAPABILITYSET::osMajorType = TS_OSMAJORTYPE_WINDOWS (1) + 0x03, 0x00, // TS_GENERAL_CAPABILITYSET::osMinorType = TS_OSMINORTYPE_WINDOWS_NT (3) + 0x00, 0x02, // TS_GENERAL_CAPABILITYSET::protocolVersion = TS_CAPS_PROTOCOLVERSION (0x0200) + 0x00, 0x00, // TS_GENERAL_CAPABILITYSET::pad2octetsA + 0x00, 0x00, // TS_GENERAL_CAPABILITYSET::generalCompressionTypes = 0 + 0x1d, 0x04, // TS_GENERAL_CAPABILITYSET::extraFlags = 0x041d = 0x0400 | 0x0010 | 0x0008 | 0x0004 | 0x0001 = NO_BITMAP_COMPRESSION_HDR | ENC_SALTED_CHECKSUM | AUTORECONNECT_SUPPORTED | LONG_CREDENTIALS_SUPPORTED | FASTPATH_OUTPUT_SUPPORTED + + 0x00, 0x00, // TS_GENERAL_CAPABILITYSET::updateCapabilityFlag = 0 + 0x00, 0x00, // TS_GENERAL_CAPABILITYSET::remoteUnshareFlag = 0 + 0x00, 0x00, // TS_GENERAL_CAPABILITYSET::generalCompressionLevel = 0 + 0x01, // TS_GENERAL_CAPABILITYSET::refreshRectSupport = TRUE + 0x01, // TS_GENERAL_CAPABILITYSET::suppressOutputSupport = TRUE + + // Virtual Channel Capability Set (8 bytes) + // 0x14, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, + // + 0x14, 0x00, // TS_VIRTUALCHANNEL_CAPABILITYSET::capabilitySetType = CAPSTYPE_VIRTUALCHANNEL (20) + 0x08, 0x00, // TS_VIRTUALCHANNEL_CAPABILITYSET::lengthCapability = 8 bytes + + 0x02, 0x00, 0x00, 0x00, // TS_VIRTUALCHANNEL_CAPABILITYSET::vccaps1 = 0x00000002 = VCCAPS_COMPR_CS_8K + + // DrawGdiPlus Capability Set (40 bytes) + // 0x16, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, (byte) 0xf6, 0x13, (byte) 0xf3, 0x01, 0x00, 0x00, 0x00, + // 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, (byte) 0x9c, (byte) 0xf6, 0x13, (byte) 0xf3, 0x61, (byte) 0xa6, (byte) 0x82, (byte) 0x80, + // 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, (byte) 0x91, (byte) 0xbf, + // + 0x16, 0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::capabilitySetType = CAPSTYPE_DRAWGDIPLUS (22) + 0x28, 0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::lengthCapability = 40 bytes + + 0x00, 0x00, 0x00, 0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusSupportLevel = TS_DRAW_GDIPLUS_DEFAULT (0) + 0x70, (byte) 0xf6, 0x13, (byte) 0xf3, // TS_DRAW_GDIPLUS_CAPABILITYSET::GdipVersion (not initialized by server) + 0x01, 0x00, 0x00, 0x00, // TS_DRAW_GDIPLUS_CAPABILITYSET::drawGdiplusCacheLevel = TS_DRAW_GDIPLUS_CACHE_LEVEL_ONE (1) + + 0x01, 0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipGraphicsCacheEntries (not initialized by server) + 0x00, 0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectBrushCacheEntries (not initialized by server) + 0x18, 0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectPenCacheEntries (not initialized by server) + 0x00, 0x00, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectImageCacheEntries (not initialized by server) + (byte) 0x9c, (byte) 0xf6, // TS_GDIPLUS_CACHE_ENTRIES::GdipObjectImageAttributesCacheEntries (not initialized by server) + + 0x13, (byte) 0xf3, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipGraphicsCacheChunkSize (not initialized by server) + 0x61, (byte) 0xa6, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectBrushCacheChunkSize (not initialized by server) + (byte) 0x82, (byte) 0x80, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectPenCacheChunkSize (not initialized by server) + 0x00, 0x00, // TS_GDIPLUS_CACHE_CHUNK_SIZE::GdipObjectImageAttributesCacheChunkSize (not initialized by server) + + 0x00, 0x00, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheChunkSize (not initialized by server) + 0x00, 0x50, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheTotalSize (not initialized by server) + (byte) 0x91, (byte) 0xbf, // TS_GDIPLUS_IMAGE_CACHE_PROPERTIES::GdipObjectImageCacheMaxSize (not initialized by server) + + // Font Capability Set (4 bytes) + // 0x0e, 0x00, 0x04, 0x00, + // + // Due to a bug, the TS_FONT_CAPABILITYSET capability set size is incorrectly set to 4 bytes (it must be 8 bytes). As a result of this bug, the fontSupportFlags and pad2octets fields are missing. + 0x0e, 0x00, // TS_FONT_CAPABILITYSET::capabilitySetType = CAPSTYPE_FONT (14) + 0x04, 0x00, // TS_FONT_CAPABILITYSET::lengthCapability = 4 bytes + + + // Bitmap Capability Set (28 bytes) + // 0x02, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, + // 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + // + 0x02, 0x00, // TS_BITMAP_CAPABILITYSET::capabilitySetType = CAPSTYPE_BITMAP (2) + 0x1c, 0x00, // TS_BITMAP_CAPABILITYSET::lengthCapability = 28 bytes + + 0x18, 0x00, // TS_BITMAP_CAPABILITYSET::preferredBitsPerPixel = 24 bpp + 0x01, 0x00, // TS_BITMAP_CAPABILITYSET::receive1BitPerPixel = TRUE + 0x01, 0x00, // TS_BITMAP_CAPABILITYSET::receive4BitsPerPixel = TRUE + 0x01, 0x00, // TS_BITMAP_CAPABILITYSET::receive8BitsPerPixel = TRUE + 0x00, 0x05, // TS_BITMAP_CAPABILITYSET::desktopWidth = 1280 pixels + 0x00, 0x04, // TS_BITMAP_CAPABILITYSET::desktopHeight = 1024 pixels + 0x00, 0x00, // TS_BITMAP_CAPABILITYSET::pad2octets + 0x01, 0x00, // TS_BITMAP_CAPABILITYSET::desktopResizeFlag = TRUE + 0x01, 0x00, // TS_BITMAP_CAPABILITYSET::bitmapCompressionFlag = TRUE + 0x00, // TS_BITMAP_CAPABILITYSET::highColorFlags = 0 + 0x00, // TS_BITMAP_CAPABILITYSET::pad1octet + 0x01, 0x00, // TS_BITMAP_CAPABILITYSET::multipleRectangleSupport = TRUE + 0x00, 0x00, // TS_BITMAP_CAPABILITYSET::pad2octetsB + + // Order Capability Set (88 bytes) + // 0x03, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // 0x00, 0x00, 0x00, 0x00, 0x40, 0x42, 0x0f, 0x00, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, + // 0x00, 0x00, 0x22, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, + // 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, + // 0x00, 0x00, 0x00, 0x00, (byte) 0xa1, 0x06, 0x00, 0x00, 0x40, 0x42, 0x0f, 0x00, 0x40, 0x42, 0x0f, 0x00, + // 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // + 0x03, 0x00, // TS_ORDER_CAPABILITYSET::capabilitySetType = CAPSTYPE_ORDER (3) + 0x58, 0x00, // TS_ORDER_CAPABILITYSET::lengthCapability = 88 bytes + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // TS_ORDER_CAPABILITYSET::terminalDescriptor = "" + 0x40, 0x42, 0x0f, 0x00, // TS_ORDER_CAPABILITYSET::pad4octetsA + + 0x01, 0x00, // TS_ORDER_CAPABILITYSET::desktopSaveXGranularity = 1 + 0x14, 0x00, // TS_ORDER_CAPABILITYSET::desktopSaveYGranularity = 20 + 0x00, 0x00, // TS_ORDER_CAPABILITYSET::pad2octetsA + 0x01, 0x00, // TS_ORDER_CAPABILITYSET::maximumOrderLevel = ORD_LEVEL_1_ORDERS (1) + 0x00, 0x00, // TS_ORDER_CAPABILITYSET::numberFonts = 0 + + 0x22, 0x00, // TS_ORDER_CAPABILITYSET::orderFlags = 0x0022 = 0x0020 | 0x0002 = COLORINDEXSUPPORT | NEGOTIATEORDERSUPPORT + + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_DSTBLT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_PATBLT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_SCRBLT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MEMBLT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MEM3BLT_INDEX] = TRUE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_ATEXTOUT_INDEX] = FALSE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_AEXTTEXTOUT_INDEX] = FALSE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_DRAWNINEGRID_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_LINETO_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTI_DRAWNINEGRID_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_OPAQUERECT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_SAVEBITMAP_INDEX] = TRUE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_WTEXTOUT_INDEX] = FALSE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MEMBLT_R2_INDEX] = FALSE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MEM3BLT_R2_INDEX] = FALSE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTIDSTBLT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTIPATBLT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTISCRBLT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_MULTIOPAQUERECT_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_FAST_INDEX_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_POLYGON_SC_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_POLYGON_CB_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_POLYLINE_INDEX] = TRUE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[23] = 0 + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_FAST_GLYPH_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_ELLIPSE_SC_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_ELLIPSE_CB_INDEX] = TRUE + 0x01, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_INDEX_INDEX] = TRUE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_WEXTTEXTOUT_INDEX] = FALSE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_WLONGTEXTOUT_INDEX] = FALSE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[TS_NEG_WLONGEXTTEXTOUT_INDEX] = FALSE + 0x00, // TS_ORDER_CAPABILITYSET::orderSupport[24] = 0 + + (byte) 0xa1, 0x06, // TS_ORDER_CAPABILITYSET::textFlags = 0x06a1 + + 0x00, 0x00, // TS_ORDER_CAPABILITYSET::pad2octetsB + 0x40, 0x42, 0x0f, 0x00, // TS_ORDER_CAPABILITYSET::pad4octetsB + + 0x40, 0x42, 0x0f, 0x00, // TS_ORDER_CAPABILITYSET::desktopSaveSize = 0xf4240 = 1000000 + 0x01, 0x00, // TS_ORDER_CAPABILITYSET::pad2octetsC + 0x00, 0x00, // TS_ORDER_CAPABILITYSET::pad2octetsD + 0x00, 0x00, // TS_ORDER_CAPABILITYSET::textANSICodePage + 0x00, 0x00, // TS_ORDER_CAPABILITYSET::pad2octetsE + + // Color Table Cache Capability Set (8 bytes) + // 0x0a, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x00, + // + 0x0a, 0x00, // TS_COLORTABLECACHE_CAPABILITYSET::capabilitySetType = CAPSTYPE_COLORCACHE (10) + 0x08, 0x00, // TS_COLORTABLECACHE_CAPABILITYSET::lengthCapability = 8 bytes + + 0x06, 0x00, // TS_COLORTABLECACHE_CAPABILITYSET::colorTableCacheSize = 6 + 0x00, 0x00, // TS_COLORTABLECACHE_CAPABILITYSET::pad2octets + + // Bitmap Cache Host Support Capability Set (8 bytes) + // 0x12, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, + // + 0x12, 0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::capabilitySetType = CAPSTYPE_BITMAPCACHE_HOSTSUPPORT (18) + 0x08, 0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::lengthCapability = 8 bytes + + 0x01, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::CacheVersion = 1 (corresponds to rev. 2 capabilities) + 0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::Pad1 + 0x00, 0x00, // TS_BITMAPCACHE_CAPABILITYSET_HOSTSUPPORT::Pad2 + + // Pointer Capability Set (10 bytes) + // 0x08, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x19, 0x00, 0x19, 0x00, + // + 0x08, 0x00, // TS_POINTER_CAPABILITYSET::capabilitySetType = CAPSTYPE_POINTER (8) + 0x0a, 0x00, // TS_POINTER_CAPABILITYSET::lengthCapability = 10 bytes + + 0x01, 0x00, // TS_POINTER_CAPABILITYSET::colorPointerFlag = TRUE + 0x19, 0x00, // TS_POINTER_CAPABILITYSET::colorPointerCacheSize = 25 + 0x19, 0x00, // TS_POINTER_CAPABILITYSET::pointerCacheSize = 25 + + // Input Capability Set (88 bytes) + // 0x0d, 0x00, 0x58, 0x00, 0x35, 0x00, 0x00, 0x00, (byte) 0xa1, 0x06, 0x00, 0x00, 0x40, 0x42, 0x0f, 0x00, + // 0x0c, (byte) 0xf6, 0x13, (byte) 0xf3, (byte) 0x93, 0x5a, 0x37, (byte) 0xf3, 0x00, (byte) 0x90, 0x30, (byte) 0xe1, 0x34, 0x1c, 0x38, (byte) 0xf3, + // 0x40, (byte) 0xf6, 0x13, (byte) 0xf3, 0x04, 0x00, 0x00, 0x00, 0x4c, 0x54, (byte) 0xdc, (byte) 0xe2, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, + // 0x01, 0x00, 0x00, 0x00, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, 0x00, 0x00, 0x00, 0x00, 0x38, (byte) 0xf6, 0x13, (byte) 0xf3, + // 0x2e, 0x05, 0x38, (byte) 0xf3, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, 0x2c, (byte) 0xf6, 0x13, (byte) 0xf3, 0x00, 0x00, 0x00, 0x00, + // 0x08, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x19, 0x00, + // + 0x0d, 0x00, // TS_INPUT_CAPABILITYSET::capabilitySetType = CAPSTYPE_INPUT (13) + 0x58, 0x00, // TS_INPUT_CAPABILITYSET::lengthCapability = 88 bytes + + 0x35, 0x00, // TS_INPUT_CAPABILITYSET::inputFlags = 0x0035 = 0x0020 | 0x0010 | 0x0004 | 0x0001 = INPUT_FLAG_FASTPATH_INPUT2 | INPUT_FLAG_VKPACKET | INPUT_FLAG_MOUSEX | INPUT_FLAG_SCANCODES + + 0x00, 0x00, // TS_INPUT_CAPABILITYSET::pad2octetsA + (byte) 0xa1, 0x06, 0x00, 0x00, // TS_INPUT_CAPABILITYSET::keyboardLayout (not initialized by server) + 0x40, 0x42, 0x0f, 0x00, // TS_INPUT_CAPABILITYSET::keyboardType (not initialized by server) + 0x0c, (byte) 0xf6, 0x13, (byte) 0xf3, // TS_INPUT_CAPABILITYSET::keyboardSubType (not initialized by server) + (byte) 0x93, 0x5a, 0x37, (byte) 0xf3, // TS_INPUT_CAPABILITYSET::keyboardFunctionKey (not initialized by server) + + // TS_INPUT_CAPABILITYSET::imeFileName (not initialized by server) + 0x00, (byte) 0x90, 0x30, (byte) 0xe1, 0x34, 0x1c, 0x38, (byte) 0xf3, 0x40, (byte) 0xf6, 0x13, (byte) 0xf3, 0x04, 0x00, 0x00, 0x00, + 0x4c, 0x54, (byte) 0xdc, (byte) 0xe2, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, 0x01, 0x00, 0x00, 0x00, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, + 0x00, 0x00, 0x00, 0x00, 0x38, (byte) 0xf6, 0x13, (byte) 0xf3, 0x2e, 0x05, 0x38, (byte) 0xf3, 0x08, 0x50, (byte) 0xdc, (byte) 0xe2, + 0x2c, (byte) 0xf6, 0x13, (byte) 0xf3, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x19, 0x00, + + // RAIL Capability Set (8 bytes) + // 0x17, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + // + 0x17, 0x00, // TS_RAIL_CAPABILITYSET::capabilitySetType = CAPSTYPE_RAIL (23) + 0x08, 0x00, // TS_RAIL_CAPABILITYSET::lengthCapability = 8 bytes + + 0x00, 0x00, 0x00, 0x00, // TS_RAIL_CAPABILITYSET::railSupportLevel = TS_RAIL_LEVEL_DEFAULT (0) + + // Windowing Capability Set (11 bytes) + // 0x18, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // + 0x18, 0x00, // TS_WINDOW_CAPABILITYSET::capabilitySetType = CAPSTYPE_WINDOW (24) + 0x0b, 0x00, // TS_WINDOW_CAPABILITYSET::lengthCapability = 11 bytes + + 0x00, 0x00, 0x00, 0x00, // TS_WINDOW_CAPABILITYSET::wndSupportLevel = TS_WINDOW_LEVEL_DEFAULT (0) + 0x00, // TS_WINDOW_CAPABILITYSET::nIconCaches = 0 + 0x00, 0x00, // TS_WINDOW_CAPABILITYSET::nIconCacheEntries = 0 + + // Remainder of Demand Active PDU: + + 0x00, 0x00, 0x00, 0x00, // TS_DEMAND_ACTIVE_PDU::sessionId = 0 + }; + /* @formatter:on */ + + RdpState rdpState = new RdpState(); + ScreenDescription screenDescription = new ScreenDescription(); + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(packet)); + Element demandActive = new ServerDemandActivePDU("demand_active", screenDescription, rdpState); + Element sink = new FakeSink("sink"); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, demandActive, sink); + pipeline.link("source", "demand_active", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerFastPath.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerFastPath.java new file mode 100644 index 00000000000..fbec1cea7aa --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerFastPath.java @@ -0,0 +1,259 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240621.aspx + */ +public class ServerFastPath extends BaseElement { + + /** + * TPKT protocol version (first byte). + */ + public static final int PROTOCOL_TPKT = 3; + + /** + * Fast path protocol version (first two bits of first byte). + */ + public static final int PROTOCOL_FASTPATH = 0; + + + /** + * TPKT packets will be pushed to that pad. + */ + public static final String TPKT_PAD = "tpkt"; + + private static final String ORDERS_PAD = "orders"; + private static final String BITMAP_PAD = "bitmap"; + private static final String PALETTE_PAD = "palette"; + + /** + * Indicates that packet contains 8 byte secure checksum at top of packet. Top + * two bits of first byte. + */ + public static final int FASTPATH_OUTPUT_SECURE_CHECKSUM = 1; + + /** + * Indicates that packet contains 8 byte secure checksum at top of packet and + * packet content is encrypted. Top two bits of first byte. + */ + public static final int FASTPATH_OUTPUT_ENCRYPTED = 2; + + public static final int FASTPATH_UPDATETYPE_ORDERS = 0; + public static final int FASTPATH_UPDATETYPE_BITMAP = 1; + public static final int FASTPATH_UPDATETYPE_PALETTE = 2; + public static final int FASTPATH_UPDATETYPE_SYNCHRONIZE = 3; + public static final int FASTPATH_UPDATETYPE_SURFCMDS = 4; + public static final int FASTPATH_UPDATETYPE_PTR_NULL = 5; + public static final int FASTPATH_UPDATETYPE_PTR_DEFAULT = 6; + public static final int FASTPATH_UPDATETYPE_PTR_POSITION = 8; + public static final int FASTPATH_UPDATETYPE_COLOR = 9; + public static final int FASTPATH_UPDATETYPE_CACHED = 0xa; + public static final int FASTPATH_UPDATETYPE_POINTER = 0xb; + + public static final int FASTPATH_FRAGMENT_SINGLE = 0; + public static final int FASTPATH_FRAGMENT_LAST = 1; + public static final int FASTPATH_FRAGMENT_FIRST = 2; + public static final int FASTPATH_FRAGMENT_NEXT = 3; + + public static final int FASTPATH_OUTPUT_COMPRESSION_USED = 2; + + public ServerFastPath(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + //* DEBUG */System.out.println(buf.toHexString(buf.length)); + + // We need at 4 bytes to read packet type (TPKT or FastPath) and packet + // length + if (!cap(buf, 4, UNLIMITED, link, false)) + return; + + int typeAndFlags = buf.readUnsignedByte(); + + if (typeAndFlags == PROTOCOL_TPKT) { + // + // TPKT + // + + // Reserved + buf.skipBytes(1); + + // Read TPKT length + int length = buf.readUnsignedShort(); + + if (!cap(buf, length, length, link, false)) + // Wait for full packet to arrive + return; + + pushDataToPad(TPKT_PAD, buf); + + // TPKT is handled + return; + } + + // + // FastPath + // + // Number of bytes in updateData field (including header (1+1 or 2 + // bytes)) + int length = buf.readVariableUnsignedShort(); + + // Length is the size of payload, so we need to calculate from cursor + if (!cap(buf, length, length, link, false)) + // Wait for full packet to arrive + return; + + int type = typeAndFlags & 0x3; + int securityFlags = (typeAndFlags >> 6) & 0x3; + + // Assertions + { + if (type != PROTOCOL_FASTPATH) + throw new RuntimeException("Unknown protocol. Expected protocol: 0 (FastPath). Actual protocol: " + type + ", data: " + buf + "."); + + switch (securityFlags) { + case FASTPATH_OUTPUT_SECURE_CHECKSUM: + // TODO + throw new RuntimeException("Secure checksum is not supported in FastPath packets."); + case FASTPATH_OUTPUT_ENCRYPTED: + // TODO + throw new RuntimeException("Encryption is not supported in FastPath packets."); + } + } + + // TODO: optional FIPS information, when FIPS is selected + // TODO: optional data signature (checksum), when checksum or FIPS is + // selected + + // Array of FastPath update fields + while (buf.cursor < buf.length) { + + int updateHeader = buf.readUnsignedByte(); + + int size = buf.readUnsignedShortLE(); + + int updateCode = updateHeader & 0xf; + int fragmentation = (updateHeader >> 4) & 0x3; + int compression = (updateHeader >> 6) & 0x3; + + if (verbose) + System.out.println("[" + this + "] INFO: FastPath update received. UpdateCode: " + updateCode + ", fragmentation: " + fragmentation + ", compression: " + + compression + ", size: " + size + "."); + + ByteBuffer data = buf.readBytes(size); + buf.putMetadata("fragmentation", fragmentation); + buf.putMetadata("compression", compression); + + switch (updateCode) { + + case FASTPATH_UPDATETYPE_ORDERS: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_ORDERS."); + pushDataToPad(ORDERS_PAD, data); + break; + + case FASTPATH_UPDATETYPE_BITMAP: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_BITMAP."); + pushDataToPad(BITMAP_PAD, data); + break; + + case FASTPATH_UPDATETYPE_PALETTE: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_PALETTE."); + pushDataToPad(PALETTE_PAD, data); + break; + + case FASTPATH_UPDATETYPE_SYNCHRONIZE: + // @see http://msdn.microsoft.com/en-us/library/cc240625.aspx + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_SYNCHRONIZE."); + + data.unref(); + + if (size != 0) + throw new RuntimeException("Size of FastPath synchronize packet must be 0. UpdateCode: " + updateCode + ", fragmentation: " + fragmentation + + ", compression: " + compression + ", size: " + size + ", data: " + data + "."); + break; + + case FASTPATH_UPDATETYPE_SURFCMDS: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_SURFCMDS."); + + break; + + case FASTPATH_UPDATETYPE_PTR_NULL: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_PTR_NULL."); + + break; + + case FASTPATH_UPDATETYPE_PTR_DEFAULT: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_PTR_DEFAULT."); + + break; + + case FASTPATH_UPDATETYPE_PTR_POSITION: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_PTR_POSITION."); + + break; + + case FASTPATH_UPDATETYPE_COLOR: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_COLOR."); + + break; + + case FASTPATH_UPDATETYPE_CACHED: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_CACHED."); + + break; + + case FASTPATH_UPDATETYPE_POINTER: + if (verbose) + System.out.println("[" + this + "] INFO: FASTPATH_UPDATETYPE_POINTER."); + + break; + + default: + throw new RuntimeException("Unknown FastPath update. UpdateCode: " + updateCode + ", fragmentation: " + fragmentation + ", compression: " + compression + + ", size: " + size + ", data: " + data + "."); + + } + + } + + buf.unref(); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerLicenseErrorPDUValidClient.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerLicenseErrorPDUValidClient.java new file mode 100644 index 00000000000..194ffe6db6d --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerLicenseErrorPDUValidClient.java @@ -0,0 +1,121 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Link; +import streamer.OneTimeSwitch; + +public class ServerLicenseErrorPDUValidClient extends OneTimeSwitch { + + public ServerLicenseErrorPDUValidClient(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Ignore packet + buf.unref(); + switchOff(); + } + + /* @formatter:off */ +// * Server Error alert +// +//03 00 00 22 02 F0 80 68 00 01 03 EB 70 14 80 00 F1 BC FF 03 10 00 07 00 00 00 02 00 00 00 04 00 00 00 +// +// +// Frame: Number = 30, Captured Frame Length = 91, MediaType = DecryptedPayloadHeader +//+ DecryptedPayloadHeader: FrameCount = 1, ErrorStatus = SUCCESS +// TLSSSLData: Transport Layer Security (TLS) Payload Data +//+ TLS: TLS Rec Layer-1 SSL Application Data +// ISOTS: TPKTCount = 1 +//- TPKT: version: 3, Length: 34 +// version: 3 (0x3) +// Reserved: 0 (0x0) +// PacketLength: 34 (0x22) +//- X224: Data +// Length: 2 (0x2) +// Type: Data +// EOT: 128 (0x80) +//- T125: Data Packet +// - MCSHeader: Type=Send Data Indication, UserID=1002, ChannelID=1003 +// - Type: Send Data Indication +// - RootIndex: 26 +// Value: (011010..) 0x1a +// - UserID: 0x3ea +// - UserID: 0x3ea +// - ChannelId: 1002 +// - Align: No Padding +// Padding2: (00......) 0x0 +// Value: 1 (0x1) +// - Channel: 0x3eb +// - ChannelId: 1003 +// Align: No Padding +// Value: 1003 (0x3EB) +// - DataPriority: high +// - DataPriority: high +// - RootIndex: 1 +// Value: (01......) 0x1 +// - Segmentation: Begin End +// Begin: (1.......) Begin +// End: (.1......) End +// - Length: 20 +// - Align: No Padding +// Padding4: (0000....) 0x0 +// Length: 20 +// RDP: RDPBCGR +//- RDPBCGR: RDPELE +// - SecurityHeader: License Packet +// - Flags: 128 (0x80) +// SecurityExchange: (...............0) Not Security Exchange PDU +// Reserved1: (.............00.) Reserved +// Encrypted: (............0...) Not Encrypted packet +// ResetSeqNumber: (...........0....) MUST be ignored. +// IgnoreSeqNumber: (..........0.....) MUST be ignored. +// InfoPacket: (.........0......) Not Client Info PDU +// LicensePacket: (........1.......) License Packet +// Reserved2: (.......0........) Reserved +// LicensePacketEncryption: (......0.........) Not License Packet Encryption +// ServerRedirectionPacket: (.....0..........) Not Standard Security Server Redirection PDU +// ImprovedChecksumForMACG: (....0...........) Not Improved Checksum for MAC Generation +// Reserved3: (.000............) Reserved +// FlagsHiValid: (0...............) FlagsHi should be ignored +// FlagsHi: Should be ignored +//- RDPELE: GM_ERROR_ALERT +// - TsPreambleHeader: Type = GM_ERROR_ALERT +// MsgType: GM_ERROR_ALERT +// - Flags: 3 (0x3) +// LicenseProtocolVersionMask: (....0011) RDP 5.0, 5.1, 5.2, 6.0, 6.1, and 7.0 +// Unused: (.000....) +// ExtendedErrorMSGsupported: (0.......) that extended error information using the License Error Message is NOT supported. +// MsgSize: 16 (0x10) +// - TsLicenseErrorMessage: ErrorCode = STATUS_VALID_CLIENT +// ErrorCode: STATUS_VALID_CLIENT +// StateTransition: ST_NO_TRANSITION +// - LiceseBinaryBlob: Type = Not Available +// RandomData: This value should be ignored +// BlobLen: 0 (0x0) +// + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSAttachUserConfirmPDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSAttachUserConfirmPDU.java new file mode 100644 index 00000000000..8373b83c725 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSAttachUserConfirmPDU.java @@ -0,0 +1,133 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * Server response to MCS Attach User request. + * + * Once the User Channel ID has been extracted, the client MUST send an MCS + * Channel Join Request PDU for the user channel. + * + * @see http://msdn.microsoft.com/en-us/library/cc240685.aspx + */ +public class ServerMCSAttachUserConfirmPDU extends OneTimeSwitch { + + public static final int MCS_ATTACH_USER_CONFIRM_PDU = 0xb; + + public static final int INITIATOR_PRESENT = 0x2; + + protected RdpState state; + + public ServerMCSAttachUserConfirmPDU(String id, RdpState state) { + super(id); + this.state = state; + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + int typeAndFlags = buf.readUnsignedByte(); + int type = typeAndFlags >> 2; + int flags = typeAndFlags & 0x3; + + if (type != MCS_ATTACH_USER_CONFIRM_PDU) + throw new RuntimeException("["+this+"] ERROR: Incorrect type of MCS AttachUserConfirm PDU. Expected value: 11, actual value: " + type + ", data: " + buf + "."); + + if (flags != INITIATOR_PRESENT) + throw new RuntimeException("Initator field is not present in MCS AttachUserConfirm PDU. Data: " + buf + "."); + + int rtSuccess = buf.readUnsignedByte() >> 4; + if (rtSuccess != 0) + throw new RuntimeException("["+this+"] ERROR: Cannot attach user: request failed. Error code: " + rtSuccess + ", data: " + buf + "."); + + // If the initiator field is present, the client stores the value of the + // initiator in the User Channel ID store , because the initiator specifies + // the User Channel ID. + state.serverUserChannelId = buf.readUnsignedShort() + 1001; + + buf.unref(); + + // Next: client MCS Channel Join Request PDU (s) + switchOff(); + } + + /** + * Example. + */ + /** + * Example. + * + * @see http://msdn.microsoft.com/en-us/library/cc240842.aspx + * @see http://msdn.microsoft.com/en-us/library/cc240500.aspx + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + byte[] packet = new byte[] { (byte) 0x2E, // MCS user confirm (001011.., + // 0xb), InitiatorPresent: 1 + // (......01, 0x1) + (byte) 0x00, // RT successfull (0000...., 0x0) + // Initiator: 1001+3 = 1004 + (byte) 0x00, (byte) 0x03, }; + + RdpState rdpState = new RdpState(); + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(packet, new byte[] { 1, 2, 3 })); + Element atachUserConfirm = new ServerMCSAttachUserConfirmPDU("attach_user_confirm", rdpState); + Element sink = new MockSink("sink"); + Element mainSink = new MockSink("mainSink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, atachUserConfirm, sink, mainSink); + pipeline.link("source", "attach_user_confirm", "mainSink"); + pipeline.link("attach_user_confirm >" + OTOUT, "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + + if (rdpState.serverUserChannelId != 1004) + System.err.println("Incorrect user channel ID. Expected value: 1004, actual value: " + rdpState.serverUserChannelId + "."); + } + +} + +/* + * 03 00 00 0B 02 F0 80 2E 00 00 03. + * + * Frame: Number = 18, Captured Frame Length = 68, MediaType = + * DecryptedPayloadHeader + DecryptedPayloadHeader: FrameCount = 1, ErrorStatus + * = SUCCESS TLSSSLData: Transport Layer Security (TLS) Payload Data + TLS: TLS + * Rec Layer-1 SSL Application Data ISOTS: TPKTCount = 1 - TPKT: version: 3, + * Length: 11 version: 3 (0x3) Reserved: 0 (0x0) PacketLength: 11 (0xB) - X224: + * Data Length: 2 (0x2) Type: Data EOT: 128 (0x80) - T125: Attach User Confirm, + * Result = rt-successful, Indicator = 0x3ec - MCSHeader: Type=Attach User + * Confirm - Type: Attach User Confirm - RootIndex: 11 Value: (001011..) 0xb - + * MCSAttachUserConfirm: Result = rt-successful, Indicator = 0x3ec + * InitiatorPresent: 1 (0x1) - Result: rt-successful - Result: rt-successful - + * RootIndex: 0 Value: (0000....) 0x0 - Initiator: 0x3ec - UserID: 0x3ec - + * ChannelId: 1004 - Align: No Padding Padding5: (00000...) 0x0 Value: 3 (0x3) + */ diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSChannelJoinConfirmPDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSChannelJoinConfirmPDU.java new file mode 100644 index 00000000000..d0a8e81380e --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSChannelJoinConfirmPDU.java @@ -0,0 +1,89 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Link; +import streamer.OneTimeSwitch; + +public class ServerMCSChannelJoinConfirmPDU extends OneTimeSwitch { + + protected int channel; + + public ServerMCSChannelJoinConfirmPDU(String id, int channel) { + super(id); + this.channel=channel; + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Ignore packet + buf.unref(); + switchOff(); + } + +} + +/* + * 03 00 00 0F 02 F0 80 3E 00 00 03 03 EC 03 EC + + Frame: Number = 22, Captured Frame Length = 72, MediaType = DecryptedPayloadHeader ++ DecryptedPayloadHeader: FrameCount = 1, ErrorStatus = SUCCESS + TLSSSLData: Transport Layer Security (TLS) Payload Data ++ TLS: TLS Rec Layer-1 SSL Application Data + ISOTS: TPKTCount = 1 +- TPKT: version: 3, Length: 15 + version: 3 (0x3) + Reserved: 0 (0x0) + PacketLength: 15 (0xF) +- X224: Data + Length: 2 (0x2) + Type: Data + EOT: 128 (0x80) +- T125: Channel Join Confirm, ChannelId = 1004, Result = rt-successful + - MCSHeader: Type=Channel Join Confirm + - Type: Channel Join Confirm + - RootIndex: 15 + Value: (001111..) 0xf + - MCSChannelJoinConfirm: ChannelId = 1004, Result = rt-successful + ChannelIdPresent: 1 (0x1) + - Result: rt-successful + - Result: rt-successful + - RootIndex: 0 + Value: (0000....) 0x0 + - Initiator: 0x3ec + - UserID: 0x3ec + - ChannelId: 1004 + - Align: No Padding + Padding5: (00000...) 0x0 + Value: 3 (0x3) + - Requested: 0x3ec + - ChannelId: 1004 + Align: No Padding + Value: 1004 (0x3EC) + - ChannelId: 0x3ec + - ChannelId: 1004 + Align: No Padding + Value: 1004 (0x3EC) + + */ diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSConnectResponse.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSConnectResponse.java new file mode 100644 index 00000000000..30b196b94ee --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSConnectResponse.java @@ -0,0 +1,283 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Link; +import streamer.OneTimeSwitch; + +/** + * Once the basic server settings data blocks have been processed successfully, the client MUST send the MCS Attach User Request PDU to the server. + * + * @see http://msdn.microsoft.com/en-us/library/cc240682.aspx + */ +public class ServerMCSConnectResponse extends OneTimeSwitch { + + public ServerMCSConnectResponse(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Ignore packet + buf.unref(); + switchOff(); + } + +} + +/* + * @formatter:off + * 03 00 00 64 02 F0 80 7F 66 5A 0A 01 00 02 01 00 30 1A 02 01 22 02 01 03 02 01 00 02 01 01 02 01 00 02 01 01 02 03 00 FF F8 02 01 02 04 36 00 05 00 14 7C 00 01 2A 14 76 0A 01 01 00 01 C0 00 4D 63 44 6E 20 01 0C 0C 00 04 00 08 00 01 00 00 00 03 0C 08 00 EB 03 00 00 02 0C 0C 00 00 00 00 00 00 00 00 00 + + Frame: Number = 12, Captured Frame Length = 157, MediaType = DecryptedPayloadHeader ++ DecryptedPayloadHeader: FrameCount = 1, ErrorStatus = SUCCESS + TLSSSLData: Transport Layer Security (TLS) Payload Data ++ TLS: TLS Rec Layer-1 SSL Application Data + ISOTS: TPKTCount = 1 +- TPKT: version: 3, Length: 100 + version: 3 (0x3) + Reserved: 0 (0x0) + PacketLength: 100 (0x64) +- X224: Data + Length: 2 (0x2) + Type: Data + EOT: 128 (0x80) +- T125: MCSConnect Response + - MCSConnectResponse: Result = rt-successful + - ConnectResponseHeader: + - AsnId: Application Constructed Tag (102) + - HighTag: + Class: (01......) Application (1) + Type: (..1.....) Constructed + TagNumber: (...11111) + TagValueEnd: 102 (0x66) + - AsnLen: Length = 90, LengthOfLength = 0 + Length: 90 bytes, LengthOfLength = 0 + - Result: rt-successful + - Value: 0 + - AsnIntegerHeader: + - AsnId: Enumerated type (Universal 10) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...01010) 10 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 0 (0x0) + - CalledConnectId: 0 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 0 (0x0) + - DomainParameters: Length = 26, LengthOfLength = 0 + - DomainParametersHeader: 0x1 + - AsnId: Sequence and SequenceOf types (Universal 16) + - LowTag: + Class: (00......) Universal (0) + Type: (..1.....) Constructed + TagValue: (...10000) 16 + - AsnLen: Length = 26, LengthOfLength = 0 + Length: 26 bytes, LengthOfLength = 0 + - ChannelIds: 34 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 34 (0x22) + - UserIDs: 3 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 3 (0x3) + - TokenIds: 0 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 0 (0x0) + - NumPriorities: 1 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 1 (0x1) + - MinThroughput: 0 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 0 (0x0) + - Height: 1 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 1 (0x1) + - MCSPDUsize: 65528 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 3, LengthOfLength = 0 + Length: 3 bytes, LengthOfLength = 0 + AsnInt: 65528 (0xFFF8) + - protocolVersion: 2 + - AsnIntegerHeader: + - AsnId: Integer type (Universal 2) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00010) 2 + - AsnLen: Length = 1, LengthOfLength = 0 + Length: 1 bytes, LengthOfLength = 0 + AsnInt: 2 (0x2) + - UserData: Identifier = Generic Conference Contro (0.0.20.124.0.1) + - UserDataHeader: + - AsnId: OctetString type (Universal 4) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00100) 4 + - AsnLen: Length = 54, LengthOfLength = 0 + Length: 54 bytes, LengthOfLength = 0 + - AsnBerObjectIdentifier: Generic Conference Contro (0.0.20.124.0.1) + - AsnObjectIdentifierHeader: + - AsnId: Reserved for use by the encoding rules (Universal 0) + - LowTag: + Class: (00......) Universal (0) + Type: (..0.....) Primitive + TagValue: (...00000) 0 + - AsnLen: Length = 5, LengthOfLength = 0 + Length: 5 bytes, LengthOfLength = 0 + First: 0 (0x0) + Final: 20 (0x14) + Final: 124 (0x7C) + Final: 0 (0x0) + Final: 1 (0x1) + - ConnectPDULength: 42 + Align: No Padding + Length: 42 + - ConnectGCCPDU: conferenceCreateResponse + ExtensionBit: 0 (0x0) + - ChoiceValue: conferenceCreateResponse + Value: (001.....) 0x1 + - conferenceCreateResponse: + ExtensionBit: 0 (0x0) + userDataPresent: 1 (0x1) + - nodeID: 0x79f3 + - UserID: 31219 + - Align: No Padding + Padding2: (00......) 0x0 + Value: 30218 (0x760A) + - tag: 1 (0x1) + - Length: 1 + Align: No Padding + Length: 1 + Value: 1 (0x1) + - result: success + ExtensionBit: 0 (0x0) + - RootIndex: 0 + Value: (000.....) 0x0 + - userData: + - Size: 1 + - Align: No Padding + Padding4: (0000....) 0x0 + Length: 1 + - UserData: 0x4d63446e + valuePresent: 1 (0x1) + - key: h221NonStandard + - ChoiceValue: h221NonStandard + Value: (1.......) 0x1 + - h221NonStandard: + - H221NonStandardIdentifier: length: 4 + - ConstrainedLength: 4 + Value: (00000000) 0x0 + - Align: No Padding + Padding6: (000000..) 0x0 + Value: Binary Large Object (4 Bytes) + - ServerMcsConnectResponsePdu: + - RDPGCCUserDataResponseLength: 32 + Align: No Padding + Length: 32 + - TsUd: SC_CORE + - TsUdHeader: Type = SC_CORE, Length = 12 + Type: SC_CORE + Length: 12 (0xC) + - TsUdScCore: + Version: RDP 5.0, 5.1, 5.2, 6.0, 6.1, and 7.0 + ClientRequestedProtocols: TLS 1.0 + - TsUd: SC_NET + - TsUdHeader: Type = SC_NET, Length = 8 + Type: SC_NET + Length: 8 (0x8) + - TsUdScNet: + MCSChannelID: 1003 (0x3EB) + ChannelCount: 0 (0x0) + Pad: 0 Bytes + - TsUd: SC_SECURITY + - TsUdHeader: Type = SC_SECURITY, Length = 12 + Type: SC_SECURITY + Length: 12 (0xC) + - TsUdSCSec1: + - EncryptionMethod: + Support40Bit: (...............................0) Not Support + Support128Bit: (..............................0.) Not Support 128-bit + Reserved1: (.............................0..) + Support56Bit: (............................0...) Not Support 56-bit + SupportFIPS: (...........................0....) Not Support FIPS Compliant + Reserved2: (000000000000000000000000000.....) + EncryptionLevel: TS_ENCRYPTION_NONE + */ diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSPDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSPDU.java new file mode 100644 index 00000000000..5862e196b5c --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerMCSPDU.java @@ -0,0 +1,149 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.Pipeline; +import streamer.PipelineImpl; + +public class ServerMCSPDU extends BaseElement { + + public ServerMCSPDU(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + byte headerByte = buf.readSignedByte(); + int type = headerByte >> 2; + + switch (type) { + // Expected type: send data indication: 26 (0x1a, top 6 bits, or 0x68) + case 0x1a: { + // int userId = buf.readUnsignedShort() + 1001; // User ID: 1002 (1001+1) + buf.skipBytes(2); // Ignore user ID + + int channelId = buf.readUnsignedShort(); // Channel ID: 1003 + + int flags = buf.readSignedByte(); + if ((flags & 0x30) != 0x30) + throw new RuntimeException("Fragmented MCS packets are not supported."); + + int payloadLength = buf.readVariableUnsignedShort(); + + ByteBuffer data = buf.readBytes(payloadLength); + + buf.unref(); + + pushDataToPad("channel_" + channelId, data); + break; + } + + case 0x8: { + // Disconnection sequence. + buf.unref(); + break; + } + + default: + throw new RuntimeException("Unsupported MCS packet type: " + type + "(" + headerByte + "), data: " + buf + "."); + } + + } + + /** + * Example. + * + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + // System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + byte[] packet = new byte[] { + // TPKT + (byte) 0x03, (byte) 0x00, // TPKT Header: TPKT version = 3 + (byte) 0x00, (byte) 0x1B, // TPKT length: 27 bytes + + // X224 + (byte) 0x02, // X224 Length: 2 bytes + (byte) 0xF0, // X224 Type: Data + (byte) 0x80, // X224 EOT + + // MCS + // Type: send data indication: 26 (0x1a, top 6 bits) + (byte) 0x68, // ?? + + (byte) 0x00, (byte) 0x01, // User ID: 1002 (1001+1) + (byte) 0x03, (byte) 0xEB, // Channel ID: 1003 + (byte) 0x70, // Data priority: high, segmentation: begin|end + (byte) 0x0D, // Payload length: 13 bytes + + // Deactivate all PDU + (byte) 0x0D, (byte) 0x00, // Length: 13 bytes (LE) + + // - PDUType: 22 (0x16, LE) + // Type: (............0110) TS_PDUTYPE_DEACTIVATEALLPDU + // ProtocolVersion: (000000000001....) 1 + (byte) 0x16, (byte) 0x00, + + (byte) 0xEA, (byte) 0x03, // PDU source: 1002 (LE) + (byte) 0xEA, (byte) 0x03, (byte) 0x01, (byte) 0x00, // ShareID = 66538 + + (byte) 0x01, (byte) 0x00, // Length if source descriptor: 1 (LE) + (byte) 0x00, // Source descriptor (should be set to 0): 0 + }; + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(packet)); + Element mcs = new ServerMCSPDU("mcs") { + { + verbose = true; + } + }; + Element tpkt = new ServerTpkt("tpkt"); + Element x224 = new ServerX224DataPdu("x224"); + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { + // Deactivate all PDU + (byte) 0x0D, (byte) 0x00, // Length: 13 bytes (LE) + + // - PDUType: 22 (0x16, LE) + // Type: (............0110) TS_PDUTYPE_DEACTIVATEALLPDU + // ProtocolVersion: (000000000001....) 1 + (byte) 0x16, (byte) 0x00, + + (byte) 0xEA, (byte) 0x03, // PDU source: 1002 (LE) + (byte) 0xEA, (byte) 0x03, (byte) 0x01, (byte) 0x00, // ShareID = 66538 + + (byte) 0x01, (byte) 0x00, // Length if source descriptor: 1 (LE) + (byte) 0x00, // Source descriptor (should be set to 0): 0 + })); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, tpkt, x224, mcs, sink); + pipeline.link("source", "tpkt", "x224", "mcs >channel_1003", "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerPacketSniffer.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerPacketSniffer.java new file mode 100644 index 00000000000..8c39a021414 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerPacketSniffer.java @@ -0,0 +1,52 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + + +/** + * Try to determine packet content by it header fingerprint. + */ +public class ServerPacketSniffer extends PacketSniffer { + + private static final Pair[] serverRegexps = new Pair[] { + // @formatter:off + new Pair("Server FastPath update", "04"), + new Pair("Server X224ConnectionRequest", "03 00 XX XX 0E D0"), + new Pair("Server MCSConnectResponse", "03 00 XX XX 02 F0 80 7F 66 5A"), + new Pair("Server AttachUserConfirm", "03 00 XX XX 02 F0 80 2E"), + new Pair("Server ChannelJoinConfirm", "03 00 XX XX 02 F0 80 3E"), + new Pair("Server ErrorAlert", "03 00 XX XX 02 F0 80 68 00 01 03 EB 70 14 80 00"), + new Pair("Server DemandActivePDU", "03 00 XX XX 02 F0 80 68 00 01 03 EB 70 XX XX XX XX 11"), + new Pair("Server ControlPDU", "03 00 XX XX 02 F0 80 68 00 01 03 EB 70 XX XX XX 17 00 EA 03 EA 03 XX 00 XX XX XX XX 14"), + new Pair("Server SynchronizePDU", "03 00 XX XX 02 F0 80 68 00 01 03 EB 70 XX XX XX 17 00 EA 03 EA 03 XX 00 XX XX XX XX 1F"), + new Pair("Server FontMapPDU", "03 00 XX XX 02 F0 80 68 00 01 03 EB 70 XX XX XX 17 00 EA 03 EA 03 XX 00 XX XX XX XX 28"), + new Pair("Server SET_ERROR_INFO_PDU", "03 00 XX XX 02 F0 80 68 00 01 03 EB 30 XX XX XX 17 00 00 00 EA 03 XX 00 XX XX XX XX 2F"), + new Pair("Server DeactivateAllPDU", "03 00 XX XX 02 F0 80 68 00 01 03 EB 70 XX XX XX 16 00"), + new Pair("Server CloseConnection", "03 00 00 09 02 F0 80 21 80"), + +// new Pair("Server TPKT unknown packet", "03"), +// new Pair("Server FastPath update with flags or continuation", ".*"), + // @formatter:on + + }; + + public ServerPacketSniffer(String id) { + super(id, serverRegexps); + } + + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerPaletteUpdate.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerPaletteUpdate.java new file mode 100644 index 00000000000..3b0762e6995 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerPaletteUpdate.java @@ -0,0 +1,78 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import java.awt.image.IndexColorModel; + +import common.ScreenDescription; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +/** + * @see http://msdn.microsoft.com/en-us/library/cc240623.aspx + */ +public class ServerPaletteUpdate extends BaseElement { + + public static final int UPDATETYPE_PALETTE = 0x0002; + protected ScreenDescription screen; + + public ServerPaletteUpdate(String id, ScreenDescription screen) { + super(id); + this.screen = screen; + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // (2 bytes): A 16-bit, unsigned integer. The update type. This field MUST + // be set to UPDATETYPE_PALETTE (0x0002). + int updateType = buf.readUnsignedShortLE(); + if (updateType != UPDATETYPE_PALETTE) + throw new RuntimeException("Unexpected update type. Expected type: UPDATETYPE_PALETTE (0x0002), actual value: " + updateType + ", data: " + buf + "."); + + // pad2Octets (2 bytes): A 16-bit, unsigned integer. Padding. Values in this + // field MUST be ignored. + buf.skipBytes(2); + + // (4 bytes): A 32-bit, unsigned integer. The number of RGB triplets in the + // paletteData field. This field MUST be set to 256 (the number of entries + // in an 8 bpp palette). + int numberColors = (int) buf.readUnsignedIntLE(); + if (numberColors != 256) + throw new RuntimeException("Unexpected value for number of color field in server Palette Update packet. Expected value: 256 colors, actual value: " + + numberColors + ", data: " + buf + "."); + + // (variable): An array of palette entries in RGB triplet format packed on + // byte boundaries. The number of triplet entries is given by the + // numberColors field. + ByteBuffer paletteEntries = buf.readBytes(numberColors * 3); + + // In the case of a Palette Update, the client MUST update the global + // palette on all drawing surfaces + screen.colorMap = new IndexColorModel(8, numberColors, paletteEntries.data, paletteEntries.offset, false); + + /* DEBUG */buf.assertThatBufferIsFullyRead(); + + buf.unref(); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerSynchronizePDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerSynchronizePDU.java new file mode 100644 index 00000000000..315fbfed00a --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerSynchronizePDU.java @@ -0,0 +1,115 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Link; +import streamer.OneTimeSwitch; + +public class ServerSynchronizePDU extends OneTimeSwitch { + + public ServerSynchronizePDU(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Ignore packet + buf.unref(); + switchOff(); + } + +} + +/* @formatter:off */ +/* + + * 03 00 00 24 02 F0 80 68 00 01 03 EB 70 16 16 00 17 00 EA 03 EA 03 01 00 08 00 16 00 1F 00 00 00 01 00 86 A4 + + Frame: Number = 36, Captured Frame Length = 93, MediaType = DecryptedPayloadHeader ++ DecryptedPayloadHeader: FrameCount = 1, ErrorStatus = SUCCESS + TLSSSLData: Transport Layer Security (TLS) Payload Data ++ TLS: TLS Rec Layer-1 SSL Application Data + ISOTS: TPKTCount = 1 +- TPKT: version: 3, Length: 36 + version: 3 (0x3) + Reserved: 0 (0x0) + PacketLength: 36 (0x24) +- X224: Data + Length: 2 (0x2) + Type: Data + EOT: 128 (0x80) +- T125: Data Packet + - MCSHeader: Type=Send Data Indication, UserID=1002, ChannelID=1003 + - Type: Send Data Indication + - RootIndex: 26 + Value: (011010..) 0x1a + - UserID: 0x3ea + - UserID: 0x3ea + - ChannelId: 1002 + - Align: No Padding + Padding2: (00......) 0x0 + Value: 1 (0x1) + - Channel: 0x3eb + - ChannelId: 1003 + Align: No Padding + Value: 1003 (0x3EB) + - DataPriority: high + - DataPriority: high + - RootIndex: 1 + Value: (01......) 0x1 + - Segmentation: Begin End + Begin: (1.......) Begin + End: (.1......) End + - Length: 22 + - Align: No Padding + Padding4: (0000....) 0x0 + Length: 22 + RDP: RDPBCGR +- RDPBCGR: SynchronizePDU + - SlowPathPacket: SynchronizePDU + - SlowPath: Type = TS_PDUTYPE_DATAPDU + - TsShareControlHeader: Type = TS_PDUTYPE_DATAPDU + TotalLength: 22 (0x16) + - PDUType: 23 (0x17) + Type: (............0111) TS_PDUTYPE_DATAPDU + ProtocolVersion: (000000000001....) 1 + PDUSource: 1002 (0x3EA) + - SlowPathIoPacket: 0x0 + - ShareDataHeader: TS_PDUTYPE2_SYNCHRONIZE + ShareID: 66538 (0x103EA) + Pad1: 8 (0x8) + StreamID: STREAM_UNDEFINED + UncompressedLength: 22 (0x16) + PDUType2: TS_PDUTYPE2_SYNCHRONIZE + - CompressedType: Not Compressed + MPPC: (....0000) MPPC 8K + Reserved: (...0....) + Compressed: (..0.....) Not Compressed + Front: (.0......) Not At Front + Flush: (0.......) Not Flushed + CompressedLength: 0 (0x0) + - TsSynchronizePDU: 0x1 + MessageType: 0x1, MUST be set to SYNCMSGTYPE_SYNC (1) + TargetUser: 42118 (0xA486) + */ diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerTpkt.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerTpkt.java new file mode 100644 index 00000000000..0d19fa4926c --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerTpkt.java @@ -0,0 +1,70 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +public class ServerTpkt extends BaseElement { + + /** + * TPKT protocol version (first byte). + */ + public static final int PROTOCOL_TPKT = 3; + + public ServerTpkt(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // We need at least 4 bytes to get packet length + if(!cap(buf, 4, UNLIMITED, link, false)) + return; + + int version = buf.readUnsignedByte(); + if (version != PROTOCOL_TPKT) + throw new RuntimeException("Unexpected data in TPKT header. Expected TPKT version: 0x03, actual value: " + buf + "."); + + buf.skipBytes(1); // Reserved byte + + // Length of whole packet, including header + int length = buf.readUnsignedShort(); + if(!cap(buf, length, length, link, false)) + return; + + int payloadLength = length - buf.cursor; + + // Extract payload + ByteBuffer outBuf = buf.slice(buf.cursor, payloadLength, true); + buf.unref(); + + if(verbose) { + outBuf.putMetadata("source", this); + } + + pushDataToAllOuts(outBuf); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerX224ConnectionConfirmPDU.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerX224ConnectionConfirmPDU.java new file mode 100644 index 00000000000..a33527773f3 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerX224ConnectionConfirmPDU.java @@ -0,0 +1,237 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * Once the External Security Protocol handshake has run to completion, the + * client MUST continue with the connection sequence by sending the MCS Connect + * Initial PDU to the server over the newly established secure channel. + * + * + * @see http://msdn.microsoft.com/en-us/library/cc240663.aspx + */ +public class ServerX224ConnectionConfirmPDU extends OneTimeSwitch { + + public static final int X224_TPDU_CONNECTION_REQUEST = 0xe0; + public static final int X224_TPDU_CONNECTION_CONFIRM = 0xd0; + public static final int X224_TPDU_DISCONNECTION_REQUEST = 0x80; + public static final int X224_TPDU_DISCONNECTION_CONFIRM = 0xc0; + public static final int X224_TPDU_EXPEDITED_DATA = 0x10; + public static final int X224_TPDU_DATA_ACKNOWLEDGE = 0x61; + public static final int X224_TPDU_EXPEDITET_ACKNOWLEDGE = 0x40; + public static final int X224_TPDU_REJECT = 0x51; + public static final int X224_TPDU_ERROR = 0x70; + public static final int X224_TPDU_PROTOCOL_IDENTIFIER = 0x01; + + /** + * The server requires that the client support Enhanced RDP Security with + * either TLS 1.0, 1.1 or 1.2 or CredSSP. If only CredSSP was requested then + * the server only supports TLS. + */ + public static final int SSL_REQUIRED_BY_SERVER = 0x00000001; + + /** + * The server is configured to only use Standard RDP Security mechanisms and + * does not support any External Security Protocols. + */ + public static final int SSL_NOT_ALLOWED_BY_SERVER = 0x00000002; + + /** + * The server does not possess a valid authentication certificate and cannot + * initialize the External Security Protocol Provider. + */ + public static final int SSL_CERT_NOT_ON_SERVER = 0x00000003; + + /** + * The list of requested security protocols is not consistent with the current + * security protocol in effect. This error is only possible when the Direct + * Approach is used and an External Security Protocolis already being used. + */ + public static final int INCONSISTENT_FLAGS = 0x00000004; + + /** + * The server requires that the client support Enhanced RDP Security with + * CredSSP. + */ + public static final int HYBRID_REQUIRED_BY_SERVER = 0x00000005; + + /** + * The server requires that the client support Enhanced RDP Security with TLS + * 1.0, 1.1 or 1.2 and certificate-based client authentication. + */ + public static final int SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER = 0x00000006; + + public ServerX224ConnectionConfirmPDU(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + int x224Length = buf.readVariableSignedIntLE(); + + int x224Type = buf.readUnsignedByte(); + if (x224Type != X224_TPDU_CONNECTION_CONFIRM) + throw new RuntimeException("Unexpected type of packet. Expected type: " + X224_TPDU_CONNECTION_CONFIRM + " (CONNECTION CONFIRM), actual type: " + + x224Type + ", length: " + x224Length + ", buf: " + buf + "."); + + // Ignore destination reference, because client side has only one node + buf.skipBytes(2); + + // Source reference + // int srcRef = buf.readUnsignedShort(); + buf.skipBytes(2); + + // Ignore class and options + buf.skipBytes(1); + + // RDP_NEG_RSP::type (TYPE_RDP_NEG_RSP) + int negType = buf.readUnsignedByte(); + + // RDP_NEG_RSP::flags (0) + buf.skipBytes(1); // Ignore: always 0 + + // RDP_NEG_RSP::length (always 8 bytes) + int length = buf.readUnsignedShortLE(); + + if (length != 8) + throw new RuntimeException("Unexpected length of buffer. Expected value: 8, actual value: " + length + ", RDP NEG buf: " + buf + "."); + + // RDP_NEG_RSP: Selected protocols (PROTOCOL_SSL) + int protocol = buf.readSignedIntLE(); + + if (negType != RdpConstants.RDP_NEG_REQ_TYPE_NEG_RSP) { + // Parse error code, see + // http://msdn.microsoft.com/en-us/library/cc240507.aspx + int errorCode = protocol; + String message = "Unknown error."; + switch (errorCode) { + case SSL_REQUIRED_BY_SERVER: + message = "The server requires that the client support Enhanced RDP Security with either TLS 1.0, 1.1 or 1.2 or CredSSP. If only CredSSP was requested then the server only supports TLS."; + break; + + case SSL_NOT_ALLOWED_BY_SERVER: + message = "The server is configured to only use Standard RDP Security mechanisms and does not support any External Security Protocols."; + break; + + case SSL_CERT_NOT_ON_SERVER: + message = "The server does not possess a valid authentication certificate and cannot initialize the External Security Protocol Provider."; + break; + + case INCONSISTENT_FLAGS: + message = "The list of requested security protocols is not consistent with the current security protocol in effect. This error is only possible when the Direct Approach is used and an External Security Protocolis already being used."; + break; + + case HYBRID_REQUIRED_BY_SERVER: + message = "The server requires that the client support Enhanced RDP Security with CredSSP."; + break; + + case SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER: + message = "The server requires that the client support Enhanced RDP Security with TLS 1.0, 1.1 or 1.2 and certificate-based client authentication."; + break; + + } + throw new RuntimeException("Connection failure: " + message ); + } + + + + if (protocol != RdpConstants.RDP_NEG_REQ_PROTOCOL_SSL) + throw new RuntimeException("Unexpected protocol type. Expected protocol type: " + RdpConstants.RDP_NEG_REQ_PROTOCOL_SSL + + " (SSL), actual response type: " + protocol + ", RDP NEG buf: " + buf + "."); + + if (verbose) + System.out.println("[" + this + "] INFO: RDP Negotiation response. Type: " + negType + ", protocol: " + protocol + "."); + + // Next: upgrade socket to SSL, send ConnectInitial packet + switchOff(); + } + + /** + * Example. + * + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + +// byte[] packet = new byte[] { +// +// 0x03, // -> TPKT Header: TPKT version = 3 +// 0x00, // TPKT Header: Reserved = 0 +// 0x00, 0x13, // TPKT Header: Packet length - (total = 19 bytes) +// 0x0e, // X.224: Length indicator (14 bytes) +// (byte) 0xd0, // X.224: Type (high nibble) = 0xd = CC TPDU; credit +// // (low nibble) = 0 +// 0x00, 0x00, // X.224: Destination reference = 0 +// 0x12, 0x34, // X.224: Source reference = 0x1234 (bogus value) +// 0x00, // X.224: Class and options = 0 +// +// 0x02, // RDP_NEG_RSP::type (TYPE_RDP_NEG_RSP) +// 0x00, // RDP_NEG_RSP::flags (0) +// 0x08, 0x00, // RDP_NEG_RSP::length (8 bytes) +// 0x01, 0x00, 0x00, 0x00 // RDP_NEG_RSP: Selected protocols (PROTOCOL_SSL) +// }; + + // Connection failure + // 03 00 00 13 0e d0 00 00 12 34 00 03 00 08 00 05 00 00 00 + byte[] packet = new byte[] { + + 0x03, // -> TPKT Header: TPKT version = 3 + 0x00, // TPKT Header: Reserved = 0 + 0x00, 0x13, // TPKT Header: Packet length - (total = 19 bytes) + 0x0e, // X.224: Length indicator (14 bytes) + (byte) 0xd0, // X.224: Type (high nibble) = 0xd = CC TPDU; credit + // (low nibble) = 0 + 0x00, 0x00, // X.224: Destination reference = 0 + 0x12, 0x34, // X.224: Source reference = 0x1234 (bogus value) + 0x00, // X.224: Class and options = 0 + (byte) 0x03, // Failure + (byte) 0x00, // RDP_NEG_RSP::flags (0) + (byte) 0x08, (byte) 0x00, // RDP_NEG_RSP::length (8 bytes) + (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x00, // Code: HYBRID_REQUIRED_BY_SERVER + + }; + + MockSource source = new MockSource("source", ByteBuffer.convertByteArraysToByteBuffers(packet)); + Element cc = new ServerX224ConnectionConfirmPDU("cc"); + Element tpkt = new ServerTpkt("tpkt"); + Element sink = new MockSink("sink", new ByteBuffer[] {}); + Element mainSink = new MockSink("mainSink", new ByteBuffer[] {}); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source, tpkt, cc, sink, mainSink); + pipeline.link("source", "tpkt", "cc", "mainSink"); + pipeline.link("cc >" + OTOUT, "sink"); + pipeline.runMainLoop("source", STDOUT, false, false); + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerX224DataPdu.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerX224DataPdu.java new file mode 100644 index 00000000000..15489041a08 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/ServerX224DataPdu.java @@ -0,0 +1,64 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +public class ServerX224DataPdu extends BaseElement { + + public static final int X224_TPDU_LAST_DATA_UNIT = 0x80; + public static final int X224_TPDU_DATA = 0xF0; + + public ServerX224DataPdu(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + int headerLength = buf.readVariableSignedIntLE(); + + if (headerLength != 2) + throw new RuntimeException("Unexpected X224 Data PDU header length. Expected header length: 2 , actual header length: " + headerLength + "."); + + // Read X224 type and options + int type = buf.readUnsignedByte(); // High nibble: type, low nibble: + + if ((type & 0xf0) != X224_TPDU_DATA) + throw new RuntimeException("[" + this + "] ERROR: Unexepcted X224 packet type. Expected packet type: " + X224_TPDU_DATA + + " (X224_TPDU_DATA), actual packet type: " + type + ", buf: " + buf + "."); + + int options = buf.readUnsignedByte(); + + if ((options & X224_TPDU_LAST_DATA_UNIT) != X224_TPDU_LAST_DATA_UNIT) + throw new RuntimeException("Unexepcted X224 packet options. Expected options: " + X224_TPDU_LAST_DATA_UNIT + + " (X224_TPDU_LAST_DATA_UNIT), actual packet options: " + options + ", buf: " + buf + "."); + + ByteBuffer payload = buf.readBytes(buf.length - buf.cursor); + + buf.unref(); + + pushDataToAllOuts(payload); + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/TrustAllX509TrustManager.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/TrustAllX509TrustManager.java new file mode 100644 index 00000000000..aaf93b0cc90 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/TrustAllX509TrustManager.java @@ -0,0 +1,40 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import java.security.cert.X509Certificate; + +import javax.net.ssl.X509TrustManager; + +public class TrustAllX509TrustManager implements X509TrustManager { + @Override + public void checkClientTrusted(final X509Certificate[] chain, final String authType) { + // TODO: ask user to confirm self-signed certificates + } + + @Override + public void checkServerTrusted(final X509Certificate[] chain, final String authType) { + // TODO: ask user to confirm self-signed certificates + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + // TODO: use system CA certificates here + return null; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/UpgradeSocketToSSL.java b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/UpgradeSocketToSSL.java new file mode 100644 index 00000000000..d4c08f189c7 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/rdpclient/UpgradeSocketToSSL.java @@ -0,0 +1,44 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import streamer.ByteBuffer; +import streamer.Direction; +import streamer.Event; +import streamer.Link; +import streamer.OneTimeSwitch; + +public class UpgradeSocketToSSL extends OneTimeSwitch { + + public UpgradeSocketToSSL(String id) { + super(id); + } + + @Override + protected void onStart() { + + sendEventToAllPads(Event.SOCKET_UPGRADE_TO_SSL, Direction.IN); + switchOff(); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + throw new RuntimeException("Unexpected data: " + buf + "."); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/AssertingByteBuffer.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/AssertingByteBuffer.java new file mode 100644 index 00000000000..195847524a3 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/AssertingByteBuffer.java @@ -0,0 +1,107 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.nio.charset.Charset; + +/** + * Assert that writes to this buffer are matching expected data. + */ +public class AssertingByteBuffer extends ByteBuffer { + + public AssertingByteBuffer(byte[] expectedData) { + super(expectedData); + } + + private void assertEquals(int expected, int actual) { + if (expected != actual) + throw new RuntimeException("Expected value does not match actual value. Expected value: " + expected + ", actual value: " + actual + ", buf: "+this+"."); + } + + @Override + public void writeByte(int b) { + if(b<0) + throw new RuntimeException(); + //*DEBUG*/System.out.println("WriteByte: "+b+", cursor:"+cursor+"."); + assertEquals(readUnsignedByte(), b&0xff); + } + + @Override + public void writeShort(int x) { + //*DEBUG*/System.out.println("WriteShort: "+x+", cursor:"+cursor+"."); + assertEquals(readUnsignedShort(), x&0xFFff); + } + + @Override + public void writeShortLE(int x) { + //*DEBUG*/System.out.println("WriteShortLE: "+x+", cursor:"+cursor+"."); + assertEquals(readUnsignedShortLE(), x&0xFFff); + } + + @Override + public void writeInt(int i) { + //*DEBUG*/System.out.println("WriteInt: "+i+", cursor:"+cursor+"."); + assertEquals(readSignedInt(), i); + } + + @Override + public void writeIntLE(int i) { + //*DEBUG*/System.out.println("WriteIntLE: "+i+", cursor:"+cursor+"."); + assertEquals(readSignedIntLE(), i); + } + + @Override + public void writeVariableIntLE(int i) { + //*DEBUG*/System.out.println("WriteVariableIntLE: "+i+", cursor:"+cursor+"."); + assertEquals(readVariableSignedIntLE(), i); + } + + @Override + public void writeString(String actual, Charset charset) { + //*DEBUG*/System.out.println("WriteString: "+actual+", cursor:"+cursor+"."); + String expected = readString(actual.length(), charset); + if (!actual.equals(expected)) + throw new RuntimeException("Expected value does not match actual value. Expected value: " + expected + ", actual value: " + actual + "."); + } + + @Override + public void writeBytes(ByteBuffer actual) { + //*DEBUG*/System.out.println("WriteString: "+actual+", cursor:"+cursor+"."); + ByteBuffer expected = readBytes(actual.length); + if (!actual.equals(expected)) + throw new RuntimeException("Expected value does not match actual value. Expected value: " + expected + ", actual value: " + actual + "."); + } + + @Override + public void writeBytes(byte[] actualData) { + ByteBuffer actual = new ByteBuffer(actualData); + //*DEBUG*/System.out.println("WriteString: "+actual+", cursor:"+cursor+"."); + ByteBuffer expected = readBytes(actual.length); + if (!actual.equals(expected)) + throw new RuntimeException("Expected value does not match actual value. Expected value: " + expected + ", actual value: " + actual + "."); + } + + @Override + public void writeBytes(byte[] actualData, int offset, int length) { + ByteBuffer actual = new ByteBuffer(actualData, offset, length); + //*DEBUG*/System.out.println("WriteString: "+actual+", cursor:"+cursor+"."); + ByteBuffer expected = readBytes(actual.length); + if (!actual.equals(expected)) + throw new RuntimeException("Expected value does not match actual value. Expected value: " + expected + ", actual value: " + actual + "."); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/BaseElement.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/BaseElement.java new file mode 100644 index 00000000000..86f9be35ba2 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/BaseElement.java @@ -0,0 +1,417 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +public class BaseElement implements Element { + + protected String id; + + /** + * Constant for @see cap() method to indicate that length is not restricted. + */ + public static final int UNLIMITED = -1; + + /** + * Set to true to enable debugging messages. + */ + protected boolean verbose = false; + + /** + * Limit on number of packets sent to sink from this element. Can be handy for + * fake elements and handshake-related elements. + */ + protected int numBuffers = 0; + + /** + * Number of packets sent to sink. + */ + protected int packetNumber = 0; + + /** + * Recommended size for incoming buffer in pull mode. + */ + protected int incommingBufLength = -1; + + protected Map inputPads = new HashMap(); + protected Map outputPads = new HashMap(); + + public BaseElement(String id) { + this.id = id; + + verbose = System.getProperty("streamer.Element.debug", "false").equals("true") || System.getProperty("streamer.Element.debug", "").contains(id); + } + + @Override + public String toString() { + return "Element(" + id + ")"; + } + + @Override + public Link getLink(String padName) { + if (inputPads.containsKey(padName)) + return (Link) inputPads.get(padName); + else if (outputPads.containsKey(padName)) + return (Link) outputPads.get(padName); + else + return null; + } + + @Override + public Set getPads(Direction direction) { + switch (direction) { + case IN: + return inputPads.keySet(); + + case OUT: + return outputPads.keySet(); + } + return null; + } + + @Override + public void validate() { + for (String padName : inputPads.keySet()) { + if (inputPads.get(padName) == null) + throw new RuntimeException("[ " + this + "] Required input pad is not connected. Pad name: " + padName + "."); + } + + for (String padName : outputPads.keySet()) { + if (outputPads.get(padName) == null) + throw new RuntimeException("[ " + this + "] Required output pad is not connected. Pad name: " + padName + "."); + } + } + + @Override + public void setLink(String padName, Link link, Direction direction) { + switch (direction) { + case IN: + if (inputPads.get(padName) != null) + throw new RuntimeException("Cannot link more than one wire to same pad. Element: " + this + ", pad: " + padName + ":" + direction + ", new link: " + + link + ", existing link: " + inputPads.get(padName) + "."); + inputPads.put(padName, link); + link.setSink(this); + + break; + + case OUT: + if (outputPads.get(padName) != null) + throw new RuntimeException("Cannot link more than one wire to same pad. Element: " + this + ", pad: " + padName + ":" + direction + ", new link: " + + link + ", existing link: " + outputPads.get(padName) + "."); + + outputPads.put(padName, link); + link.setSource(this); + + break; + } + } + + @Override + public void dropLink(String padName) { + if (inputPads.containsKey(padName)) { + Link link = (Link) inputPads.remove(padName); + if (link != null) + link.setSink(null); + } + + if (outputPads.containsKey(padName)) { + Link link = (Link) outputPads.remove(padName); + if (link != null) + link.setSource(null); + } + } + + /** + * By default, try to pull data from input links. + * + * Override this method in data source elements. + */ + @Override + public void poll(boolean block) { + for (DataSource source : inputPads.values()) { + Link link = (Link) source; + ByteBuffer buf = link.pull(block); + + if (buf != null) { + handleData(buf, link); + } + } + } + + /** + * By default, do nothing with incoming data and retransmit data to all output + * pads. + */ + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + pushDataToAllOuts(buf); + } + + /** + * Send data to all output pads. + */ + protected final void pushDataToAllOuts(ByteBuffer buf) { + + if (buf == null) + return; + + if (outputPads.size() == 0) + throw new RuntimeException("Number of outgoing connection is zero. Cannot send data to output. Data: " + buf + "."); + + // Send data to all pads with OUT direction + for (DataSink out : outputPads.values()) { + if (verbose) + System.out.println("[" + this + "] INFO: Sending buf " + buf + " to " + out + "."); + + buf.rewindCursor(); + buf.ref(); + out.sendData(buf); + } + + buf.unref(); + packetNumber++; + } + + /** + * Send data to given pad only. + */ + protected void pushDataToPad(String padName, ByteBuffer buf) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Sending buf " + buf + " to " + padName + "."); + + DataSink link = outputPads.get(padName); + if (link == null) + throw new RuntimeException("Output pad of " + this + " element is not connected to a link. Pad name: " + padName + "."); + + buf.rewindCursor(); + link.sendData(buf); + } + + /** + * By default, do nothing with incoming event and retransmit event to all + * pads. + */ + @Override + public void handleEvent(Event event, Direction direction) { + if (verbose) + System.out.println("[" + this + "] INFO: Event " + event + ":" + direction + " is received."); + + switch (event) { + case STREAM_CLOSE: + onClose(); + break; + case STREAM_START: + onStart(); + break; + } + + sendEventToAllPads(event, direction); + } + + /** + * Override this method to do something when STREAM_CLOSE event arrives. + */ + protected void onClose() { + } + + /** + * Override this method to do something when STREAM_START event arrives. + */ + protected void onStart() { + } + + /** + * Send event to all outputs. + * + * @param event + * a event + * @param direction + * IN to send event to input pads, OUT to send event to all output + * pads + */ + protected final void sendEventToAllPads(Event event, Direction direction) { + if (verbose) + System.out.println("[" + this + "] INFO: Sending event " + event + ":" + direction + "."); + + switch (direction) { + case IN: + // Send event to all pads with IN direction + for (DataSource in : inputPads.values()) { + in.sendEvent(event, direction); + } + break; + case OUT: + // Send event to all pads with OUT direction + for (DataSink out : outputPads.values()) { + out.sendEvent(event, direction); + } + break; + } + } + + /** + * Ensure that packet has required minimum and maximum length, cuts tail when + * necessary. + * + * @param buf + * a buffer + * @param minLength + * minimum length of packet or -1 + * @param maxLength + * maximum length of packet or -1 + * @param link + * source link, to push unnecessary data back + * @param fromCursor + * if true, then position will be included into calculation + * @return true, + */ + public boolean cap(ByteBuffer buf, int minLength, int maxLength, Link link, boolean fromCursor) { + + if (buf == null) + return false; + + int length = buf.length; + + int cursor; + if (fromCursor) + cursor = buf.cursor; + else + cursor = 0; + + length -= cursor; + + if ((minLength < 0 || length >= minLength) && (maxLength < 0 || length <= maxLength)) + // Buffer is already in bounds + return true; + + // Buffer is too small, wait for the rest of buffer + if (minLength >= 0 && length < minLength) { + + if (verbose) + System.out.println("[" + this + "] INFO: Buffer is too small. Min length: " + minLength + ", data length (after cursor): " + length + "."); + + link.pushBack(buf.slice(0, length + cursor, true), minLength + cursor); + return false; + } else if (maxLength >= 0 && length > maxLength) { + + if (verbose) + System.out.println("[" + this + "] INFO: Buffer is too big. Max length: " + maxLength + ", data length (after cursor): " + length + "."); + + // Buffer is too big, cut unnecessary tail + link.pushBack(buf.slice(maxLength + cursor, length - maxLength, true)); + buf.length = maxLength + cursor; + + } + + return true; + } + + @Override + public void dropLink(Link link) { + if (inputPads.containsValue(link)) { + for (Entry entry : inputPads.entrySet()) + if (link.equals(entry.getValue())) { + inputPads.remove(entry.getKey()); + break; + } + } + + if (outputPads.containsValue(link)) { + for (Entry entry : outputPads.entrySet()) + if (link.equals(entry.getValue())) { + outputPads.remove(entry.getKey()); + break; + } + } + } + + @Override + public void replaceLink(Link existingLink, Link newLink) { + if (inputPads.containsValue(existingLink)) { + for (Entry entry : inputPads.entrySet()) + if (existingLink.equals(entry.getValue())) { + inputPads.put(entry.getKey(), newLink); + newLink.setSink(this); + break; + } + } + + if (outputPads.containsValue(existingLink)) { + for (Entry entry : outputPads.entrySet()) + if (existingLink.equals(entry.getValue())) { + outputPads.put(entry.getKey(), newLink); + newLink.setSource(this); + break; + } + } + } + + @Override + public String getId() { + return id; + } + + /** + * Example. + */ + public static void main(String args[]) { + Element source = new FakeSource("source") { + { + this.verbose = true; + this.numBuffers = 10; + this.incommingBufLength = 3; + this.delay = 100; + } + }; + + Element sink = new FakeSink("sink") { + { + this.verbose = true; + } + }; + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source); + pipeline.add(new BaseElement("t1")); + pipeline.add(new BaseElement("t2")); + pipeline.add(new BaseElement("t3")); + pipeline.add(new BaseElement("t4")); + pipeline.add(sink); + + pipeline.link("source", "t1", "t2", "t3", "t4", "sink"); + + // Links between source-t1-t2 will operate in pull mode. + // Links between t3-t4-sink will operate in push mode. + // Link between t2-t3 will run main loop (pull from source and push to + // sink). + pipeline.getLink("t3", STDOUT).run(); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/BufferPool.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/BufferPool.java new file mode 100644 index 00000000000..47f1435a335 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/BufferPool.java @@ -0,0 +1,36 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public class BufferPool { + public static byte[] allocateNewBuffer(int minSize) { + // TODO: search for free buffer in pool + if (minSize >= 0) + return new byte[minSize]; + else + // Return large buffer by default, too minimize number of round trips + // between to read full packet when packet is large, but it is important + // to return buffer to pool to reuse it (or null-ify links to it for + // faster GC) + // TODO: get free buffer from pool + return new byte[128 * 1024]; + } + + public static void recycleBuffer(byte[] buf) { + // TODO: return buffer to pool + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/ByteBuffer.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/ByteBuffer.java new file mode 100644 index 00000000000..832c731257f --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/ByteBuffer.java @@ -0,0 +1,826 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * This class represents a slice in a buffer. + */ +public class ByteBuffer { + + public static final String SEQUENCE_NUMBER = "seq"; + + public byte data[]; + public int offset = 0; + public int length = 0; + public int cursor = 0; + + private int refCount = 1; + private ByteBuffer parentByteBuffer = null; + + private Order order; + + /** + * Create buffer of size no less than length. Buffer can be a bit larger than + * length. Offset also can be set to non-zero value to leave some place for + * future headers. + */ + public ByteBuffer(int minLength) { + // Get buffer of acceptable size from buffer pool + this.data = BufferPool.allocateNewBuffer(minLength); + this.offset = 0; + this.length = minLength; + } + + public ByteBuffer(byte data[]) { + if (data == null) + throw new NullPointerException("Data must be non-null."); + + this.data = data; + this.offset = 0; + this.length = data.length; + } + + public ByteBuffer(byte[] data, int offset, int length) { + if (data == null) + throw new NullPointerException("Data must be non-null."); + + this.data = data; + this.offset = offset; + this.length = length; + } + + /** + * Create byte buffer of requested size with some space reserved for future + * headers. + */ + public ByteBuffer(int minLength, boolean reserveSpaceForHeader) { + // Get buffer of acceptable size from buffer pool + this.data = BufferPool.allocateNewBuffer(128 + minLength); + this.offset = 128; // 100 bytes should be enough for headers + this.length = minLength; + } + + /** + * Create empty buffer with given order only. + */ + public ByteBuffer(Order order) { + this.order = order; + } + + public void setOrder(Order order) { + this.order = order; + } + + public Order getOrder() { + return order; + } + + @Override + public String toString() { + return toString(100); + } + + /** + * Return string representation of this byte buffer. + * + * @param maxLength + * number of bytes to show in string + */ + public String toString(int maxLength) { + return "ByteRange(){offset=" + offset + ", length=" + length + ", cursor=" + cursor + ", data=" + ((data == null) ? "null" : toHexString(maxLength)) + + ((metadata == null || metadata.size() == 0) ? "" : ", metadata=" + metadata) + "}"; + } + + /** + * Return string representation of this byte buffer as hexadecimal numbers, + * e.g. "[0x01, 0x02]". + * + * @param maxLength + * number of bytes to show in string + */ + public String toHexString(int maxLength) { + StringBuilder builder = new StringBuilder(maxLength * 6); + builder.append('['); + for (int i = 0; i < maxLength && i < length; i++) { + if (i > 0) + builder.append(", "); + int b = data[offset + i] & 0xff; + builder.append("0x" + ((b < 16) ? "0" : "") + Integer.toString(b, 16)); + } + builder.append(']'); + return builder.toString(); + } + + /** + * Return string representation of this byte buffer as hexadecimal numbers, + * e.g. "01 02". + * + * @param maxLength + * number of bytes to show in string + */ + public String toPlainHexString(int maxLength) { + StringBuilder builder = new StringBuilder(maxLength * 3); + for (int i = 0; i < maxLength && i < length; i++) { + if (i > 0) + builder.append(" "); + int b = data[offset + i] & 0xff; + builder.append(((b < 16) ? "0" : "") + Integer.toString(b, 16)); + } + return builder.toString(); + } + + public void dump() { + System.out.println(toString(length)); + } + + public void extend(int newLength) { + if (data.length < newLength) + Arrays.copyOf(data, newLength); + } + + public void ref() { + refCount++; + } + + public void unref() { + refCount--; + + if (refCount == 0) { + + if (parentByteBuffer != null) { + parentByteBuffer.unref(); + parentByteBuffer = null; + } else { + // Return buffer to buffer pool + BufferPool.recycleBuffer(data); + } + + data = null; + } + + } + + public boolean isSoleOwner() { + return refCount == 1 && (parentByteBuffer == null); + } + + /** + * Create shared lightweight copy of part of this buffer. + */ + public ByteBuffer slice(int offset, int length, boolean copyMetadata) { + ref(); + + if (this.length < (offset + length)) + throw new RuntimeException("Length of region is larger that length of this buffer. Buffer length: " + this.length + ", offset: " + offset + + ", new region length: " + length + "."); + + ByteBuffer slice = new ByteBuffer(data, this.offset + offset, length); + + if (copyMetadata && this.metadata != null) + slice.metadata = new HashMap(metadata); + + return slice; + } + + private Map metadata = null; + + public Object putMetadata(String key, Object value) { + if (metadata == null) + metadata = new HashMap(); + return metadata.put(key, value); + } + + public Object getMetadata(String key) { + return (metadata != null) ? metadata.get(key) : null; + } + + /** + * Create new buffer, which holds data from both buffers. Expensive operation. + * + * @TODO if only one reference to this ByteBuffer exists, then extend this + * buffer instead of creating new buffer + * @TODO support list of buffers to avoid expensive joins until absolute + * necessary + */ + public ByteBuffer join(ByteBuffer buf) { + // Extend byte array for new data + int newLength = length + buf.length; + byte newData[] = new byte[newLength]; + + // Copy data from our buffer + System.arraycopy(data, offset, newData, 0, length); + + // Copy data from other buffer + System.arraycopy(buf.data, buf.offset, newData, length, buf.length); + + ByteBuffer newBuf = new ByteBuffer(newData); + + // Copy our (older) metadata to new buffer, because handler might store some + // metadata in buffer, which is pushed back. + if (metadata != null) + newBuf.metadata = new HashMap(metadata); + + return newBuf; + } + + /** + * Copy used portion of buffer to new byte array. Expensive operation. + */ + public byte[] toByteArray() { + return Arrays.copyOfRange(data, offset, offset + length); + } + + public short[] toShortArray() { + if (length % 2 != 0) + throw new ArrayIndexOutOfBoundsException("Length of byte array must be dividable by 2 without remainder. Array length: " + length + ", remainder: " + + (length % 2) + "."); + + short[] buf = new short[length / 2]; + + for (int i = 0, j = offset; i < buf.length; i++, j += 2) { + buf[i] = (short) ((data[j + 0] & 0xFF) | ((data[j + 1] & 0xFF) << 8)); + } + return buf; + } + + /** + * Return array of int's in little endian order. + */ + public int[] toIntLEArray() { + if (length % 4 != 0) + throw new ArrayIndexOutOfBoundsException("Length of byte array must be dividable by 4 without remainder. Array length: " + length + ", remainder: " + + (length % 4) + "."); + + int[] buf = new int[length / 4]; + + for (int i = 0, j = offset; i < buf.length; i++, j += 4) { + buf[i] = (data[j + 0] & 0xFF) | ((data[j + 1] & 0xFF) << 8) | ((data[j + 2] & 0xFF) << 16) | ((data[j + 3] & 0xFF) << 24); + } + return buf; + } + + /** + * Return array of int's in little endian order, but use only 3 bytes per int (3RGB). + */ + public int[] toInt3LEArray() { + if (length % 3 != 0) + throw new ArrayIndexOutOfBoundsException("Length of byte array must be dividable by 3 without remainder. Array length: " + length + ", remainder: " + + (length % 3) + "."); + + int[] buf = new int[length / 3]; + + for (int i = 0, j = offset; i < buf.length; i++, j += 3) { + buf[i] = (data[j + 0] & 0xFF) | ((data[j + 1] & 0xFF) << 8) | ((data[j + 2] & 0xFF) << 16); + } + return buf; + } + + /** + * Helper method for test cases to convert array of byte arrays to array of + * byte buffers. + */ + public static ByteBuffer[] convertByteArraysToByteBuffers(byte[]... bas) { + ByteBuffer bufs[] = new ByteBuffer[bas.length]; + + int i = 0; + for (byte[] ba : bas) { + bufs[i++] = new ByteBuffer(ba); + } + return bufs; + } + + /** + * Read signed int in network order. Cursor is advanced by 4. + */ + public int readSignedInt() { + if (cursor + 4 > length) + throw new ArrayIndexOutOfBoundsException("Cannot read 4 bytes from this buffer: " + this + "."); + + int result = (((data[offset + cursor] & 0xff) << 24) + ((data[offset + cursor + 1] & 0xff) << 16) + ((data[offset + cursor + 2] & 0xff) << 8) + (data[offset + + cursor + 3] & 0xff)); + cursor += 4; + return result; + } + + /** + * Read signed int in little endian order. Cursor is advanced by 4. + */ + public int readSignedIntLE() { + if (cursor + 4 > length) + throw new ArrayIndexOutOfBoundsException("Cannot read 4 bytes from this buffer: " + this + "."); + + int result = (((data[offset + cursor + 3] & 0xff) << 24) + ((data[offset + cursor + 2] & 0xff) << 16) + ((data[offset + cursor + 1] & 0xff) << 8) + (data[offset + + cursor] & 0xff)); + cursor += 4; + return result; + } + + /** + * Read unsigned int in little endian order. Cursor is advanced by 4. + */ + public long readUnsignedIntLE() { + if (cursor + 4 > length) + throw new ArrayIndexOutOfBoundsException("Cannot read 4 bytes from this buffer: " + this + "."); + + long result = (((long) (data[offset + cursor + 3] & 0xff) << 24) + ((long) (data[offset + cursor + 2] & 0xff) << 16) + + ((long) (data[offset + cursor + 1] & 0xff) << 8) + (long) (data[offset + cursor] & 0xff)); + cursor += 4; + return result; + } + + /** + * Read signed int in variable length format. Top most bit of each byte + * indicates that next byte contains additional bits. Cursor is advanced by + * 1-5 bytes. + */ + public int readVariableSignedIntLE() { + int result = 0; + + for (int shift = 0; shift < 32; shift += 7) { + int b = readUnsignedByte(); + result |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) + break; + } + + return result; + } + + /** + * Read unsigned int in network order in variable length format. Cursor is + * advanced by 1 to 4 bytes. + * + * Two most significant bits of first byte indicates length of field: 0x00 - 1 + * byte, 0x40 - 2 bytes, 0x80 - 3 bytes, 0xc0 - 4 bytes. + * + * @see http://msdn.microsoft.com/en-us/library/cc241614.aspx + */ + public int readEncodedUnsignedInt() { + int firstByte = readUnsignedByte(); + int result; + switch (firstByte & 0xc0) { + default: + case 0x00: + result = firstByte & 0x3f; + break; + case 0x40: + result = (firstByte & 0x3f << 8) | readUnsignedByte(); + break; + case 0x80: + result = (((firstByte & 0x3f << 8) | readUnsignedByte()) << 8) | readUnsignedByte(); + break; + case 0xc0: + result = ((((firstByte & 0x3f << 8) | readUnsignedByte()) << 8) | readUnsignedByte() << 8) | readUnsignedByte(); + break; + } + + return result; + } + + /** + * Read unsigned byte. Cursor is advanced by 1. + */ + public int readUnsignedByte() { + if (cursor + 1 > length) + throw new ArrayIndexOutOfBoundsException("Cannot read 1 byte from this buffer: " + this + "."); + + int b = data[offset + cursor] & 0xff; + cursor += 1; + return b; + } + + /** + * Read signed byte. Cursor is advanced by 1. + */ + public byte readSignedByte() { + if (cursor + 1 > length) + throw new ArrayIndexOutOfBoundsException("Cannot read 1 byte from this buffer: " + this + "."); + + byte b = data[offset + cursor]; + cursor += 1; + return b; + } + + /** + * Read unsigned short in network order. Cursor is advanced by 2. + */ + public int readUnsignedShort() { + if (cursor + 2 > length) + throw new ArrayIndexOutOfBoundsException("Cannot read 2 bytes from this buffer: " + this + "."); + + int result = (((data[offset + cursor] & 0xff) << 8) | (data[offset + cursor + 1] & 0xff)); + cursor += 2; + return result; + } + + /** + * Read signed short in little endian order. Cursor is advanced by 2. + */ + public short readSignedShortLE() { + if (cursor + 2 > length) + throw new ArrayIndexOutOfBoundsException("Cannot read 2 bytes from this buffer: " + this + "."); + + short result = (short) (((data[offset + cursor + 1] & 0xff) << 8) | (data[offset + cursor] & 0xff)); + cursor += 2; + return result; + } + + /** + * Read unsigned short in network order in variable length format. Cursor is + * advanced by 1 or 2 bytes. + * + * Most significant bit of first byte indicates length of field: 0 - 1 byte, 1 + * - 2 bytes. + */ + public int readVariableUnsignedShort() { + int firstByte = readUnsignedByte(); + + int result; + if ((firstByte & 0x80) == 0) + result = firstByte & 0x7f; + else { + int secondByte = readUnsignedByte(); + result = (((firstByte & 0x7f) << 8) | secondByte); + } + + return result; + } + + /** + * Read unsigned short in little endian order. Cursor is advanced by 2. + */ + public int readUnsignedShortLE() { + if (cursor + 2 > length) + throw new ArrayIndexOutOfBoundsException("Cannot read 2 bytes from this buffer: " + this + "."); + + int result = (((data[offset + cursor + 1] & 0xff) << 8) | (data[offset + cursor] & 0xff)); + cursor += 2; + return result; + } + + /** + * Read unsigned short in network order in variable length format. Cursor is + * advanced by 1 or 2 bytes. + * + * Most significant bit of first byte indicates length of field: 0x00 - 1 + * byte, 0x80 - 2 bytes. + * + * @see http://msdn.microsoft.com/en-us/library/cc241612.aspx + */ + public int readEncodedUnsignedShort() { + int firstByte = readUnsignedByte(); + + int result; + if ((firstByte & 0x80) == 0) + result = firstByte & 0x7f; + else { + int secondByte = readUnsignedByte(); + result = (((firstByte & 0x7f) << 8) | secondByte); + } + + return result; + } + + /** + * Read signed short in network order in variable length format. Cursor is + * advanced by 1 or 2 bytes. + * + * Most significant bit of first byte indicates length of field: 0x00 - 1 + * byte, 0x80 - 2 bytes. Second most significant bit indicates is value + * positive or negative. + * + * @see http://msdn.microsoft.com/en-us/library/cc241613.aspx + */ + public int readEncodedSignedShort() { + int firstByte = readUnsignedByte(); + + int result; + if ((firstByte & 0x80) == 0) + result = firstByte & 0x3f; + else { + int secondByte = readUnsignedByte(); + result = (((firstByte & 0x3f) << 8) | secondByte); + } + + if ((firstByte & 0x40) > 0) + return -result; + else + return result; + } + + /** + * Read signed long in little endian order. Cursor is advanced by 8 bytes. + */ + public long readSignedLongLE() { + return (((long) readSignedIntLE()) & 0xffFFffFFL) | (((long) readSignedIntLE()) << 32); + } + + /** + * Read string from buffer. Cursor is advanced by string length. + */ + public String readString(int length, Charset charset) { + if (cursor + length > this.length) + throw new ArrayIndexOutOfBoundsException("Cannot read " + length + " bytes from this buffer: " + this + "."); + + String string = new String(data, offset + cursor, length, charset); + cursor += length; + return string; + } + + /** + * Get bytes as lightweight slice. Cursor is advanced by data length. + */ + public ByteBuffer readBytes(int dataLength) { + if (cursor + dataLength > length) + throw new ArrayIndexOutOfBoundsException("Cannot read " + dataLength + " bytes from this buffer: " + this + "."); + + ByteBuffer slice = slice(cursor, dataLength, false); + cursor += dataLength; + return slice; + } + + /** + * Cursor is advanced by given number of bytes. + */ + public void skipBytes(int numOfBytes) { + if (cursor + numOfBytes > length) + throw new ArrayIndexOutOfBoundsException("Cannot read " + numOfBytes + " bytes from this buffer: " + this + "."); + + cursor += numOfBytes; + } + + /** + * Write byte. Cursor is advanced by 1. + */ + public void writeByte(int b) { + if (cursor + 1 > length) + throw new ArrayIndexOutOfBoundsException("Cannot write 1 byte to this buffer: " + this + "."); + + data[offset + cursor] = (byte) b; + cursor += 1; + } + + /** + * Write short in network order. Cursor is advanced by 2. + */ + public void writeShort(int x) { + if (cursor + 2 > length) + throw new ArrayIndexOutOfBoundsException("Cannot write 2 bytes to this buffer: " + this + "."); + + data[offset + cursor] = (byte) (x >> 8); + data[offset + cursor + 1] = (byte) x; + cursor += 2; + } + + /** + * Write short in little endian order. Cursor is advanced by 2. + */ + public void writeShortLE(int x) { + if (cursor + 2 > length) + throw new ArrayIndexOutOfBoundsException("Cannot write 2 bytes to this buffer: " + this + "."); + + data[offset + cursor + 1] = (byte) (x >> 8); + data[offset + cursor] = (byte) x; + cursor += 2; + } + + /** + * Write int in network order. Cursor is advanced by 4. + */ + public void writeInt(int i) { + if (cursor + 4 > length) + throw new ArrayIndexOutOfBoundsException("Cannot write 4 bytes to this buffer: " + this + "."); + + data[offset + cursor] = (byte) (i >> 24); + data[offset + cursor + 1] = (byte) (i >> 16); + data[offset + cursor + 2] = (byte) (i >> 8); + data[offset + cursor + 3] = (byte) i; + cursor += 4; + } + + public void writeIntLE(int i) { + if (cursor + 4 > length) + throw new ArrayIndexOutOfBoundsException("Cannot write 4 bytes to this buffer: " + this + "."); + + data[offset + cursor] = (byte) i; + data[offset + cursor + 1] = (byte) (i >> 8); + data[offset + cursor + 2] = (byte) (i >> 16); + data[offset + cursor + 3] = (byte) (i >> 24); + cursor += 4; + } + + /** + * Write int in variable length format. Cursor is advanced by number of bytes + * written (1-5). + * + * Topmost bit of each byte is set to 1 to indicate that next byte has data. + */ + public void writeVariableIntLE(int i) { + while (i != 0) { + // Get lower bits of number + int b = i & 0x7f; + i >>= 7; + + if (i > 0) + // Set topmost bit of byte to indicate that next byte(s) contains + // remainder bits + b |= 0x80; + + writeByte(b); + } + } + + /** + * Write short in variable length format. Cursor is advanced by number of + * bytes written (1-2). + * + * Topmost bit of first byte is set to 1 to indicate that next byte has data. + */ + public void writeVariableShort(int length) { + if (length > 0x7f | length < 0) + writeShort(length | 0x8000); + else + writeByte(length); + } + + /** + * Prepend given data to this byte buffer. + */ + public void prepend(ByteBuffer buf) { + prepend(buf.data, buf.offset, buf.length); + } + + /** + * Prepend given data to this byte buffer. + */ + public void prepend(byte[] data) { + prepend(data, 0, data.length); + } + + /** + * Prepend given data to this byte buffer. + */ + public void prepend(byte[] data, int offset, int length) { + if (!isSoleOwner()) { + throw new RuntimeException("Create full copy of this byte buffer data for modification. refCount: " + refCount + ", parentByteBuffer: " + + parentByteBuffer + "."); + } + + // If there is no enough space for header to prepend + if (!(this.offset >= length)) { + throw new RuntimeException("Reserve data to have enough space for header."); + } + + // Copy header + System.arraycopy(data, offset, this.data, this.offset - length, length); + + // Extend byte range to include header + this.offset -= length; + this.length += length; + this.cursor += length; + } + + public void writeString(String str, Charset charset) { + writeBytes(str.getBytes(charset)); + } + + /** + * Write string of fixed size. When string is shorted, empty space is filled + * with zeros. When string is larger, it is truncated. + */ + public void writeFixedString(int length, String str, Charset charset) { + byte[] bytes = str.getBytes(charset); + writeBytes(bytes, 0, Math.min(bytes.length, length)); + + for (int i = bytes.length; i < length; i++) + writeByte(0); + } + + public void writeBytes(ByteBuffer buf) { + writeBytes(buf.data, buf.offset, buf.length); + } + + public void writeBytes(byte[] bytes) { + writeBytes(bytes, 0, bytes.length); + } + + public void writeBytes(byte[] bytes, int offset, int length) { + System.arraycopy(bytes, offset, this.data, this.offset + this.cursor, length); + cursor += length; + } + + // /** + // * Write BER encoded definite long variant of the ASN.1 length field. + // */ + // public void writeBerLength(int value) { + // int fieldLength; + // if (value > 0xFFffFF) + // fieldLength = 4; + // else if (value > 0xFFff) + // fieldLength = 3; + // else if (value > 0xFF) + // fieldLength = 2; + // else + // fieldLength = 1; + // + // if (cursor + fieldLength + 1 > length) + // throw new ArrayIndexOutOfBoundsException("Cannot write " + (fieldLength + + // 1) + " byte(s) to this buffer: " + this + "."); + // + // // Write length of length field itself + // writeByte(0x80 | fieldLength); + // + // switch (fieldLength) { + // case 4: + // data[offset + cursor++] = (byte) (value >> 24); + // case 3: + // data[offset + cursor++] = (byte) (value >> 16); + // case 2: + // data[offset + cursor++] = (byte) (value >> 8); + // case 1: + // data[offset + cursor++] = (byte) value; + // } + // + // } + + /** + * Reduce length of buffer to cursor position. + */ + public void trimAtCursor() { + length = cursor; + } + + /** + * Rewind cursor to beginning of buffer. + */ + public void rewindCursor() { + cursor = 0; + } + + /** + * Read RGB color in LE order. Cursor is advanced by 3. + * + * @return color as int, with red in lowest octet. + */ + public int readRGBColor() { + return readUnsignedByte() | (readUnsignedByte() << 8) | (readUnsignedByte() << 16); + } + + public void assertThatBufferIsFullyRead() { + if (cursor != length) + throw new RuntimeException("Data in buffer is not read fully. Buf: " + this + "."); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + + int end = offset + length; + for (int i = offset; i < end; i++) + result = 31 * result + data[i]; + + result = prime * result + length; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + + ByteBuffer other = (ByteBuffer) obj; + if (length != other.length) + return false; + + for (int i = 0; i < length; i++) + if (data[offset + i] != other.data[other.offset + i]) + return false; + + return true; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/DataSink.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/DataSink.java new file mode 100644 index 00000000000..e3de289c513 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/DataSink.java @@ -0,0 +1,24 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public interface DataSink { + + void sendData(ByteBuffer buf); + + void sendEvent(Event event, Direction direction); +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/DataSource.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/DataSource.java new file mode 100644 index 00000000000..152be2e960c --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/DataSource.java @@ -0,0 +1,60 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public interface DataSource { + + /** + * Get data from source. + * + * @param block + * if false, then return immediately when no data is available, + * otherwise wait for data + * @return new data or null, when no data is available + */ + ByteBuffer pull(boolean block); + + /** + * Hold data temporary to use at next pull or push. + * + * @param buf + * a data + */ + void pushBack(ByteBuffer buf); + + /** + * Hold data temporary to use at next pull. Don't return abything untill given + * amount of data will be read from source, because data will be pushed back + * anyway. + * + * @param buf + * a data + * @param lengthOfFullPacket + * length of full block of data to read from source + */ + void pushBack(ByteBuffer buf, int lengthOfFullPacket); + + /** + * Send event to pads. + * + * @param event + * a event + * @param direction + * pad direction + */ + void sendEvent(Event event, Direction direction); +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Direction.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Direction.java new file mode 100644 index 00000000000..c9dede88e45 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Direction.java @@ -0,0 +1,21 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public enum Direction { + IN, OUT +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Element.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Element.java new file mode 100644 index 00000000000..c927deafe4d --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Element.java @@ -0,0 +1,120 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.util.Set; + +/** + * Element is for processing of data. It has one or more contact pads, which can + * be wired with other elements using links. + */ +public interface Element { + + /** + * Name of pad for standard input. Should be set in all elements except pure + * sinks. + */ + public static final String STDIN = "stdin"; + + /** + * Name of pad for standard output. Should be set in all elements except pure + * sources. + */ + public static final String STDOUT = "stdout"; + + /** + * Get link connected to given pad. + * + * @param padName + * Standard pads are "stdin" and "stdout". + */ + Link getLink(String padName); + + /** + * Get pads of this element. + */ + Set getPads(Direction direction); + + /** + * Connect link to given pad. + * + * @param padName + * a pad name. Standard pads are "stdin" and "stdout". + */ + void setLink(String padName, Link link, Direction direction); + + /** + * Disconnect link from given pad. + * + * @param padName + * Standard pads are "stdin" and "stdout". + */ + void dropLink(String padName); + + /** + * Pull data from element and handle it. Element should ask one of it input + * pads for data, handle data and push result to it sink(s), if any. + * + * @param block + * block until data will be available, or do a slight delay at least, + * when data is not available + */ + void poll(boolean block); + + /** + * Handle incoming data. + * + * @param buf + * a data + * @param link + * TODO + */ + void handleData(ByteBuffer buf, Link link); + + /** + * Handle event. + * + * @param event + * an event + * @param direction + * if IN, then send event to input pads, when OUT, then send to + * output pads + */ + void handleEvent(Event event, Direction direction); + + /** + * Get element ID. + */ + String getId(); + + /** + * Validate element: check is all required pads are connected. + */ + void validate(); + + /** + * Drop link. + * + * @param link a link to drop + */ + void dropLink(Link link); + + /** + * Drop existing link and replace it by new link. + */ + void replaceLink(Link existingLink, Link newLink); +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Event.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Event.java new file mode 100644 index 00000000000..5e1a3893c52 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Event.java @@ -0,0 +1,33 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public enum Event { + STREAM_START, + STREAM_CLOSE, + + /** + * Upgrade socket to SSL. + */ + SOCKET_UPGRADE_TO_SSL, + + /** + * Switch links to input mode. + */ + LINK_SWITCH_TO_PULL_MODE + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/FakeSink.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/FakeSink.java new file mode 100644 index 00000000000..65fb29e3f0f --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/FakeSink.java @@ -0,0 +1,69 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public class FakeSink extends BaseElement { + + public FakeSink(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Received buf #" + (packetNumber) + " " + buf + "."); + + if (buf == null) + return; + + // Use packetNumber variable to count incoming packets + packetNumber++; + + buf.unref(); + } + + @Override + public String toString() { + return "FakeSink(" + id + ")"; + } + + @Override + public void handleEvent(Event event, Direction direction) { + if (verbose) + System.out.println("[" + this + "] INFO: Event received: " + event + "."); + + } + + /** + * Example. + */ + public static void main(String args[]) { + + Element sink = new FakeSink("sink") { + { + verbose = true; + } + }; + + byte[] data = new byte[] { 1, 2, 3 }; + ByteBuffer buf = new ByteBuffer(data); + sink.setLink(STDIN, new SyncLink(), Direction.IN); + sink.getLink(STDIN).sendData(buf); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/FakeSource.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/FakeSource.java new file mode 100644 index 00000000000..4cf65034a73 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/FakeSource.java @@ -0,0 +1,125 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public class FakeSource extends BaseElement { + + /** + * Delay for null packets in poll method when blocking is requested, in + * milliseconds. + */ + protected long delay = SyncLink.STANDARD_DELAY_FOR_EMPTY_PACKET; + + public FakeSource(String id) { + super(id); + } + + @Override + public void poll(boolean block) { + if (numBuffers > 0 && packetNumber >= numBuffers) { + // Close stream when limit of packets is reached + sendEventToAllPads(Event.STREAM_CLOSE, Direction.OUT); + return; + } + + // Prepare new packet + ByteBuffer buf = initializeData(); + + // Push it to output(s) + pushDataToAllOuts(buf); + + // Make slight delay when blocking input was requested (to avoid + // consuming of 100% in parent loop) + if (block) + delay(); + + } + + /** + * Make slight delay. Should be used when blocking input is requested in pull + * mode, but null packed was returned by input. + */ + protected void delay() { + try { + Thread.sleep(delay); + } catch (InterruptedException e) { + } + } + + /** + * Initialize data. + */ + public ByteBuffer initializeData() { + ByteBuffer buf = new ByteBuffer(incommingBufLength); + + // Set first byte of package to it sequance number + buf.data[buf.offset] = (byte) (packetNumber % 128); + + // Initialize rest of bytes with sequential values, which are + // corresponding with their position in byte buffer + for (int i = buf.offset + 1; i < buf.length; i++) + buf.data[i] = (byte) (i % 128); + + buf.putMetadata(ByteBuffer.SEQUENCE_NUMBER, packetNumber); + buf.putMetadata("src", id); + + return buf; + } + + @Override + public String toString() { + return "FakeSource(" + id + ")"; + } + + public static void main(String args[]) { + + Element fakeSource = new FakeSource("source 3/10/100") { + { + verbose = true; + this.incommingBufLength = 3; + this.numBuffers = 10; + this.delay = 100; + } + }; + + Element fakeSink = new FakeSink("sink") { + { + this.verbose = true; + } + }; + + Element fakeSink2 = new FakeSink("sink2") { + { + this.verbose = true; + } + }; + + Link link = new SyncLink(); + + fakeSource.setLink(STDOUT, link, Direction.OUT); + fakeSink.setLink(STDIN, link, Direction.IN); + + Link link2 = new SyncLink(); + + fakeSource.setLink("out2", link2, Direction.OUT); + fakeSink2.setLink(STDIN, link2, Direction.IN); + + link.run(); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/InputStreamSource.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/InputStreamSource.java new file mode 100644 index 00000000000..b05637f0db0 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/InputStreamSource.java @@ -0,0 +1,194 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +/** + * Source element, which reads data from InputStream. + */ +public class InputStreamSource extends BaseElement { + + protected InputStream is; + protected SocketWrapper socketWrapper; + + public InputStreamSource(String id) { + super(id); + } + + public InputStreamSource(String id, InputStream is) { + super(id); + this.is = is; + } + + public InputStreamSource(String id, SocketWrapper socketWrapper) { + super(id); + this.socketWrapper = socketWrapper; + } + + @Override + public void handleEvent(Event event, Direction direction) { + switch (event) { + case SOCKET_UPGRADE_TO_SSL: + socketWrapper.upgradeToSsl(); + break; + default: + super.handleEvent(event, direction); + } + } + + @Override + public void setLink(String padName, Link link, Direction direction) { + switch (direction) { + case OUT: + super.setLink(padName, link, direction); + + if (is == null) { + // Pause links until data stream will be ready + link.pause(); + } + break; + case IN: + throw new RuntimeException("Cannot assign link to input pad in source element. Element: " + this + ", pad: " + padName + ", link: " + link + "."); + } + } + + public void setInputStream(InputStream is) { + this.is = is; + + // Resume links + resumeLinks(); + } + + private void resumeLinks() { + for (DataSink sink : outputPads.values()) + ((Link) sink).resume(); + } + + /** + * Read data from input stream. + */ + @Override + public void poll(boolean block) { + try { + if (!block && is.available() == 0) { + + if (verbose) + System.out.println("[" + this + "] INFO: No data in stream is available now, returning."); + + return; + } + + // Create buffer of recommended size and with default offset + ByteBuffer buf = new ByteBuffer(incommingBufLength); + + if (verbose) + System.out.println("[" + this + "] INFO: Reading data from stream."); + + int actualLength = is.read(buf.data, buf.offset, buf.data.length - buf.offset); + + if (actualLength < 0) { + if (verbose) + System.out.println("[" + this + "] INFO: End of stream."); + + buf.unref(); + closeStream(); + sendEventToAllPads(Event.STREAM_CLOSE, Direction.OUT); + return; + } + + if (actualLength == 0) { + if (verbose) + System.out.println("[" + this + "] INFO: Empty buffer is read from stream."); + + buf.unref(); + return; + } + + buf.length = actualLength; + + if (verbose) + System.out.println("[" + this + "] INFO: Data read from stream: " + buf + "."); + + pushDataToAllOuts(buf); + + } catch (IOException e) { + System.err.println("[" + this + "] ERROR: " + e.getMessage()); + closeStream(); + } + } + + @Override + protected void onClose() { + closeStream(); + } + + private void closeStream() { + if (verbose) + System.out.println("[" + this + "] INFO: Closing stream."); + + try { + is.close(); + } catch (IOException e) { + } + try { + sendEventToAllPads(Event.STREAM_CLOSE, Direction.OUT); + } catch (Exception e) { + } + } + + @Override + public String toString() { + return "InputStreamSource(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + InputStream is = new ByteArrayInputStream(new byte[] { 1, 2, 3 }); + + InputStreamSource source = new InputStreamSource("source") { + { + verbose = true; + } + }; + Element fakeSink = new FakeSink("sink") { + { + verbose = true; + } + }; + + Link link = new SyncLink() { + { + verbose = true; + } + }; + + source.setLink(STDOUT, link, Direction.OUT); + fakeSink.setLink(STDIN, link, Direction.IN); + + source.setInputStream(is); + + link.sendEvent(Event.STREAM_START, Direction.OUT); + link.run(); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Link.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Link.java new file mode 100644 index 00000000000..bd970f08afd --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Link.java @@ -0,0 +1,66 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +/** + * Link is wire between two elements. It always must contain source and sink + * elements. + */ +public interface Link extends DataSource, DataSink, Runnable { + + /** + * Wire this link with given sink. + * + * @param sink + * an Element + * @return same sink element, for chaining + */ + Element setSink(Element sink); + + /** + * Wire this link with given source. + * + * @param source + * an Element + * @return same source element, for chaining + */ + Element setSource(Element source); + + Element getSource(); + + Element getSink(); + + /** + * Hold all data in cache, don't pass data to sink until resumed. + */ + void pause(); + + /** + * Resume transfer. + */ + void resume(); + + /** + * Change mode of operation of this link from push mode to pull mode. + */ + void setPullMode(); + + /** + * Drop this link. + */ + void drop(); +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/MockSink.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/MockSink.java new file mode 100644 index 00000000000..ce9fdf91078 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/MockSink.java @@ -0,0 +1,111 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.util.Arrays; + +/** + * Compare incoming packets with expected packets. + */ +public class MockSink extends BaseElement { + + protected ByteBuffer bufs[] = null; + + public MockSink(String id) { + super(id); + } + + public MockSink(String id, ByteBuffer bufs[]) { + super(id); + this.bufs = bufs; + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Received buf #" + (packetNumber) + " " + buf + "."); + + if (buf == null) + return; + + if (packetNumber >= bufs.length) + throw new AssertionError("[" + this + "] Incoming buffer #" + packetNumber + " is not expected. Number of expected buffers: " + bufs.length + + ", unexpected buffer: " + buf + "."); + + // Compare incoming buffer with expected buffer + if (!Arrays.equals(bufs[packetNumber].toByteArray(), buf.toByteArray())) + throw new AssertionError("[" + this + "] Incoming buffer #" + packetNumber + " is not equal to expected buffer.\n Actual bufer: " + buf + + ",\n expected buffer: " + bufs[packetNumber] + "."); + + if (verbose) + System.out.println("[" + this + "] INFO: buffers are equal."); + + // Use packetNumber variable to count incoming packets + packetNumber++; + + buf.unref(); + } + + @Override + protected void onClose() { + super.onClose(); + + if (packetNumber != bufs.length) + throw new AssertionError("[" + this + "] Number of expected buffers: " + bufs.length + ", number of actual buffers: " + packetNumber + "."); + } + + @Override + public String toString() { + return "MockSink(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + + Element mockSource = new MockSource("source") { + { + this.bufs = new ByteBuffer[] { new ByteBuffer(new byte[] { 1, 1, 2, 3, 4, 5 }), new ByteBuffer(new byte[] { 2, 1, 2, 3, 4 }), + new ByteBuffer(new byte[] { 3, 1, 2, 3 }), new ByteBuffer(new byte[] { 4, 1, 2 }), new ByteBuffer(new byte[] { 5, 1 }) }; + this.verbose = true; + this.delay = 100; + this.numBuffers = this.bufs.length; + } + }; + + Element mockSink = new MockSink("sink") { + { + this.bufs = new ByteBuffer[] { new ByteBuffer(new byte[] { 1, 1, 2, 3, 4, 5 }), new ByteBuffer(new byte[] { 2, 1, 2, 3, 4 }), + new ByteBuffer(new byte[] { 3, 1, 2, 3 }), new ByteBuffer(new byte[] { 4, 1, 2 }), new ByteBuffer(new byte[] { 5, 1 }) }; + this.verbose = true; + } + }; + + Link link = new SyncLink() { + { + this.verbose = true; + } + }; + + mockSource.setLink(STDOUT, link, Direction.OUT); + mockSink.setLink(STDIN, link, Direction.IN); + + link.run(); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/MockSource.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/MockSource.java new file mode 100644 index 00000000000..db47db2ca50 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/MockSource.java @@ -0,0 +1,88 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public class MockSource extends FakeSource { + + protected ByteBuffer bufs[] = null; + + public MockSource(String id) { + super(id); + } + + public MockSource(String id, ByteBuffer bufs[]) { + super(id); + this.bufs = bufs; + } + + /** + * Initialize data. + */ + @Override + public ByteBuffer initializeData() { + if (packetNumber >= bufs.length) { + sendEventToAllPads(Event.STREAM_CLOSE, Direction.OUT); + return null; + } + + ByteBuffer buf = bufs[packetNumber]; + + buf.putMetadata(ByteBuffer.SEQUENCE_NUMBER, packetNumber); + return buf; + } + + @Override + public void handleEvent(Event event, Direction direction) { + if (verbose) + System.out.println("[" + this + "] INFO: Event received: " + event + "."); + + } + + @Override + public String toString() { + return "MockSource(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + + Element mockSource = new MockSource("source") { + { + this.bufs = new ByteBuffer[] { new ByteBuffer(new byte[] { 1, 1, 2, 3, 4, 5 }), new ByteBuffer(new byte[] { 2, 1, 2, 3, 4 }), + new ByteBuffer(new byte[] { 3, 1, 2, 3 }), new ByteBuffer(new byte[] { 4, 1, 2 }), new ByteBuffer(new byte[] { 5, 1 }) }; + this.verbose = true; + this.delay = 100; + // this.numBuffers = this.bufs.length; + } + }; + + Element fakeSink = new FakeSink("sink") { + { + this.verbose = true; + } + }; + + Link link = new SyncLink(); + + mockSource.setLink(STDOUT, link, Direction.OUT); + fakeSink.setLink(STDIN, link, Direction.IN); + + link.run(); + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/OneTimeSwitch.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/OneTimeSwitch.java new file mode 100644 index 00000000000..a7d48482621 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/OneTimeSwitch.java @@ -0,0 +1,133 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +/** + * One time switch for handshake and initialization stages. + * + * At beginning, element handles data internally, sending output to "otout" pad. + * After switchOff() method is called, element drops its links, so packets from + * "stdin" pad are forwarded directly to "stdout" pad, without processing. + * + * Event STREAM_START is captured by this element and not propagated further. + * When switchOff() method is called, event STREAM_START is generated and sent + * to "stdout". + */ +public abstract class OneTimeSwitch extends BaseElement { + + /** + * One-time out - name of output pad for one time logic. By default, output + * directly to socket. + */ + public static final String OTOUT = "otout"; + + private boolean switched = false; + + public OneTimeSwitch(String id) { + super(id); + declarePads(); + } + + protected void declarePads() { + inputPads.put(STDIN, null); + outputPads.put(OTOUT, null); + outputPads.put(STDOUT, null); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (switched) + throw new RuntimeException(this + " element is switched off and must not receive any data or events anymore."); + + if (buf == null) + return; + + handleOneTimeData(buf, link); + } + + public void pushDataToOTOut(ByteBuffer buf) { + if (verbose) + System.out.println("[" + this + "] INFO: Sending data: " + buf + "."); + + outputPads.get(OTOUT).sendData(buf); + } + + /** + * Switch this element off. Pass data directly to main output(s). + */ + public void switchOff() { + if (verbose) + System.out.println("[" + this + "] INFO: Switching OFF."); + + switched = true; + verbose = false; + + // Rewire links: drop otout link, replace stdout link by stdin to send data + // directly to stdout + Link stdout = (Link) outputPads.get(STDOUT); + Link stdin = (Link) inputPads.get(STDIN); + Link otout = (Link) outputPads.get(OTOUT); + + otout.drop(); + + // Wake up next peer(s) + sendEventToAllPads(Event.STREAM_START, Direction.OUT); + + stdin.setSink(null); + inputPads.remove(STDIN); + + Element nextPeer = stdout.getSink(); + nextPeer.replaceLink(stdout, stdin); + stdout.drop(); + + for (Object link : inputPads.values().toArray()) + ((Link) link).drop(); + for (Object link : outputPads.values().toArray()) + ((Link) link).drop(); + + } + + public void switchOn() { + if (verbose) + System.out.println("[" + this + "] INFO: Switching ON."); + + switched = false; + } + + /** + * Override this method to handle one-time packet(s) at handshake or + * initialization stages. Execute method @see switchRoute() when this method + * is no longer necessary. + */ + protected abstract void handleOneTimeData(ByteBuffer buf, Link link); + + @Override + public void handleEvent(Event event, Direction direction) { + if (event == Event.STREAM_START) { + if (verbose) + System.out.println("[" + this + "] INFO: Event " + event + " is received."); + + switchOn(); + + // Execute this element onStart(), but do not propagate event further, + // to not wake up next elements too early + onStart(); + } else + super.handleEvent(event, direction); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Order.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Order.java new file mode 100644 index 00000000000..1d63850d9ca --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Order.java @@ -0,0 +1,23 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +public class Order { + + public Object type; + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/OutputStreamSink.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/OutputStreamSink.java new file mode 100644 index 00000000000..d1aa5ce4aca --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/OutputStreamSink.java @@ -0,0 +1,153 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +public class OutputStreamSink extends BaseElement { + + protected OutputStream os; + protected SocketWrapper socketWrapper; + + public OutputStreamSink(String id) { + super(id); + } + + public OutputStreamSink(String id, OutputStream os) { + super(id); + this.os = os; + } + + public OutputStreamSink(String id, SocketWrapper socketWrapper) { + super(id); + this.socketWrapper = socketWrapper; + } + + public void setOutputStream(OutputStream os) { + this.os = os; + // Resume links + resumeLinks(); + } + + /** + * Send incoming data to stream. + */ + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + try { + if (verbose) + System.out.println("[" + this + "] INFO: Writing data to stream: " + buf + "."); + + os.write(buf.data, buf.offset, buf.length); + os.flush(); + } catch (IOException e) { + System.err.println("[" + this + "] ERROR: " + e.getMessage()); + closeStream(); + } + } + + @Override + public void handleEvent(Event event, Direction direction) { + switch (event) { + case SOCKET_UPGRADE_TO_SSL: + socketWrapper.upgradeToSsl(); + break; + default: + super.handleEvent(event, direction); + } + } + + @Override + public void setLink(String padName, Link link, Direction direction) { + switch (direction) { + case IN: + super.setLink(padName, link, direction); + + if (os == null) + // Pause links until data stream will be ready + link.pause(); + break; + case OUT: + throw new RuntimeException("Cannot assign link to output pad in sink element. Element: " + this + ", pad: " + padName + ", link: " + link + "."); + } + } + + private void resumeLinks() { + for (DataSource source : inputPads.values()) + ((Link) source).resume(); + } + + @Override + protected void onClose() { + closeStream(); + } + + private void closeStream() { + if (verbose) + System.out.println("[" + this + "] INFO: Closing stream."); + + try { + os.close(); + } catch (IOException e) { + } + try { + sendEventToAllPads(Event.STREAM_CLOSE, Direction.IN); + } catch (Exception e) { + } + } + + @Override + public String toString() { + return "OutputStreamSink(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + Element source = new FakeSource("source") { + { + this.verbose = true; + this.numBuffers = 3; + this.incommingBufLength = 5; + this.delay = 100; + } + }; + + OutputStreamSink sink = new OutputStreamSink("sink") { + { + verbose = true; + } + }; + + Link link = new SyncLink(); + + source.setLink(STDOUT, link, Direction.OUT); + sink.setLink(STDIN, link, Direction.IN); + + sink.setOutputStream(new ByteArrayOutputStream()); + + link.sendEvent(Event.STREAM_START, Direction.IN); + link.run(); + + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Pipeline.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Pipeline.java new file mode 100644 index 00000000000..c369350cf38 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Pipeline.java @@ -0,0 +1,91 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +/** + * Pipeline groups multiple elements. + */ +public interface Pipeline extends Element { + + static final String IN = Direction.IN.toString(); + static final String OUT = Direction.OUT.toString(); + + /** + * Add elements to pipeline. + * + * @param elements + */ + void add(Element... elements); + + /** + * Add elements to pipeline and link them in given order. + * + * @param elements + */ + void addAndLink(Element... elements); + + /** + * Link elements in given order using SyncLink. Element name can have prefix + * "PADNAME< " or/and suffix " >PADNAME" to use given named pads instead of + * "stdin" and "stdout". I.e. link("foo", "bar", "baz"); is equal + * to link("foo >stdin", "stdout< bar >stdin", "stdout< baz"); . + * + * Special elements "IN" and "OUT" are pointing to pipeline outer interfaces, + * so when pipeline will be connected with other elements, outside of this + * pipeline, they will be connected to IN and OUT elements. + * + * Example: + * + *
+   * pipeline.link("IN", "foo", "bar", "OUT");
+   * // Make additional branch from foo to baz, and then to OUT
+   * pipeline.link("foo >baz_out", "baz", "baz_in< OUT");
+   * 
+ * + * @param elements + * elements to link + */ + void link(String... elements); + + /** + * Get element by name. + * + * @return an element + */ + Element get(String elementName); + + /** + * Get link by element name and pad name. + */ + Link getLink(String elementName, String padName); + + /** + * Set link by element name and pad name. Allows to link external elements + * into internal elements of pipeline. Special elements "IN" and "OUT" are + * pointing to pipeline outer interfaces. + */ + void setLink(String elementName, String padName, Link link, Direction direction); + + /** + * Get link connected to given pad in given element and run it main loop. + * @param separateThread + * set to true to start main loop in separate thread. + * @param waitForStartEvent TODO + */ + void runMainLoop(String element, String padName, boolean separateThread, boolean waitForStartEvent); + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/PipelineImpl.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/PipelineImpl.java new file mode 100644 index 00000000000..abf132f6aef --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/PipelineImpl.java @@ -0,0 +1,309 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +public class PipelineImpl implements Pipeline { + + protected String id; + protected boolean verbose = System.getProperty("streamer.Pipeline.debug", "false").equals("true"); + + public PipelineImpl(String id) { + this.id = id; + elements = initElementMap(id); + } + + protected Map elements; + + protected HashMap initElementMap(String id) { + HashMap map = new HashMap(); + + map.put(IN, new BaseElement(id + "." + IN)); + map.put(OUT, new BaseElement(id + "." + OUT)); + return map; + } + + @Override + public Link getLink(String padName) { + Link link = elements.get(IN).getLink(padName); + if (link == null) + link = elements.get(OUT).getLink(padName); + return link; + } + + @Override + public Set getPads(Direction direction) { + switch (direction) { + case IN: + return elements.get(IN).getPads(direction); + + case OUT: + return elements.get(OUT).getPads(direction); + } + return null; + } + + @Override + public void validate() { + for (Element element : elements.values()) + element.validate(); + + // Check IN element + { + Element element = get(IN); + int outPadsNumber = element.getPads(Direction.OUT).size(); + int inPadsNumber = element.getPads(Direction.IN).size(); + if ((outPadsNumber | inPadsNumber) > 0 && (outPadsNumber == 0 || inPadsNumber == 0)) + throw new RuntimeException("[ " + this + "] Pads of input element of pipeline are not balanced. Element: " + element + ", output pads: " + + element.getPads(Direction.OUT).toString() + ", input pads: " + element.getPads(Direction.IN).toString() + "."); + } + + // Check OUT element + { + Element element = get(OUT); + int outPadsNumber = element.getPads(Direction.OUT).size(); + int inPadsNumber = element.getPads(Direction.IN).size(); + if ((outPadsNumber | inPadsNumber) > 0 && (outPadsNumber == 0 || inPadsNumber == 0)) + throw new RuntimeException("[ " + this + "] Pads of output element of pipeline are not balanced. Element: " + element + ", output pads: " + + element.getPads(Direction.OUT).toString() + ", input pads: " + element.getPads(Direction.IN).toString() + "."); + } + + } + + @Override + public void dropLink(String padName) { + if (elements.get(IN).getLink(padName) != null) + elements.get(IN).dropLink(padName); + + if (elements.get(OUT).getLink(padName) != null) + elements.get(OUT).dropLink(padName); + } + + @Override + public void dropLink(Link link) { + elements.get(IN).dropLink(link); + elements.get(OUT).dropLink(link); + } + + @Override + public void replaceLink(Link existingLink, Link newLink) { + elements.get(IN).replaceLink(existingLink, newLink); + elements.get(OUT).replaceLink(existingLink, newLink); + } + + @Override + public void setLink(String padName, Link link, Direction direction) { + // Wire links to internal elements instead + elements.get(direction.toString()).setLink(padName, link, direction); + } + + @Override + public void poll(boolean block) { + throw new RuntimeException("Not implemented."); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + get(IN).handleData(buf, link); + } + + @Override + public void handleEvent(Event event, Direction direction) { + switch (direction) { + case IN: + get(IN).handleEvent(event, direction); + break; + case OUT: + get(OUT).handleEvent(event, direction); + break; + } + } + + @Override + public void add(Element... elements) { + for (Element element : elements) { + String id = element.getId(); + + if (this.elements.containsKey(id)) + throw new RuntimeException("This pipeline already contains element with same ID. New element: " + element + ", existing element: " + + this.elements.get(id) + "."); + + this.elements.put(id, element); + } + } + + @Override + public void link(String... elementNames) { + + if (elementNames.length < 2) + throw new RuntimeException("At least two elements are necessary to create link between them."); + + // Parse array of element and pad names + + Element elements[] = new Element[elementNames.length]; + String inputPads[] = new String[elementNames.length]; + String outputPads[] = new String[elementNames.length]; + + int i = 0; + for (String elementName : elementNames) { + if (elementName.contains("< ")) { + inputPads[i] = elementName.substring(0, elementName.indexOf("< ")); + elementName = elementName.substring(elementName.indexOf("< ") + 2); + } else { + inputPads[i] = STDIN; + } + + if (elementName.contains(" >")) { + outputPads[i] = elementName.substring(elementName.indexOf(" >") + 2); + elementName = elementName.substring(0, elementName.indexOf(" >")); + } else { + outputPads[i] = STDOUT; + } + + elements[i] = get(elementName); + + if (elements[i] == null) + throw new RuntimeException("Cannot find element by name in this pipeline. Element name: \"" + elementName + "\" (" + elementNames[i] + "), pipeline: " + + this + "."); + + i++; + } + + // Link elements + for (i = 0; i < elements.length - 1; i++) { + Element leftElement = elements[i]; + Element rightElement = elements[i + 1]; + String leftPad = outputPads[i]; + String rightPad = inputPads[i + 1]; + + String linkId = leftElement.getId() + " >" + leftPad + " | " + rightPad + "< " + rightElement.getId(); + + if (verbose) + System.out.println("[" + this + "] INFO: Linking: " + linkId + "."); + + Link link = new SyncLink(linkId); + leftElement.setLink(leftPad, link, Direction.OUT); + rightElement.setLink(rightPad, link, Direction.IN); + } + } + + @Override + public void addAndLink(Element... elements) { + add(elements); + link(elements); + } + + private void link(Element... elements) { + String elementNames[] = new String[elements.length]; + + int i = 0; + for (Element element : elements) { + elementNames[i++] = element.getId(); + } + + link(elementNames); + } + + @Override + public Element get(String elementName) { + return elements.get(elementName); + } + + @Override + public Link getLink(String elementName, String padName) { + return elements.get(elementName).getLink(padName); + + } + + @Override + public void setLink(String elementName, String padName, Link link, Direction direction) { + elements.get(elementName).setLink(padName, link, direction); + } + + @Override + public String getId() { + return id; + } + + @Override + public void runMainLoop(String elementName, String padName, boolean separateThread, boolean waitForStartEvent) { + validate(); + + Link link = getLink(elementName, padName); + + if (link == null) + throw new NullPointerException("Cannot find link. Element name: " + elementName + ", element: " + get(elementName) + ", pad: " + padName + "."); + + if (!waitForStartEvent) + link.sendEvent(Event.STREAM_START, Direction.OUT); + + if (separateThread) { + Thread thread = new Thread(link); + thread.setDaemon(true); + thread.start(); + } else { + link.run(); + } + } + + @Override + public String toString() { + return "Pipeline(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + // System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + Pipeline pipeline = new PipelineImpl("main"); + + // Create elements + pipeline.add(new FakeSource("source") { + { + this.incommingBufLength = 3; + this.numBuffers = 10; + this.delay = 100; + } + }); + pipeline.add(new BaseElement("tee")); + pipeline.add(new FakeSink("sink") { + { + this.verbose = true; + } + }); + pipeline.add(new FakeSink("sink2") { + { + this.verbose = true; + } + }); + + // Link elements + pipeline.link("source", "tee", "sink"); + pipeline.link("tee >out2", "sink2"); + + // Run main loop + pipeline.runMainLoop("source", STDOUT, false, false); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Queue.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Queue.java new file mode 100644 index 00000000000..7a1734053d9 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/Queue.java @@ -0,0 +1,136 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +/** + * Message queue for safe transfer of packets between threads. + */ +public class Queue extends BaseElement { + + protected LinkedBlockingQueue queue = new LinkedBlockingQueue(); + + public Queue(String id) { + super(id); + } + + @SuppressWarnings("incomplete-switch") + @Override + public void poll(boolean block) { + try { + ByteBuffer buf = null; + if (block) { + buf = queue.take(); + } else { + buf = queue.poll(100, TimeUnit.MILLISECONDS); + } + + if (buf != null) + pushDataToAllOuts(buf); + + } catch (Exception e) { + sendEventToAllPads(Event.STREAM_CLOSE, Direction.OUT); + closeQueue(); + } + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Put incoming data into queue + try { + queue.put(buf); + } catch (Exception e) { + sendEventToAllPads(Event.STREAM_CLOSE, Direction.IN); + closeQueue(); + } + } + + @Override + public void handleEvent(Event event, Direction direction) { + switch (event) { + case LINK_SWITCH_TO_PULL_MODE: + // Do not propagate this event, because this element is boundary between + // threads + break; + default: + super.handleEvent(event, direction); + } + } + + @Override + protected void onClose() { + super.onClose(); + closeQueue(); + } + + private void closeQueue() { + queue.clear(); + queue.add(null); + // Drop queue to indicate that upstream is closed. + // May produce NPE in poll(). + queue = null; + } + + @Override + public String toString() { + return "Queue(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + + Element source1 = new FakeSource("source1") { + { + this.delay = 100; + this.numBuffers = 10; + this.incommingBufLength = 10; + } + }; + + Element source2 = new FakeSource("source2") { + { + this.delay = 100; + this.numBuffers = 10; + this.incommingBufLength = 10; + } + }; + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.add(source1); + pipeline.add(source2); + pipeline.add(new Queue("queue")); + pipeline.add(new FakeSink("sink")); + + // Main flow + pipeline.link("source1", "in1< queue"); + pipeline.link("source2", "in2< queue"); + pipeline.link("queue", "sink"); + + new Thread(pipeline.getLink("source1", STDOUT)).start(); + new Thread(pipeline.getLink("source2", STDOUT)).start(); + pipeline.getLink("sink", STDIN).run(); + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/SocketWrapper.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/SocketWrapper.java new file mode 100644 index 00000000000..2ddf0b635b9 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/SocketWrapper.java @@ -0,0 +1,239 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +import static rdpclient.MockServer.Packet.PacketType.CLIENT; +import static rdpclient.MockServer.Packet.PacketType.SERVER; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.util.HashMap; + +import javax.net.SocketFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; + +import rdpclient.MockServer; +import rdpclient.MockServer.Packet; +import rdpclient.TrustAllX509TrustManager; + +public class SocketWrapper extends PipelineImpl { + + protected InputStreamSource source; + protected OutputStreamSink sink; + protected Socket socket; + protected InetSocketAddress address; + + protected SSLSocket sslSocket; + + //protected String SSL_VERSION_TO_USE = "TLSv1.2"; + /*DEBUG*/protected String SSL_VERSION_TO_USE = "TLSv1"; + + public SocketWrapper(String id) { + super(id); + } + + @Override + protected HashMap initElementMap(String id) { + HashMap map = new HashMap(); + + source = new InputStreamSource(id + "." + OUT, this); + sink = new OutputStreamSink(id + "." + IN, this); + + // Pass requests to read data to socket input stream + map.put(OUT, source); + + // All incoming data, which is sent to this socket wrapper, will be sent + // to socket remote + map.put(IN, sink); + + return map; + } + + /** + * Connect this socket wrapper to remote server and start main loop on + * IputStreamSource stdout link, to watch for incoming data, and + * OutputStreamSink stdin link, to pull for outgoing data. + * + * @param address + * @throws IOException + */ + public void connect(InetSocketAddress address) throws IOException { + this.address = address; + + // Connect socket to server + socket = SocketFactory.getDefault().createSocket(); + try { + socket.connect(address); + + InputStream is = socket.getInputStream(); + source.setInputStream(is); + + OutputStream os = socket.getOutputStream(); + sink.setOutputStream(os); + + // Start polling for data to send to remote sever + runMainLoop(IN, STDIN, true, true); + + // Push incoming data from server to handlers + runMainLoop(OUT, STDOUT, false, false); + + } finally { + socket.close(); + } + } + + @Override + public void handleEvent(Event event, Direction direction) { + switch (event) { + case SOCKET_UPGRADE_TO_SSL: + upgradeToSsl(); + break; + default: + super.handleEvent(event, direction); + break; + } + } + + public void upgradeToSsl() { + + if (sslSocket != null) + // Already upgraded + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Upgrading socket to SSL."); + + try { + // Use most secure implementation of SSL available now. + // JVM will try to negotiate TLS1.2, then will fallback to TLS1.0, if + // TLS1.2 is not supported. + SSLContext sslContext = SSLContext.getInstance(SSL_VERSION_TO_USE); + + // Trust all certificates (FIXME: insecure) + sslContext.init(null, new TrustManager[] { new TrustAllX509TrustManager() }, null); + + SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory(); + sslSocket = (SSLSocket) sslSocketFactory.createSocket(socket, address.getHostString(), address.getPort(), true); + sslSocket.startHandshake(); + + InputStream sis = sslSocket.getInputStream(); + source.setInputStream(sis); + + OutputStream sos = sslSocket.getOutputStream(); + sink.setOutputStream(sos); + + } catch (Exception e) { + throw new RuntimeException("Cannot upgrade socket to SSL: " + e.getMessage(), e); + } + + } + + @Override + public void validate() { + for (Element element : elements.values()) + element.validate(); + + if (get(IN).getPads(Direction.IN).size() == 0) + throw new RuntimeException("[ " + this + "] Input of socket is not connected."); + + if (get(OUT).getPads(Direction.OUT).size() == 0) + throw new RuntimeException("[ " + this + "] Output of socket is not connected."); + + } + + public void shutdown() { + try { + handleEvent(Event.STREAM_CLOSE, Direction.IN); + } catch (Exception e) { + } + try { + handleEvent(Event.STREAM_CLOSE, Direction.OUT); + } catch (Exception e) { + } + try { + if (sslSocket != null) + sslSocket.close(); + } catch (Exception e) { + } + try { + socket.close(); + } catch (Exception e) { + } + } + + @Override + public String toString() { + return "SocketWrapper(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + try { + System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + System.setProperty("rdpclient.MockServer.debug", "true"); + + Pipeline pipeline = new PipelineImpl("echo client"); + + SocketWrapper socketWrapper = new SocketWrapper("socket"); + + pipeline.add(socketWrapper); + pipeline.add(new BaseElement("echo")); + + pipeline.link("socket", "echo", "socket"); + + final byte[] mockData = new byte[] { 0x01, 0x02, 0x03 }; + MockServer server = new MockServer(new Packet[] { new Packet("Server hello") { + { + type = SERVER; + data = mockData; + } + }, new Packet("Client hello") { + { + type = CLIENT; + data = mockData; + } + }, new Packet("Server hello") { + { + type = SERVER; + data = mockData; + } + }, new Packet("Client hello") { + { + type = CLIENT; + data = mockData; + } + } }); + server.start(); + InetSocketAddress address = server.getAddress(); + + socketWrapper.connect(address); + + } catch (IOException e) { + e.printStackTrace(System.err); + } + + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/SyncLink.java b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/SyncLink.java new file mode 100644 index 00000000000..32c14bb947f --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/streamer/SyncLink.java @@ -0,0 +1,402 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package streamer; + +/** + * Link to transfer data in bounds of single thread (synchronized transfer). + * Must not be used to send data to elements served in different threads. + */ +public class SyncLink implements Link { + + /** + * When null packet is pulled from source element, then make slight delay to + * avoid consuming of 100% of CPU in main loop in cases when link is pauses or + * source element cannot produce data right now. + */ + protected static final long STANDARD_DELAY_FOR_EMPTY_PACKET = 10; // Milliseconds + + /** + * Delay for null packets in poll method when blocking is requested, in + * milliseconds. + */ + protected long delay = STANDARD_DELAY_FOR_EMPTY_PACKET; + + /** + * Set to true to print debugging messages. + */ + protected boolean verbose = System.getProperty("streamer.Link.debug", "false").equals("true");; + + /** + * ID of this link. + */ + protected String id = null; + + /** + * Buffer with data to hold because link is paused, or data is pushed back. + */ + protected ByteBuffer cacheBuffer = null; + + /** + * Size of expected packet. Data must be hold in link until full packet will + * be read. + */ + protected int expectedPacketSize = 0; + + /** + * Number of packets and packet header transferred to element. + */ + protected int packetNumber = 0; + + /** + * Set to true to hold all data in link until it will be set to false again. + */ + protected boolean paused = false; + + /** + * Element to pull data from, when in pull mode. + */ + protected Element source = null; + + /** + * Element to send data to in both pull and push modes. + */ + protected Element sink = null; + + /** + * When in loop, indicates that loop must be stopped. + * + * @see run() + */ + private boolean shutdown = false; + + /** + * Indicates that event STREAM_START is passed over this link, so main loop + * can be started to pull data from source element. + */ + protected boolean start; + + /** + * Operate in pull mode. + */ + protected boolean pullMode; + + public SyncLink() { + } + + public SyncLink(String id) { + this.id = id; + } + + @Override + public void pushBack(ByteBuffer buf) { + if (verbose) + System.out.println("[" + this + "] INFO: Buffer pushed back: " + buf + "."); + + if (cacheBuffer != null) { + ByteBuffer tmp = cacheBuffer.join(buf); + cacheBuffer.unref(); + cacheBuffer = tmp; + } else { + cacheBuffer = buf; + cacheBuffer.ref(); + } + + resetCursor(); + } + + private void resetCursor() { + // Reset cursor + cacheBuffer.cursor = 0; + } + + @Override + public void pushBack(ByteBuffer buf, int lengthOfFullPacket) { + pushBack(buf); + expectedPacketSize = lengthOfFullPacket; + } + + @Override + public String toString() { + return "SyncLink(" + ((id != null) ? id + ", " : "") + source + ":" + sink + ")"; + } + + /** + * Push data to sink. Call with null to push cached data. + */ + @Override + public void sendData(ByteBuffer buf) { + if (!paused && pullMode) + throw new RuntimeException("[" + this + "] ERROR: link is not in push mode."); + + if (verbose) + System.out.println("[" + this + "] INFO: Incoming buffer: " + buf + "."); + + if (buf == null && cacheBuffer == null) + return; + + if (cacheBuffer != null && buf != null) { + // Join old data with fresh data + buf = cacheBuffer.join(buf); + cacheBuffer.unref(); + cacheBuffer = buf; + } + + // Store buffer in cache field to simplify following loop + if (buf != null) + cacheBuffer = buf; + + // When data pushed back and length of data is less than length of full + // packet, then feed data to sink element immediately + while (cacheBuffer != null) { + if (paused) { + if (verbose) + System.out.println("[" + this + "] INFO: Transfer is paused. Data in cache buffer: " + cacheBuffer + "."); + + // Wait until rest of packet will be read + return; + } + + if (expectedPacketSize > 0 && cacheBuffer.length < expectedPacketSize) { + if (verbose) + System.out.println("[" + this + "] INFO: Transfer is suspended because available data is less than expected packet size. Expected packet size: " + + expectedPacketSize + ", data in cache buffer: " + cacheBuffer + "."); + + // Wait until rest of packet will be read + return; + } + + // Full packet or packet header is read, feed it to element + buf = cacheBuffer; + cacheBuffer = null; + expectedPacketSize = 0; + packetNumber++; + + if (sink == null) + throw new NullPointerException("[" + this + "] ERROR: Cannot send data to sink: sink is null. Data: " + buf + "."); + + sink.handleData(buf, this); + // cacheBuffer and expectedPacketSize can be changed at this time + } + + } + + @SuppressWarnings("incomplete-switch") + @Override + public void sendEvent(Event event, Direction direction) { + + if (verbose) + System.out.println("[" + this + "] INFO: Event " + event + " is received."); + + // Shutdown main loop (if any) when STREAM_CLOSE event is received. + switch (event) { + case STREAM_START: { + if (!start) + start = true; + else + // Event already sent trough this link + return; + break; + } + case STREAM_CLOSE: { + if (!shutdown) + shutdown = true; + else + // Event already sent trough this link + return; + break; + } + case LINK_SWITCH_TO_PULL_MODE: { + setPullMode(); + break; + } + + } + + switch (direction) { + case IN: + source.handleEvent(event, direction); + break; + case OUT: + sink.handleEvent(event, direction); + break; + } + } + + @Override + public ByteBuffer pull(boolean block) { + if (!pullMode) + throw new RuntimeException("This link is not in pull mode."); + + if (paused) { + if (verbose) + System.out.println("[" + this + "] INFO: Cannot pull, link is paused."); + + // Make slight delay in such case, to avoid consuming 100% of CPU + if (block) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + } + } + + return null; + } + + // If data in cache can be sent immediately, + // then return it instead of asking for more data from source + if (cacheBuffer != null && (expectedPacketSize == 0 || (expectedPacketSize > 0 && cacheBuffer.length >= expectedPacketSize))) { + if (verbose) + System.out.println("[" + this + "] INFO: Data pulled from cache buffer: " + cacheBuffer + "."); + + ByteBuffer tmp = cacheBuffer; + cacheBuffer = null; + return tmp; + } + + // Pause this link, so incoming data will not be sent to sink + // immediately, then ask source element for more data + pause(); + source.poll(block); + resume(); + + // Can return something only when data was stored in buffer + if (cacheBuffer != null && (expectedPacketSize == 0 || (expectedPacketSize > 0 && cacheBuffer.length >= expectedPacketSize))) { + if (verbose) + System.out.println("[" + this + "] INFO: Data pulled from source: " + cacheBuffer + "."); + + ByteBuffer tmp = cacheBuffer; + cacheBuffer = null; + return tmp; + } else { + return null; + } + } + + @Override + public Element setSink(Element sink) { + if (sink != null && this.sink != null) + throw new RuntimeException("This link sink element is already set. Link: " + this + ", new sink: " + sink + ", existing sink: " + this.sink + "."); + + if (sink == null && cacheBuffer != null) + throw new RuntimeException("Cannot drop link: cache is not empty. Link: " + this + ", cache: " + cacheBuffer); + + this.sink = sink; + + return sink; + } + + @Override + public Element setSource(Element source) { + if (this.source != null && source != null) + throw new RuntimeException("This link source element is already set. Link: " + this + ", new source: " + source + ", existing source: " + this.source + + "."); + + this.source = source; + return source; + } + + @Override + public Element getSource() { + return source; + } + + @Override + public Element getSink() { + return sink; + } + + @Override + public void pause() { + if (paused) + throw new RuntimeException("Link is already paused."); + + paused = true; + + } + + @Override + public void resume() { + paused = false; + } + + /** + * Run pull loop to actively pull data from source and push it to sink. It + * must be only one pull loop per thread. + * + * Pull loop will start after event STREAM_START. This link and source element + * incomming links will be switched to pull mode before pull loop will be + * started using event LINK_SWITCH_TO_PULL_MODE. + */ + @Override + public void run() { + // Wait until even STREAM_START will arrive + while (!start) { + delay(); + } + + sendEvent(Event.LINK_SWITCH_TO_PULL_MODE, Direction.IN); + + if (verbose) + System.out.println("[" + this + "] INFO: Starting pull loop."); + + // Pull source in loop + while (!shutdown) { + // Pull data from source element and send it to sink element + ByteBuffer data = pull(true); + if (data != null) + sink.handleData(data, this); + + if (!shutdown && data == null) { + // Make slight delay to avoid consuming of 100% of CPU + delay(); + } + } + + if (verbose) + System.out.println("[" + this + "] INFO: Pull loop finished."); + + } + + protected void delay() { + try { + Thread.sleep(delay); + } catch (InterruptedException e) { + e.printStackTrace(System.err); + throw new RuntimeException("Interrupted in main loop.", e); + } + } + + @Override + public void setPullMode() { + if (verbose) + System.out.println("[" + this + "] INFO: Switching to PULL mode."); + + this.pullMode = true; + } + + @Override + public void drop() { + if (pullMode) + throw new RuntimeException("Cannot drop link in pull mode."); + + if (cacheBuffer != null) + throw new RuntimeException("Cannot drop link when cache conatains data: " + cacheBuffer + "."); + + source.dropLink(this); + sink.dropLink(this); + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/AwtKeyboardEventToVncAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/AwtKeyboardEventToVncAdapter.java new file mode 100644 index 00000000000..5537d24d29b --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/AwtKeyboardEventToVncAdapter.java @@ -0,0 +1,369 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import java.awt.event.KeyEvent; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +import common.KeyOrder; + +public class AwtKeyboardEventToVncAdapter extends BaseElement { + + protected boolean sh = false; + protected boolean caps = false; + protected boolean num = false; + + public AwtKeyboardEventToVncAdapter(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + KeyOrder order = (KeyOrder) buf.getOrder(); + buf.unref(); + + ByteBuffer outBuf = new ByteBuffer(8); + outBuf.writeByte(RfbConstants.CLIENT_KEYBOARD_EVENT); + + outBuf.writeByte((order.pressed) ? RfbConstants.KEY_DOWN : RfbConstants.KEY_UP); + outBuf.writeShort(0); // padding + outBuf.writeInt(map_en_us(order)); + + pushDataToAllOuts(outBuf); + } + + /** + * Return key scan code (in lower byte) and extended flags (in second byte). + */ + private int map_en_us(KeyOrder order) { + + switch (order.event.getKeyCode()) { + // Functional keys + case KeyEvent.VK_ESCAPE: + return 0xff1b; + case KeyEvent.VK_F1: + return 0xffbe; + case KeyEvent.VK_F2: + return 0xffbf; + case KeyEvent.VK_F3: + return 0xffc0; + case KeyEvent.VK_F4: + return 0xffc1; + case KeyEvent.VK_F5: + return 0xffc2; + case KeyEvent.VK_F6: + return 0xffc3; + case KeyEvent.VK_F7: + return 0xffc4; + case KeyEvent.VK_F8: + return 0xffc5; + case KeyEvent.VK_F9: + return 0xffc6; + case KeyEvent.VK_F10: + return 0xffc7; + case KeyEvent.VK_F11: + return 0xffc8; + case KeyEvent.VK_F12: + return 0xffc9; + + // Row #1 + case KeyEvent.VK_BACK_QUOTE: + return (sh) ? '~' : '`'; + case KeyEvent.VK_1: + return (sh) ? '!' : '1'; + case KeyEvent.VK_2: + return (sh) ? '@' : '2'; + case KeyEvent.VK_3: + return (sh) ? '#' : '3'; + case KeyEvent.VK_4: + return (sh) ? '$' : '4'; + case KeyEvent.VK_5: + return (sh) ? '%' : '5'; + case KeyEvent.VK_6: + return (sh) ? '^' : '6'; + case KeyEvent.VK_7: + return (sh) ? '&' : '7'; + case KeyEvent.VK_8: + return (sh) ? '*' : '8'; + case KeyEvent.VK_9: + return (sh) ? '(' : '9'; + case KeyEvent.VK_0: + return (sh) ? ')' : '0'; + case KeyEvent.VK_MINUS: + return (sh) ? '_' : '-'; + case KeyEvent.VK_EQUALS: + return (sh) ? '+' : '='; + case KeyEvent.VK_BACK_SPACE: + return 0xff08; + + // Row #2 + case KeyEvent.VK_TAB: + return 0xff09; + case KeyEvent.VK_Q: + return (sh ^ caps) ? 'Q' : 'q'; + case KeyEvent.VK_W: + return (sh ^ caps) ? 'W' : 'w'; + case KeyEvent.VK_E: + return (sh ^ caps) ? 'E' : 'e'; + case KeyEvent.VK_R: + return (sh ^ caps) ? 'R' : 'r'; + case KeyEvent.VK_T: + return (sh ^ caps) ? 'T' : 't'; + case KeyEvent.VK_Y: + return (sh ^ caps) ? 'Y' : 'y'; + case KeyEvent.VK_U: + return (sh ^ caps) ? 'U' : 'u'; + case KeyEvent.VK_I: + return (sh ^ caps) ? 'I' : 'i'; + case KeyEvent.VK_O: + return (sh ^ caps) ? 'O' : 'o'; + case KeyEvent.VK_P: + return (sh ^ caps) ? 'P' : 'p'; + case KeyEvent.VK_OPEN_BRACKET: + return (sh) ? '{' : '['; + case KeyEvent.VK_CLOSE_BRACKET: + return (sh) ? '{' : ']'; + case KeyEvent.VK_ENTER: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_STANDARD: + return 0xff0d; + case KeyEvent.KEY_LOCATION_NUMPAD: + return 0xff8d; + } + + // Row #3 + case KeyEvent.VK_CAPS_LOCK: + if (order.pressed) + caps = !caps; + return 0xFFE5; + case KeyEvent.VK_A: + return (sh ^ caps) ? 'A' : 'a'; + case KeyEvent.VK_S: + return (sh ^ caps) ? 'S' : 's'; + case KeyEvent.VK_D: + return (sh ^ caps) ? 'D' : 'd'; + case KeyEvent.VK_F: + return (sh ^ caps) ? 'F' : 'f'; + case KeyEvent.VK_G: + return (sh ^ caps) ? 'G' : 'g'; + case KeyEvent.VK_H: + return (sh ^ caps) ? 'H' : 'h'; + case KeyEvent.VK_J: + return (sh ^ caps) ? 'J' : 'j'; + case KeyEvent.VK_K: + return (sh ^ caps) ? 'K' : 'k'; + case KeyEvent.VK_L: + return (sh ^ caps) ? 'L' : 'l'; + case KeyEvent.VK_SEMICOLON: + return (sh) ? ':' : ';'; + case KeyEvent.VK_QUOTE: + return (sh) ? '"' : '\''; + + // Row #4 + case KeyEvent.VK_SHIFT: + sh = !sh; + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xffe1; + case KeyEvent.KEY_LOCATION_RIGHT: + return 0xffe2; + } + case KeyEvent.VK_BACK_SLASH: + return (sh) ? '|' : '\\'; + case KeyEvent.VK_Z: + return (sh ^ caps) ? 'Z' : 'z'; + case KeyEvent.VK_X: + return (sh ^ caps) ? 'X' : 'x'; + case KeyEvent.VK_C: + return (sh ^ caps) ? 'C' : 'c'; + case KeyEvent.VK_V: + return (sh ^ caps) ? 'V' : 'v'; + case KeyEvent.VK_B: + return (sh ^ caps) ? 'B' : 'b'; + case KeyEvent.VK_N: + return (sh ^ caps) ? 'N' : 'n'; + case KeyEvent.VK_M: + return (sh ^ caps) ? 'M' : 'M'; + case KeyEvent.VK_COMMA: + return (sh) ? '<' : ','; + case KeyEvent.VK_PERIOD: + return (sh) ? '>' : '.'; + case KeyEvent.VK_SLASH: + return (sh) ? '?' : '/'; + + // + // Bottom row + case KeyEvent.VK_CONTROL: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xFFE3; + case KeyEvent.KEY_LOCATION_RIGHT: + return 0xFFE4; + } + case KeyEvent.VK_WINDOWS: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xFFED; // HyperL + case KeyEvent.KEY_LOCATION_RIGHT: + return 0xFFEE; // HyperR + } + case KeyEvent.VK_META: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xFFE7; // MetaL + case KeyEvent.KEY_LOCATION_RIGHT: + return 0xFFE8; // MetaR + } + + case KeyEvent.VK_ALT: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xFFE9; + case KeyEvent.KEY_LOCATION_RIGHT: + return 0xFFEA; + } + case KeyEvent.VK_ALT_GRAPH: + return 0xfe03; + + case KeyEvent.VK_SPACE: + return ' '; + + case KeyEvent.VK_CONTEXT_MENU: + return 0xff67; + + // + // Special keys + case KeyEvent.VK_PRINTSCREEN: + return (sh) ? 0xFF15/* SysRq */: 0xFF61 /* Print */; + case KeyEvent.VK_SCROLL_LOCK: + return 0xFF14; + case KeyEvent.VK_PAUSE: + return (sh) ? 0xFF6B/* Break */: 0xFF13/* Pause */; + + // Text navigation keys + case KeyEvent.VK_INSERT: + return 0xff63; + case KeyEvent.VK_DELETE: + return 0xffff; + case KeyEvent.VK_HOME: + return 0xff50; + case KeyEvent.VK_END: + return 0xff57; + case KeyEvent.VK_PAGE_UP: + return 0xff55; + case KeyEvent.VK_PAGE_DOWN: + return 0xff56; + + // Cursor keys + case KeyEvent.VK_LEFT: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xff51; + case KeyEvent.KEY_LOCATION_NUMPAD: + return 0xFF96; + } + case KeyEvent.VK_UP: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xff52; + case KeyEvent.KEY_LOCATION_NUMPAD: + return 0xFF97; + } + case KeyEvent.VK_RIGHT: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xff53; + case KeyEvent.KEY_LOCATION_NUMPAD: + return 0xFF98; + } + case KeyEvent.VK_DOWN: + switch (order.event.getKeyLocation()) { + default: + case KeyEvent.KEY_LOCATION_LEFT: + return 0xff54; + case KeyEvent.KEY_LOCATION_NUMPAD: + return 0xFF99; + } + + // Keypad + case KeyEvent.VK_NUM_LOCK: + if (order.pressed) + num = !num; + return 0xFF6F; + case KeyEvent.VK_DIVIDE: + return 0xFFAF; + case KeyEvent.VK_MULTIPLY: + return 0xFFAA; + case KeyEvent.VK_SUBTRACT: + return 0xFFAD; + case KeyEvent.VK_ADD: + return 0xFFAB; + + case KeyEvent.VK_KP_LEFT: + return 0xFF96; + case KeyEvent.VK_KP_UP: + return 0xFF97; + case KeyEvent.VK_KP_RIGHT: + return 0xFF98; + case KeyEvent.VK_KP_DOWN: + return 0xFF99; + + case KeyEvent.VK_NUMPAD0: + return 0xFFB0; + case KeyEvent.VK_NUMPAD1: + return 0xFFB1; + case KeyEvent.VK_NUMPAD2: + return 0xFFB2; + case KeyEvent.VK_NUMPAD3: + return 0xFFB3; + case KeyEvent.VK_NUMPAD4: + return 0xFFB4; + case KeyEvent.VK_NUMPAD5: + return 0xFFB5; + case KeyEvent.VK_NUMPAD6: + return 0xFFB6; + case KeyEvent.VK_NUMPAD7: + return 0xFFB7; + case KeyEvent.VK_NUMPAD8: + return 0xFFB8; + case KeyEvent.VK_NUMPAD9: + return 0xFFB9; + case KeyEvent.VK_DECIMAL: + return 0xFFAE; + + default: + System.err.println("Key is not mapped: " + order + "."); + return ' '; // Space + } + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/AwtMouseEventToVncAdapter.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/AwtMouseEventToVncAdapter.java new file mode 100644 index 00000000000..dd933947503 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/AwtMouseEventToVncAdapter.java @@ -0,0 +1,71 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import java.awt.event.MouseEvent; + +import common.MouseOrder; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +public class AwtMouseEventToVncAdapter extends BaseElement { + + public AwtMouseEventToVncAdapter(String id) { + super(id); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Get mouse event + MouseOrder order = (MouseOrder)buf.getOrder(); + + ByteBuffer outBuf = new ByteBuffer(6); + + outBuf.writeByte(RfbConstants.CLIENT_POINTER_EVENT); + + int buttonMask = mapAwtModifiersToVncButtonMask(order.event.getModifiersEx()); + outBuf.writeByte(buttonMask); + outBuf.writeShort(order.event.getX()); + outBuf.writeShort(order.event.getY()); + + pushDataToAllOuts(outBuf); + } + + /** + * Current state of buttons 1 to 8 are represented by bits 0 to 7 of + * button-mask respectively, 0 meaning up, 1 meaning down (pressed). On a + * conventional mouse, buttons 1, 2 and 3 correspond to the left, middle and + * right buttons on the mouse. On a wheel mouse, each step of the wheel + * upwards is represented by a press and release of button 4, and each step + * downwards is represented by a press and release of button 5. + * + * @param modifiers + * extended modifiers from AWT mouse event + * @return VNC mouse button mask + */ + public static int mapAwtModifiersToVncButtonMask(int modifiers) { + int mask = (((modifiers & MouseEvent.BUTTON1_DOWN_MASK) != 0) ? 0x1 : 0) | (((modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0) ? 0x2 : 0) + | (((modifiers & MouseEvent.BUTTON3_DOWN_MASK) != 0) ? 0x4 : 0); + return mask; + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/EncodingsMessage.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/EncodingsMessage.java new file mode 100644 index 00000000000..9ee3566efae --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/EncodingsMessage.java @@ -0,0 +1,63 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +public class EncodingsMessage extends BaseElement { + + protected final int[] encodings; + + public EncodingsMessage(String id, int[] encodings) { + super(id); + this.encodings = encodings; + declarePads(); + } + + protected void declarePads() { + inputPads.put(STDIN, null); + outputPads.put(STDOUT, null); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + buf.unref(); + + ByteBuffer outBuf = new ByteBuffer(4 + encodings.length * 4); + + outBuf.writeByte(RfbConstants.CLIENT_SET_ENCODINGS); + + outBuf.writeByte(0);// padding + + outBuf.writeShort(encodings.length); + + for (int i = 0; i < encodings.length; i++) { + outBuf.writeInt(encodings[i]); + } + + pushDataToAllOuts(outBuf); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/FrameBufferUpdateRequest.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/FrameBufferUpdateRequest.java new file mode 100644 index 00000000000..c8fab216a62 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/FrameBufferUpdateRequest.java @@ -0,0 +1,127 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import common.ScreenDescription; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.Pipeline; +import streamer.PipelineImpl; + +public class FrameBufferUpdateRequest extends BaseElement { + // TODO: use object with fields instead of raw values in map + public static final String INCREMENTAL_UPDATE = "incremental"; + public static final String TARGET_X = "x"; + public static final String TARGET_Y = "y"; + public static final String WIDTH = "width"; + public static final String HEIGHT = "height"; + + protected ScreenDescription screen; + + public FrameBufferUpdateRequest(String id, ScreenDescription screen) { + super(id); + this.screen = screen; + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + Boolean incremental = (Boolean) buf.getMetadata(INCREMENTAL_UPDATE); + Integer x = (Integer) buf.getMetadata(TARGET_X); + Integer y = (Integer) buf.getMetadata(TARGET_Y); + Integer width = (Integer) buf.getMetadata(WIDTH); + Integer height = (Integer) buf.getMetadata(HEIGHT); + buf.unref(); + + // Set default values when parameters are not set + if (incremental == null) + incremental = false; + + if (x == null) + x = 0; + if (y == null) + y = 0; + + if (width == null) + width = screen.getFramebufferWidth(); + if (height == null) + height = screen.getFramebufferHeight(); + + ByteBuffer outBuf = new ByteBuffer(10); + + outBuf.writeByte(RfbConstants.CLIENT_FRAMEBUFFER_UPDATE_REQUEST); + outBuf.writeByte((incremental) ? RfbConstants.FRAMEBUFFER_INCREMENTAL_UPDATE_REQUEST : RfbConstants.FRAMEBUFFER_FULL_UPDATE_REQUEST); + outBuf.writeShort(x); + outBuf.writeShort(y); + outBuf.writeShort(width); + outBuf.writeShort(height); + + if (verbose) { + outBuf.putMetadata("sender", this); + outBuf.putMetadata("dimensions", width + "x" + height + "@" + x + "x" + y); + } + + pushDataToAllOuts(outBuf); + } + + public static void main(String args[]) { + System.setProperty("streamer.Element.debug", "true"); + + ScreenDescription screen = new ScreenDescription(); + screen.setFramebufferSize(120, 80); + Element adapter = new FrameBufferUpdateRequest("renderer", screen); + + Element sink = new MockSink("sink", ByteBuffer.convertByteArraysToByteBuffers(new byte[] { + // Request + RfbConstants.CLIENT_FRAMEBUFFER_UPDATE_REQUEST, + // Full update (redraw area) + RfbConstants.FRAMEBUFFER_FULL_UPDATE_REQUEST, + // X + 0, 1, + // Y + 0, 2, + // Width + 0, 3, + // Height + 0, 4 })); + + ByteBuffer buf = new ByteBuffer(new byte[0]); + buf.putMetadata(TARGET_X, 1); + buf.putMetadata(TARGET_Y, 2); + buf.putMetadata(WIDTH, 3); + buf.putMetadata(HEIGHT, 4); + + Element source = new MockSource("source", new ByteBuffer[] { buf }); + + Pipeline pipeline = new PipelineImpl("test"); + + pipeline.addAndLink(source, adapter, sink); + pipeline.runMainLoop("source", STDOUT, false, false); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/RGB888LE32PixelFormatRequest.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/RGB888LE32PixelFormatRequest.java new file mode 100644 index 00000000000..8c691e72839 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/RGB888LE32PixelFormatRequest.java @@ -0,0 +1,90 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import common.ScreenDescription; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Link; + +public class RGB888LE32PixelFormatRequest extends BaseElement { + protected int bitsPerPixel = 32; + protected int depth = 24; + protected int bigEndianFlag = RfbConstants.LITTLE_ENDIAN; + protected int trueColourFlag = RfbConstants.TRUE_COLOR; + protected int redMax = 255; + protected int greenMax = 255; + protected int blueMax = 255; + protected int redShift = 0; + protected int greenShift = 8; + protected int blueShift = 16; + + protected ScreenDescription screen; + + public RGB888LE32PixelFormatRequest(String id, ScreenDescription screen) { + super(id); + this.screen = screen; + } + + protected void declarePads() { + inputPads.put(STDIN, null); + outputPads.put(STDOUT, null); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + buf.unref(); + + ByteBuffer outBuf = new ByteBuffer(20); + + outBuf.writeByte(RfbConstants.CLIENT_SET_PIXEL_FORMAT); + + // Padding + outBuf.writeByte(0); + outBuf.writeByte(0); + outBuf.writeByte(0); + + // Send pixel format + outBuf.writeByte(bitsPerPixel); + outBuf.writeByte(depth); + outBuf.writeByte(bigEndianFlag); + outBuf.writeByte(trueColourFlag); + outBuf.writeShort(redMax); + outBuf.writeShort(greenMax); + outBuf.writeShort(blueMax); + outBuf.writeByte(redShift); + outBuf.writeByte(greenShift); + outBuf.writeByte(blueShift); + + // Padding + outBuf.writeByte(0); + outBuf.writeByte(0); + outBuf.writeByte(0); + + screen.setPixelFormat(bitsPerPixel, depth, bigEndianFlag != RfbConstants.LITTLE_ENDIAN, trueColourFlag == RfbConstants.TRUE_COLOR, redMax, greenMax, + blueMax, redShift, greenShift, blueShift); + + pushDataToAllOuts(outBuf); + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/RfbConstants.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/RfbConstants.java new file mode 100644 index 00000000000..c2d63bb7761 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/RfbConstants.java @@ -0,0 +1,85 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import java.nio.charset.Charset; + +public interface RfbConstants { + + public static final String RFB_PROTOCOL_VERSION_MAJOR = "RFB 003."; + public static final String VNC_PROTOCOL_VERSION_MINOR = "003"; + public static final String RFB_PROTOCOL_VERSION = RFB_PROTOCOL_VERSION_MAJOR + VNC_PROTOCOL_VERSION_MINOR; + + /** + * Server message types. + */ + final static int SERVER_FRAMEBUFFER_UPDATE = 0, SERVER_SET_COLOURMAP_ENTRIES = 1, SERVER_BELL = 2, SERVER_CUT_TEXT = 3; + + /** + * Client message types. + */ + public static final int CLIENT_SET_PIXEL_FORMAT = 0, CLIENT_FIX_COLOURMAP_ENTRIES = 1, CLIENT_SET_ENCODINGS = 2, CLIENT_FRAMEBUFFER_UPDATE_REQUEST = 3, + CLIENT_KEYBOARD_EVENT = 4, CLIENT_POINTER_EVENT = 5, CLIENT_CUT_TEXT = 6; + + /** + * Server authorization type + */ + public final static int CONNECTION_FAILED = 0, NO_AUTH = 1, VNC_AUTH = 2; + + /** + * Server authorization reply. + */ + public final static int VNC_AUTH_OK = 0, VNC_AUTH_FAILED = 1, VNC_AUTH_TOO_MANY = 2; + + /** + * Encodings. + */ + public final static int ENCODING_RAW = 0, ENCODING_COPY_RECT = 1, ENCODING_RRE = 2, ENCODING_CO_RRE = 4, ENCODING_HEXTILE = 5, ENCODING_ZRLE = 16; + + /** + * Pseudo-encodings. + */ + public final static int ENCODING_CURSOR = -239 /*0xFFFFFF11*/, ENCODING_DESKTOP_SIZE = -223 /*0xFFFFFF21*/; + + /** + * Encodings, which we support. + */ + public final static int[] SUPPORTED_ENCODINGS_ARRAY = { ENCODING_RAW, ENCODING_COPY_RECT, ENCODING_DESKTOP_SIZE }; + + /** + * Frame buffer update request type: update of whole screen or partial update. + */ + public static final int FRAMEBUFFER_FULL_UPDATE_REQUEST = 0, FRAMEBUFFER_INCREMENTAL_UPDATE_REQUEST = 1; + + public static final int KEY_UP = 0, KEY_DOWN = 1; + + public static final int LITTLE_ENDIAN = 0, BIG_ENDIAN = 1; + + public static final int EXCLUSIVE_ACCESS = 0, SHARED_ACCESS = 1; + + public static final int PALETTE = 0, TRUE_COLOR = 1; + + /** + * Default 8 bit charset to use when communicating with server. + */ + public static final Charset US_ASCII_CHARSET = Charset.availableCharsets().get("US-ASCII"); + + /** + * Default 16 bit charset to use when communicating with server. + */ + public static final Charset UCS2_CHARSET = Charset.availableCharsets().get("UTF-16LE"); +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncClient.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncClient.java new file mode 100644 index 00000000000..2b77e0a9603 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncClient.java @@ -0,0 +1,107 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import streamer.PipelineImpl; +import streamer.Queue; + +import common.AwtBellAdapter; +import common.AwtCanvasAdapter; +import common.AwtClipboardAdapter; +import common.AwtKeyEventSource; +import common.AwtMouseEventSource; +import common.BufferedImageCanvas; +import common.ScreenDescription; + +public class VncClient extends PipelineImpl { + + public VncClient(String id, String password, ScreenDescription screen, BufferedImageCanvas canvas) { + super(id); + assembleVNCPipeline(password, screen, canvas); + } + + private void assembleVNCPipeline(String password, ScreenDescription screen, BufferedImageCanvas canvas) { + + AwtMouseEventSource mouseEventSource = new AwtMouseEventSource("mouse"); + AwtKeyEventSource keyEventSource = new AwtKeyEventSource("keyboard"); + + // Subscribe packet sender to various events + canvas.addMouseListener(mouseEventSource); + canvas.addMouseMotionListener(mouseEventSource); + canvas.addKeyListener(keyEventSource); + + add( + // Handshake + + // RFB protocol version exchanger + new Vnc_3_3_Hello("hello"), + // Authenticator + new Vnc_3_3_Authentication("auth", password), + // Initializer + new VncInitializer("init", true, screen), + + new EncodingsMessage("encodings", RfbConstants.SUPPORTED_ENCODINGS_ARRAY), + + new RGB888LE32PixelFormatRequest("pixel_format", screen), + + // Main + + // Packet receiver + new VncMessageHandler("message_handler", screen), + + new AwtBellAdapter("bell"), + + new AwtClipboardAdapter("clipboard"), + + new AwtCanvasAdapter("pixels", canvas, screen), + + new Queue("queue"), + + new FrameBufferUpdateRequest("fbur", screen), + + new AwtKeyboardEventToVncAdapter("keyboard_adapter"), + + new AwtMouseEventToVncAdapter("mouse_adapter"), + + mouseEventSource, keyEventSource + + ); + + // Link handshake elements + link("IN", "hello", "auth", "init", "message_handler"); + link("hello >otout", "hello< OUT"); + link("auth >otout", "auth< OUT"); + link("init >otout", "init< OUT"); + link("init >encodings", "encodings"); + link("init >pixel_format", "pixel_format"); + link("encodings", "encodings< OUT"); + link("pixel_format", "pixel_format< OUT"); + + // Link main elements + link("message_handler >bell", "bell"); + link("message_handler >clipboard", "clipboard"); + link("message_handler >pixels", "pixels"); + link("message_handler >fbur", "fbur"); + + link("fbur", "fbur< queue"); + link("keyboard", "keyboard_adapter", "keyboard< queue"); + link("mouse", "mouse_adapter", "mouse< queue"); + link("queue", "OUT"); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncInitializer.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncInitializer.java new file mode 100644 index 00000000000..0882d13ef82 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncInitializer.java @@ -0,0 +1,244 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +import common.ScreenDescription; + +public class VncInitializer extends OneTimeSwitch { + + // Pad names + public static final String CLIENT_SUPPORTED_ENCODINGS_ADAPTER_PAD = "encodings"; + public static final String CLIENT_PIXEL_FORMAT_ADAPTER_PAD = "pixel_format"; + + protected byte sharedFlag = RfbConstants.EXCLUSIVE_ACCESS; + + /** + * Properties of remote screen . + */ + protected ScreenDescription screen; + + public VncInitializer(String id, boolean shared, ScreenDescription screen) { + super(id); + + setSharedFlag(shared); + this.screen = screen; + + declarePads(); + } + + @Override + protected void declarePads() { + super.declarePads(); + outputPads.put(CLIENT_SUPPORTED_ENCODINGS_ADAPTER_PAD, null); + outputPads.put(CLIENT_PIXEL_FORMAT_ADAPTER_PAD, null); + } + + public ScreenDescription getScreen() { + return screen; + } + + public void setScreen(ScreenDescription screen) { + this.screen = screen; + } + + public void setSharedFlag(boolean shared) { + if (shared) + sharedFlag = RfbConstants.SHARED_ACCESS; + else + sharedFlag = RfbConstants.EXCLUSIVE_ACCESS; + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Server initialization message is at least 24 bytes long + length of + // desktop name + if (!cap(buf, 24, UNLIMITED, link, false)) + return; + + // Read server initialization message + // Read frame buffer size + int framebufferWidth = buf.readUnsignedShort(); + int framebufferHeight = buf.readUnsignedShort(); + + // Read pixel format + int bitsPerPixel = buf.readUnsignedByte(); + int depth = buf.readUnsignedByte(); + + int bigEndianFlag = buf.readUnsignedByte(); + int trueColorFlag = buf.readUnsignedByte(); + + int redMax = buf.readUnsignedShort(); + int greenMax = buf.readUnsignedShort(); + int blueMax = buf.readUnsignedShort(); + + int redShift = buf.readUnsignedByte(); + int greenShift = buf.readUnsignedByte(); + int blueShift = buf.readUnsignedByte(); + + // Skip padding + buf.skipBytes(3); + + // Read desktop name + int length = buf.readSignedInt(); + + // Consume exactly $length bytes, push back any extra bytes + if (!cap(buf, length, length, link, true)) + return; + + String desktopName = buf.readString(length, RfbConstants.US_ASCII_CHARSET); + buf.unref(); + if (verbose) + System.out.println("[" + this + "] INFO: Desktop name: \"" + desktopName + "\", bpp: " + bitsPerPixel + ", depth: " + depth + ", screen size: " + + framebufferWidth + "x" + framebufferHeight + "."); + + // Set screen properties + screen.setFramebufferSize(framebufferWidth, framebufferHeight); + screen.setPixelFormat(bitsPerPixel, depth, bigEndianFlag!=RfbConstants.LITTLE_ENDIAN, trueColorFlag==RfbConstants.TRUE_COLOR, redMax, greenMax, blueMax, redShift, greenShift, blueShift); + screen.setDesktopName(desktopName); + + // If sever screen has different parameters than ours, then change it + if (!screen.isRGB888_32_LE()) { + // Send client pixel format + sendClientPixelFormat(); + } + + // Send encodings supported by client + sendSupportedEncodings(); + + switchOff(); + + } + + @Override + protected void onStart() { + ByteBuffer buf = new ByteBuffer(new byte[] { sharedFlag }); + pushDataToOTOut(buf); + } + + private void sendClientPixelFormat() { + pushDataToPad(CLIENT_PIXEL_FORMAT_ADAPTER_PAD, new ByteBuffer(0)); + } + + private void sendSupportedEncodings() { + pushDataToPad(CLIENT_SUPPORTED_ENCODINGS_ADAPTER_PAD, new ByteBuffer(0)); + } + + public String toString() { + return "VncInit(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + final String desktopName = "test"; + + Element source = new MockSource("source") { + { + bufs = ByteBuffer.convertByteArraysToByteBuffers( + // Send screen description + new byte[] { + // Framebuffer width (short) + 0, (byte) 200, + // Framebuffer height (short) + 0, 100, + // Bits per pixel + 32, + // Depth, + 24, + // Endianness flag + RfbConstants.LITTLE_ENDIAN, + // Truecolor flag + RfbConstants.TRUE_COLOR, + // Red max (short) + 0, (byte) 255, + // Green max (short) + 0, (byte) 255, + // Blue max (short) + 0, (byte) 255, + // Red shift + 16, + // Green shift + 8, + // Blue shift + 0, + // Padding + 0, 0, 0, + // Desktop name length (int) + 0, 0, 0, 4, + // Desktop name ("test", 4 bytes) + 't', 'e', 's', 't', + + // Tail + 1, 2, 3 + + }, + // Tail packet + new byte[] { 4, 5, 6 }); + } + }; + + ScreenDescription screen = new ScreenDescription(); + final VncInitializer init = new VncInitializer("init", true, screen); + Element initSink = new MockSink("initSink") { + { + // Expect shared flag + bufs = ByteBuffer.convertByteArraysToByteBuffers(new byte[] { RfbConstants.SHARED_ACCESS }); + } + }; + Element mainSink = new MockSink("mainSink") { + { + // Expect two tail packets + bufs = ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3 }, new byte[] { 4, 5, 6 }); + } + }; + ByteBuffer[] emptyBuf = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {}); + Element encodingsSink = new MockSink("encodings", emptyBuf); + Element pixelFormatSink = new MockSink("pixel_format", emptyBuf); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.addAndLink(source, init, mainSink); + pipeline.add(encodingsSink, pixelFormatSink, initSink); + pipeline.link("init >otout", "initSink"); + pipeline.link("init >" + CLIENT_SUPPORTED_ENCODINGS_ADAPTER_PAD, "encodings"); + pipeline.link("init >" + CLIENT_PIXEL_FORMAT_ADAPTER_PAD, "pixel_format"); + + pipeline.runMainLoop("source", STDOUT, false, false); + + if (!screen.isRGB888_32_LE()) + System.err.println("Screen description was read incorrectly: " + screen + "."); + if (!desktopName.equals(screen.getDesktopName())) + System.err.println("Screen desktop name was read incorrectly: \"" + screen.getDesktopName() + "\"."); + + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncMessageHandler.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncMessageHandler.java new file mode 100644 index 00000000000..758000dd323 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/VncMessageHandler.java @@ -0,0 +1,419 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import streamer.BaseElement; +import streamer.ByteBuffer; +import streamer.Element; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.Pipeline; +import streamer.PipelineImpl; + +import common.BitmapOrder; +import common.BitmapRectangle; +import common.CopyRectOrder; +import common.ScreenDescription; + +public class VncMessageHandler extends BaseElement { + protected ScreenDescription screen = null; + + // Pad names + public static final String SERVER_BELL_ADAPTER_PAD = "bell"; + public static final String SERVER_CLIPBOARD_ADAPTER_PAD = "clipboard"; + public static final String PIXEL_ADAPTER_PAD = "pixels"; + public static final String FRAME_BUFFER_UPDATE_REQUEST_ADAPTER_PAD = "fbur"; + + // Keys for metadata + public static final String CLIPBOARD_CONTENT = "content"; + public static final String TARGET_X = "x"; + public static final String TARGET_Y = "y"; + public static final String WIDTH = "width"; + public static final String HEIGHT = "height"; + public static final String SOURCE_X = "srcX"; + public static final String SOURCE_Y = "srcY"; + public static final String PIXEL_FORMAT = "pixel_format"; + + private static final String NUM_OF_PROCESSED_RECTANGLES = "rects"; + private static final String SAVED_CURSOR_POSITION = "cursor"; + + // Pixel format: RGB888 LE 32 + public static final String RGB888LE32 = "RGB888LE32"; + + public VncMessageHandler(String id, ScreenDescription screen) { + super(id); + this.screen = screen; + declarePads(); + } + + private void declarePads() { + outputPads.put(SERVER_BELL_ADAPTER_PAD, null); + outputPads.put(SERVER_BELL_ADAPTER_PAD, null); + outputPads.put(SERVER_CLIPBOARD_ADAPTER_PAD, null); + outputPads.put(PIXEL_ADAPTER_PAD, null); + outputPads.put(FRAME_BUFFER_UPDATE_REQUEST_ADAPTER_PAD, null); + + inputPads.put("stdin", null); + } + + @Override + public void handleData(ByteBuffer buf, Link link) { + if (buf == null) + return; + + try { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + if (!cap(buf, 1, UNLIMITED, link, false)) + return; + + // Read server message type + int messageType = buf.readUnsignedByte(); + + // Invoke packet handler by packet type. + switch (messageType) { + + case RfbConstants.SERVER_FRAMEBUFFER_UPDATE: { + // Handle frame buffer update + if (!handleFBU(buf, link)) + return; + + // Frame buffer update is received and fully processed, send request for + // another frame buffer update to server. + sendFBUR(); + + break; + } + + case RfbConstants.SERVER_BELL: { + if (!handleBell(buf, link)) + return; + break; + } + + case RfbConstants.SERVER_CUT_TEXT: { + if (!handleClipboard(buf, link)) + return; + break; + } + + default: + // TODO: allow to extend functionality + throw new RuntimeException("Unknown server packet type: " + messageType + "."); + } + + // Cut tail, if any + cap(buf, 0, 0, link, true); + } finally { + + // Return processed buffer back to pool + buf.unref(); + } + } + + private boolean handleClipboard(ByteBuffer buf, Link link) { + if (!cap(buf, 3 + 4, UNLIMITED, link, true)) + return false; + + // Skip padding + buf.skipBytes(3); + + // Read text length + int length = buf.readSignedInt(); + + // We need full string to parse it + if (!cap(buf, length, UNLIMITED, link, true)) + return false; + + String content = buf.readString(length, RfbConstants.US_ASCII_CHARSET); + + // Send content in metadata + ByteBuffer outBuf = new ByteBuffer(0); + outBuf.putMetadata(CLIPBOARD_CONTENT, content); + + pushDataToPad(SERVER_CLIPBOARD_ADAPTER_PAD, outBuf); + + return true; + } + + private boolean handleBell(ByteBuffer buf, Link link) { + // Send empty packet to bell adapter to produce bell + pushDataToPad(SERVER_BELL_ADAPTER_PAD, new ByteBuffer(0)); + + return true; + } + + // FIXME: this method is too complex + private boolean handleFBU(ByteBuffer buf, Link link) { + + // We need at least 3 bytes here, 1 - padding, 2 - number of rectangles + if (!cap(buf, 3, UNLIMITED, link, true)) + return false; + + buf.skipBytes(1);// Skip padding + + // Read number of rectangles + int numberOfRectangles = buf.readUnsignedShort(); + + if (verbose) + System.out.println("[" + this + "] INFO: Frame buffer update. Number of rectangles: " + numberOfRectangles + "."); + + // Each rectangle must have header at least, header length is 12 bytes. + if (!cap(buf, 12 * numberOfRectangles, UNLIMITED, link, true)) + return false; + + // For all rectangles + + // Restore saved point, to avoid flickering and performance problems when + // frame buffer update is split between few incoming packets. + int numberOfProcessedRectangles = (buf.getMetadata(NUM_OF_PROCESSED_RECTANGLES) != null) ? (Integer) buf.getMetadata(NUM_OF_PROCESSED_RECTANGLES) : 0; + if (buf.getMetadata(SAVED_CURSOR_POSITION) != null) + buf.cursor = (Integer) buf.getMetadata(SAVED_CURSOR_POSITION); + + if (verbose && numberOfProcessedRectangles > 0) + System.out.println("[" + this + "] INFO: Restarting from saved point. Number of already processed rectangles: " + numberOfRectangles + ", cursor: " + + buf.cursor + "."); + + // For all new rectangles + for (int i = numberOfProcessedRectangles; i < numberOfRectangles; i++) { + + // We need coordinates of rectangle (2x4 bytes) and encoding type (4 + // bytes) + if (!cap(buf, 12, UNLIMITED, link, true)) + return false; + + // Read coordinates of rectangle + int x = buf.readUnsignedShort(); + int y = buf.readUnsignedShort(); + int width = buf.readUnsignedShort(); + int height = buf.readUnsignedShort(); + + // Read rectangle encoding + int encodingType = buf.readSignedInt(); + + // Process rectangle + switch (encodingType) { + + case RfbConstants.ENCODING_RAW: { + if (!handleRawRectangle(buf, link, x, y, width, height)) + return false; + break; + } + + case RfbConstants.ENCODING_COPY_RECT: { + if (!handleCopyRect(buf, link, x, y, width, height)) + return false; + break; + } + + case RfbConstants.ENCODING_DESKTOP_SIZE: { + if (!handleScreenSizeChangeRect(buf, link, x, y, width, height)) + return false; + break; + } + + default: + // TODO: allow to extend functionality + throw new RuntimeException("Unsupported ecnoding: " + encodingType + "."); + } + + // Update information about processed rectangles to avoid handling of same + // rectangle multiple times. + // TODO: push back partial rectangle only instead + buf.putMetadata(NUM_OF_PROCESSED_RECTANGLES, ++numberOfProcessedRectangles); + buf.putMetadata(SAVED_CURSOR_POSITION, buf.cursor); + } + + return true; + } + + private boolean handleScreenSizeChangeRect(ByteBuffer buf, Link link, int x, int y, int width, int height) { + // Remote screen size is changed + if (verbose) + System.out.println("[" + this + "] INFO: Screen size rect. Width: " + width + ", height: " + height + "."); + + screen.setFramebufferSize(width, height); + + return true; + } + + private boolean handleCopyRect(ByteBuffer buf, Link link, int x, int y, int width, int height) { + // Copy rectangle from one part of screen to another. + // Areas may overlap. Antialiasing may cause visible artifacts. + + // We need 4 bytes with coordinates of source rectangle + if (!cap(buf, 4, UNLIMITED, link, true)) + return false; + + CopyRectOrder order = new CopyRectOrder(); + + order.srcX = buf.readUnsignedShort(); + order.srcY = buf.readUnsignedShort(); + order.x = x; + order.y = y; + order.width = width; + order.height = height; + + if (verbose) + System.out.println("[" + this + "] INFO: Copy rect. X: " + x + ", y: " + y + ", width: " + width + ", height: " + height + ", srcX: " + order.srcX + + ", srcY: " + order.srcY + "."); + + pushDataToPad(PIXEL_ADAPTER_PAD, new ByteBuffer(order)); + + return true; + } + + private boolean handleRawRectangle(ByteBuffer buf, Link link, int x, int y, int width, int height) { + // Raw rectangle is just array of pixels to draw on screen. + int rectDataLength = width * height * screen.getBytesPerPixel(); + + // We need at least rectDataLength bytes. Extra bytes may contain other + // rectangles. + if (!cap(buf, rectDataLength, UNLIMITED, link, true)) + return false; + + if (verbose) + System.out.println("[" + this + "] INFO: Raw rect. X: " + x + ", y: " + y + ", width: " + width + ", height: " + height + ", data length: " + + rectDataLength + "."); + + BitmapRectangle rectangle = new BitmapRectangle(); + rectangle.x = x; + rectangle.y = y; + rectangle.width = width; + rectangle.height = height; + rectangle.bufferWidth = width; + rectangle.bufferHeight = height; + rectangle.bitmapDataStream = buf.readBytes(rectDataLength); + rectangle.colorDepth=screen.getColorDeph(); + + BitmapOrder order = new BitmapOrder(); + order.rectangles = new BitmapRectangle[] { rectangle }; + + pushDataToPad(PIXEL_ADAPTER_PAD, new ByteBuffer(order)); + return true; + } + + public void onStart() { + // Send Frame Buffer Update request + sendFBUR(); + } + + private void sendFBUR() { + ByteBuffer buf = new ByteBuffer(0); + buf.putMetadata("incremental", true); + pushDataToPad(FRAME_BUFFER_UPDATE_REQUEST_ADAPTER_PAD, buf); + } + + public String toString() { + return "VNCMessageHandler(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String[] args) { + + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + Element source = new MockSource("source") { + { + // Split messages at random boundaries to check "pushback" logic + bufs = ByteBuffer.convertByteArraysToByteBuffers(new byte[] { + // Message type: server bell + RfbConstants.SERVER_BELL, + + // Message type: clipboard text + RfbConstants.SERVER_CUT_TEXT, + // Padding + 0, 0, 0, + // Length (test) + 0, 0, 0, 4, + + }, new byte[] { + // Clipboard text + 't', 'e', 's', 't', + + // Message type: frame buffer update + RfbConstants.SERVER_FRAMEBUFFER_UPDATE, + // Padding + 0, + // Number of rectangles + 0, 3, }, + + new byte[] { + + // x, y, width, height: 0x0@4x4 + 0, 0, 0, 0, 0, 4, 0, 4, + // Encoding: desktop size + (byte) ((RfbConstants.ENCODING_DESKTOP_SIZE >> 24) & 0xff), (byte) ((RfbConstants.ENCODING_DESKTOP_SIZE >> 16) & 0xff), + (byte) ((RfbConstants.ENCODING_DESKTOP_SIZE >> 8) & 0xff), (byte) ((RfbConstants.ENCODING_DESKTOP_SIZE >> 0) & 0xff), }, + + new byte[] { + + // x, y, width, height: 0x0@4x4 + 0, 0, 0, 0, 0, 4, 0, 4, + // Encoding: raw rect + (byte) ((RfbConstants.ENCODING_RAW >> 24) & 0xff), (byte) ((RfbConstants.ENCODING_RAW >> 16) & 0xff), + (byte) ((RfbConstants.ENCODING_RAW >> 8) & 0xff), (byte) ((RfbConstants.ENCODING_RAW >> 0) & 0xff), + // Raw pixel data 4x4x1 bpp + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, }, new byte[] { 11, 12, 13, 14, 15, 16, + + // x, y, width, height: 0x0@2x2 + 0, 0, 0, 0, 0, 2, 0, 2, + // Encoding: copy rect + (byte) ((RfbConstants.ENCODING_COPY_RECT >> 24) & 0xff), (byte) ((RfbConstants.ENCODING_COPY_RECT >> 16) & 0xff), + (byte) ((RfbConstants.ENCODING_COPY_RECT >> 8) & 0xff), (byte) ((RfbConstants.ENCODING_COPY_RECT >> 0) & 0xff), + // srcX, srcY: 2x2 + 0, 2, 0, 2, }); + } + }; + + ScreenDescription screen = new ScreenDescription() { + { + this.bytesPerPixel = 1; + } + }; + + final Element handler = new VncMessageHandler("handler", screen); + + ByteBuffer[] emptyBuf = ByteBuffer.convertByteArraysToByteBuffers(new byte[] {}); + Element fburSink = new MockSink("fbur", ByteBuffer.convertByteArraysToByteBuffers(new byte[] {}, new byte[] {})); + Element bellSink = new MockSink("bell", emptyBuf); + Element clipboardSink = new MockSink("clipboard", emptyBuf); + Element desktopSizeChangeSink = new MockSink("desktop_size", emptyBuf); + Element pixelsSink = new MockSink("pixels", + ByteBuffer.convertByteArraysToByteBuffers(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, })); + Element copyRectSink = new MockSink("copy_rect", emptyBuf); + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.addAndLink(source, handler); + pipeline.add(fburSink, bellSink, clipboardSink, desktopSizeChangeSink, pixelsSink, copyRectSink); + + pipeline.link("handler >" + FRAME_BUFFER_UPDATE_REQUEST_ADAPTER_PAD, "fbur"); + pipeline.link("handler >" + SERVER_BELL_ADAPTER_PAD, "bell"); + pipeline.link("handler >" + SERVER_CLIPBOARD_ADAPTER_PAD, "clipboard"); + pipeline.link("handler >" + PIXEL_ADAPTER_PAD, "pixels"); + + pipeline.runMainLoop("source", STDOUT, false, false); + + } + +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/Vnc_3_3_Authentication.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/Vnc_3_3_Authentication.java new file mode 100644 index 00000000000..52d9976eece --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/Vnc_3_3_Authentication.java @@ -0,0 +1,291 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import java.security.spec.KeySpec; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.DESKeySpec; + +import streamer.ByteBuffer; +import streamer.Element; +import streamer.FakeSink; +import streamer.Link; +import streamer.MockSink; +import streamer.MockSource; +import streamer.OneTimeSwitch; +import streamer.Pipeline; +import streamer.PipelineImpl; + +public class Vnc_3_3_Authentication extends OneTimeSwitch { + + /** + * Password to use when authentication is required. + */ + protected String password = null; + + /** + * Authentication stage: + *
    + *
  • 0 - challenge received, response must be sent + *
  • 1 - authentication result received. + *
+ */ + protected int stage = 0; + + public Vnc_3_3_Authentication(String id) { + super(id); + } + + public Vnc_3_3_Authentication(String id, String password) { + super(id); + this.password = password; + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + switch (stage) { + case 0: // Read security with optional challenge and response + stage0(buf, link); + + break; + case 1: // Read authentication response + stage1(buf, link); + break; + } + + } + + /** + * Read security type. If connection type is @see + * RfbConstants.CONNECTION_FAILED, then throw exception. If connection type is @see + * RfbConstants.NO_AUTH, then switch off this element. If connection type is @see + * RfbConstants.VNC_AUTH, then read challenge, send encoded password, and read + * authentication response. + */ + private void stage0(ByteBuffer buf, Link link) { + // At least 4 bytes are necessary + if (!cap(buf, 4, UNLIMITED, link, true)) + return; + + // Read security type + int authType = buf.readSignedInt(); + + switch (authType) { + case RfbConstants.CONNECTION_FAILED: { + // Server forbids to connect. Read reason and throw exception + + int length = buf.readSignedInt(); + String reason = new String(buf.data, buf.offset, length, RfbConstants.US_ASCII_CHARSET); + + throw new RuntimeException("Authentication to VNC server is failed. Reason: " + reason); + } + + case RfbConstants.NO_AUTH: { + // Client can connect without authorization. Nothing to do. + // Switch off this element from circuit + switchOff(); + break; + } + + case RfbConstants.VNC_AUTH: { + // Read challenge and generate response + responseToChallenge(buf, link); + break; + } + + default: + throw new RuntimeException("Unsupported VNC protocol authorization scheme, scheme code: " + authType + "."); + } + + } + + private void responseToChallenge(ByteBuffer buf, Link link) { + // Challenge is exactly 16 bytes long + if (!cap(buf, 16, 16, link, true)) + return; + + ByteBuffer challenge = buf.slice(buf.cursor, 16, true); + buf.unref(); + + // Encode challenge with password + ByteBuffer response; + try { + response = encodePassword(challenge, password); + challenge.unref(); + } catch (Exception e) { + throw new RuntimeException("Cannot encrypt client password to send to server: " + e.getMessage()); + } + + if (verbose) { + response.putMetadata("sender", this); + } + + // Send encoded challenge + nextStage(); + pushDataToOTOut(response); + + } + + private void nextStage() { + stage++; + + if (verbose) + System.out.println("[" + this + "] INFO: Next stage: " + stage + "."); + } + + /** + * Encode password using DES encryption with given challenge. + * + * @param challenge + * a random set of bytes. + * @param password + * a password + * @return DES hash of password and challenge + */ + public ByteBuffer encodePassword(ByteBuffer challenge, String password) { + if (challenge.length != 16) + throw new RuntimeException("Challenge must be exactly 16 bytes long."); + + // VNC password consist of up to eight ASCII characters. + byte[] key = { 0, 0, 0, 0, 0, 0, 0, 0 }; // Padding + byte[] passwordAsciiBytes = password.getBytes(RfbConstants.US_ASCII_CHARSET); + System.arraycopy(passwordAsciiBytes, 0, key, 0, Math.min(password.length(), 8)); + + // Flip bytes (reverse bits) in key + for (int i = 0; i < key.length; i++) { + key[i] = flipByte(key[i]); + } + + try { + KeySpec desKeySpec = new DESKeySpec(key); + SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DES"); + SecretKey secretKey = secretKeyFactory.generateSecret(desKeySpec); + Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding"); + cipher.init(Cipher.ENCRYPT_MODE, secretKey); + + ByteBuffer buf = new ByteBuffer(cipher.doFinal(challenge.data, challenge.offset, challenge.length)); + + return buf; + } catch (Exception e) { + throw new RuntimeException("Cannot encode password.", e); + } + } + + /** + * Reverse bits in byte, so least significant bit will be most significant + * bit. E.g. 01001100 will become 00110010. + * + * See also: http://www.vidarholen.net/contents/junk/vnc.html , + * http://bytecrafter .blogspot.com/2010/09/des-encryption-as-used-in-vnc.html + * + * @param b + * a byte + * @return byte in reverse order + */ + private static byte flipByte(byte b) { + int b1_8 = (b & 0x1) << 7; + int b2_7 = (b & 0x2) << 5; + int b3_6 = (b & 0x4) << 3; + int b4_5 = (b & 0x8) << 1; + int b5_4 = (b & 0x10) >>> 1; + int b6_3 = (b & 0x20) >>> 3; + int b7_2 = (b & 0x40) >>> 5; + int b8_1 = (b & 0x80) >>> 7; + byte c = (byte) (b1_8 | b2_7 | b3_6 | b4_5 | b5_4 | b6_3 | b7_2 | b8_1); + return c; + } + + /** + * Read authentication result, send nothing. + */ + private void stage1(ByteBuffer buf, Link link) { + // Read authentication response + if (!cap(buf, 4, 4, link, false)) + return; + + int authResult = buf.readSignedInt(); + + switch (authResult) { + case RfbConstants.VNC_AUTH_OK: { + // Nothing to do + if (verbose) + System.out.println("[" + this + "] INFO: Authentication successfull."); + break; + } + + case RfbConstants.VNC_AUTH_TOO_MANY: + throw new RuntimeException("Connection to VNC server failed: too many wrong attempts."); + + case RfbConstants.VNC_AUTH_FAILED: + throw new RuntimeException("Connection to VNC server failed: wrong password."); + + default: + throw new RuntimeException("Connection to VNC server failed, reason code: " + authResult); + } + + switchOff(); + + } + + public String toString() { + return "VNC3.3 Authentication(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + final String password = "test"; + + Element source = new MockSource("source") { + { + bufs = ByteBuffer.convertByteArraysToByteBuffers( + // Request authentication and send 16 byte challenge + new byte[] { 0, 0, 0, RfbConstants.VNC_AUTH, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, + // Respond to challenge with AUTH_OK + new byte[] { 0, 0, 0, RfbConstants.VNC_AUTH_OK }); + } + }; + + Element mainSink = new FakeSink("mainSink"); + final Vnc_3_3_Authentication auth = new Vnc_3_3_Authentication("auth", password); + Element initSink = new MockSink("initSink") { + { + // Expect encoded password + bufs = new ByteBuffer[] { auth.encodePassword(new ByteBuffer(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }), password) }; + } + }; + + Pipeline pipeline = new PipelineImpl("test"); + pipeline.addAndLink(source, auth, mainSink); + pipeline.add(initSink); + pipeline.link("auth >otout", "initSink"); + + pipeline.runMainLoop("source", STDOUT, false, false); + + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/Vnc_3_3_Hello.java b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/Vnc_3_3_Hello.java new file mode 100644 index 00000000000..323380b047f --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/main/java/vncclient/Vnc_3_3_Hello.java @@ -0,0 +1,115 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package vncclient; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; + +import streamer.ByteBuffer; +import streamer.InputStreamSource; +import streamer.Link; +import streamer.OneTimeSwitch; +import streamer.OutputStreamSink; +import streamer.Pipeline; +import streamer.PipelineImpl; + +/** + * VNC server sends hello packet with RFB protocol version, e.g. + * "RFB 003.007\n". We need to send response packet with supported protocol + * version, e.g. "RFB 003.003\n". + */ +public class Vnc_3_3_Hello extends OneTimeSwitch { + + public Vnc_3_3_Hello(String id) { + super(id); + } + + @Override + protected void handleOneTimeData(ByteBuffer buf, Link link) { + if (verbose) + System.out.println("[" + this + "] INFO: Data received: " + buf + "."); + + // Initial packet is exactly 12 bytes long + if (!cap(buf, 12, 12, link, false)) + return; + + // Read protocol version + String rfbProtocol = new String(buf.data, buf.offset, buf.length, RfbConstants.US_ASCII_CHARSET); + buf.unref(); + + // Server should use RFB protocol 3.x + if (!rfbProtocol.contains(RfbConstants.RFB_PROTOCOL_VERSION_MAJOR)) + throw new RuntimeException("Cannot handshake with VNC server. Unsupported protocol version: \"" + rfbProtocol + "\"."); + + // Send response: we support RFB 3.3 only + String ourProtocolString = RfbConstants.RFB_PROTOCOL_VERSION + "\n"; + + ByteBuffer outBuf = new ByteBuffer(ourProtocolString.getBytes(RfbConstants.US_ASCII_CHARSET)); + + if (verbose) { + outBuf.putMetadata("sender", this); + outBuf.putMetadata("version", RfbConstants.RFB_PROTOCOL_VERSION); + } + + pushDataToOTOut(outBuf); + + // Switch off this element from circuit + switchOff(); + + } + + public String toString() { + return "Vnc3.3 Hello(" + id + ")"; + } + + /** + * Example. + */ + public static void main(String args[]) { + // System.setProperty("streamer.Link.debug", "true"); + System.setProperty("streamer.Element.debug", "true"); + // System.setProperty("streamer.Pipeline.debug", "true"); + + InputStream is = new ByteArrayInputStream("RFB 003.007\ntest".getBytes(RfbConstants.US_ASCII_CHARSET)); + ByteArrayOutputStream initOS = new ByteArrayOutputStream(); + ByteArrayOutputStream mainOS = new ByteArrayOutputStream(); + InputStreamSource inputStreamSource = new InputStreamSource("source", is); + OutputStreamSink outputStreamSink = new OutputStreamSink("mainSink", mainOS); + + Vnc_3_3_Hello hello = new Vnc_3_3_Hello("hello"); + + Pipeline pipeline = new PipelineImpl("test"); + + pipeline.addAndLink(inputStreamSource, hello, outputStreamSink); + pipeline.add(new OutputStreamSink("initSink", initOS)); + + pipeline.link("hello >" + OneTimeSwitch.OTOUT, "initSink"); + + pipeline.runMainLoop("source", STDOUT, false, false); + + String initOut = new String(initOS.toByteArray(), RfbConstants.US_ASCII_CHARSET); + String mainOut = new String(mainOS.toByteArray(), RfbConstants.US_ASCII_CHARSET); + + if (!"RFB 003.003\n".equals(initOut)) + System.err.println("Unexpected value for hello response: \"" + initOut + "\"."); + + if (!"test".equals(mainOut)) + System.err.println("Unexpected value for main data: \"" + mainOut + "\"."); + + } +} diff --git a/services/console-proxy-rdp/rdpconsole/src/test/doc/README.txt b/services/console-proxy-rdp/rdpconsole/src/test/doc/README.txt new file mode 100644 index 00000000000..dd4168373b1 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/test/doc/README.txt @@ -0,0 +1,32 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +To debug RDP sessions with Network Monitor or Wireshark, you need to +configure RDP server with custom private key. For Network Monitor +Decrypt Expert, you also will need to downgrade RDP server TLS protocol +to version 1.0. + +File dev-rdp-config.bat contains instructions to configure RDP to use custom +key, open firewall, disable NLA, downgrade TLS, and start RDP service. + +File rdp.pfx contains custom private key (password: test) for use with +rdp-config.bat and Network Monitor Decrypt Expert. If you will generate +your own key, you will need to alter rpd-file.bat to use it +fingerprints. + +File rdp-key.pem contains private key in PEM format for use with +Wireshark. diff --git a/services/console-proxy-rdp/rdpconsole/src/test/doc/dev-rdp-config.bat b/services/console-proxy-rdp/rdpconsole/src/test/doc/dev-rdp-config.bat new file mode 100644 index 00000000000..14a7bbd0f0a --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/test/doc/dev-rdp-config.bat @@ -0,0 +1,126 @@ +rem Licensed to the Apache Software Foundation (ASF) under one +rem or more contributor license agreements. See the NOTICE file +rem distributed with this work for additional information +rem regarding copyright ownership. The ASF licenses this file +rem to you under the Apache License, Version 2.0 (the +rem "License"); you may not use this file except in compliance +rem with the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, +rem software distributed under the License is distributed on an +rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +rem KIND, either express or implied. See the License for the +rem specific language governing permissions and limitations +rem under the License. + +rem +rem Configure and start RDP service. +rem Configure RPD service to use custom key instead of autogenerated for Wireshark and Network Monitor Decrypt Expert. +rem rdp.pfx is necessary because it fingerprints are hardcoded in this script. +rem + +rem Turn off firewall + +netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes + +rem Enable TS connections +rem +rem Windows Registry Editor Version 5.00 +rem +rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] +rem "AllowTSConnections"=dword:00000001 +rem "fDenyTSConnections"=dword:00000000 + +reg add "HKLM\System\CurrentControlSet\Control\Terminal Server" /v "AllowTSConnections" /t REG_DWORD /d 1 /f +reg add "HKLM\System\CurrentControlSet\Control\Terminal Server" /v "fDenyTSConnections" /t REG_DWORD /d 0 /f + +rem Disable RDP NLA + +reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f + +rem Enable TS service + +sc config TermService start=auto + +rem Certificate Generation + +rem Make self-signed certificate + +rem makecert -r -pe -n "CN=%COMPUTERNAME%" -eku 1.3.6.1.5.5.7.3.1 -ss my -sr LocalMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 + +rem Import certificate + +certutil -p test -importPFX "Remote Desktop" rdp.pfx + +rem Configure RDP server to use certificate: + +rem Windows Registry Editor Version 5.00 +rem +rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] +rem "SSLCertificateSHA1Hash"=hex:c1,70,84,70,bc,56,42,0a,bb,f4,35,35,ba,a6,09,b0,4e,98,4a,47 +reg add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "SSLCertificateSHA1Hash" /t REG_HEX /d "" /f + +rem Grant permissions on certificate for everyone + +rem certutil -repairstore My "bcb40fb84ac891bd41068fe686864559" D:PAI(A;;GA;;;BA)(A;;GA;;;SY)(A;;GR;;;NS) +certutil -repairstore "Remote Desktop" "bcb40fb84ac891bd41068fe686864559" D:PAI(A;;GA;;;BA)(A;;GA;;;SY)(A;;GR;;;NS) + +rem confirm with + +rem certutil -store -v My +certutil -store -v "Remote Desktop" + +rem Disable TLS 1.1 (for Network Monitor Decrypt Expert) +rem +rem Windows Registry Editor Version 5.00 +rem +rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] +rem "Enabled"=dword:00000000 +rem "DisabledByDefault"=dword:00000001 +rem +rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] +rem "Enabled"=dword:00000000 +rem "DisabledByDefault"=dword:00000001 + +reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" /v "Enabled" /t REG_DWORD /d 0 /f +reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" /v "DisabledByDefault" /t REG_DWORD /d 1 /f +reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" /v "Enabled" /t REG_DWORD /d 0 /f +reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" /v "DisabledByDefault" /t REG_DWORD /d 1 /f + + +rem Disable TLS 1.2 (for Network Monitor Decrypt Expert) +rem +rem Windows Registry Editor Version 5.00 +rem +rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] +rem "Enabled"=dword:00000000 +rem "DisabledByDefault"=dword:00000001 +rem +rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] +rem "Enabled"=dword:00000000 +rem "DisabledByDefault"=dword:00000001 + +reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v "Enabled" /t REG_DWORD /d 0 /f +reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" /v "DisabledByDefault" /t REG_DWORD /d 1 /f +reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" /v "Enabled" /t REG_DWORD /d 0 /f +reg add "HKLM\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" /v "DisabledByDefault" /t REG_DWORD /d 1 /f + +rem Start TS service + +net start Termservice + + +rem For Network Monitor Decrypt Expert. + +rem Install .Net 3.5 + +rem dism /online /enable-feature /featurename:NetFx3ServerFeatures +rem dism /online /enable-feature /featurename:NetFx3 + +rem PS. +rem Don't forget to set Windows profile as active in Network Monitor, so SSL traffic branch will appear under +rem svnchost.exe, so you will be able to decrypt it (don't forget to save and reopen captured traffic to file first). +rem + diff --git a/services/console-proxy-rdp/rdpconsole/src/test/doc/rdp-key.pem b/services/console-proxy-rdp/rdpconsole/src/test/doc/rdp-key.pem new file mode 100644 index 00000000000..cd050cd475a --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/test/doc/rdp-key.pem @@ -0,0 +1,23 @@ +Bag Attributes + Microsoft Local Key set: + localKeyID: 01 00 00 00 + friendlyName: 8fcf718d-921f-4bfc-9ae4-f63e9c66b6c7 + Microsoft CSP Name: Microsoft RSA SChannel Cryptographic Provider +Key Attributes + X509v3 Key Usage: 10 +-----BEGIN PRIVATE KEY----- +MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAKrmMXjeoXRn6UFf +Hmw2HOnT/mEeSWQANzquJnKDBORIjD2rxL3h5FQ/DQUF4gm5JvBll8uWpDX11mVm +LlAZ2kA8KuJ2JuYEvu/GwuDyrP4D1sOiCwIjJnvmg5DjLB9sll5ohMbjMtiSFm5L +/YJNXop/pGJucvVzL4t0ZJ1zT2lZAgMBAAECgYAN/OJeuyyQeD+iXweaVTS5OzJ7 +PrBEgM03pQpp9zXx/P6LJUe1c2UUM8bvVGoJ+eW2HNkES/oSN2MLEKAVl7aCLWTe +7Ejc3JIRB7ZRdNt89w9XvxuRSn87pO082ciMsLvEqqDYahy3BxgI0J/GKbo28Zme +Z9f9QNCZ8TzbXJbDmwJBANVpBSfi09n5fUy3nGurGxE3chBnyik+Rft63fZp9eiD +lU5Q4l22+ZUTBChJUtLHztihcb4a4RQX6B4nH5Y1RtMCQQDNAVBKe2VfnFeEoIX7 +ooRnIKIVMxW08GENuJz64otshfH6jRaLL4E/QJLIpoNRFqafyuMkP5x8oZ3uvV1+ +nsujAkAd0Xez9ACP00lLn9gOPzEf/bRFUIsxqg7TLX64AGQoocIJ2ElYuMk0qByL +mHsnEl33bM9ctZq/WPvIwsSqEzWbAkAcb/k2S8W1LJfLUwUi8dlSAOna7Pou3kVo +RNqpxrE2faIicl3VMuLH5mo2ITsIDY9RjTBS/+vyMe0Zh/UnMlnnAkAAppLiJ15o +L3JlVbGRN+4kCP2HVtVRVIl3OlBoVSJZ5qe+s7HowTGurU/iYr1kmWd/C5sU0KPB +evwz8pdL08vr +-----END PRIVATE KEY----- diff --git a/services/console-proxy-rdp/rdpconsole/src/test/java/rdpclient/MockServerTest.java b/services/console-proxy-rdp/rdpconsole/src/test/java/rdpclient/MockServerTest.java new file mode 100644 index 00000000000..cba01fd6a49 --- /dev/null +++ b/services/console-proxy-rdp/rdpconsole/src/test/java/rdpclient/MockServerTest.java @@ -0,0 +1,189 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package rdpclient; + +import static rdpclient.MockServer.Packet.PacketType.CLIENT; +import static rdpclient.MockServer.Packet.PacketType.SERVER; +import static rdpclient.MockServer.Packet.PacketType.UPGRADE_TO_SSL; + +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.Socket; + +import javax.net.SocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; + +import junit.framework.TestCase; +import rdpclient.MockServer.Packet; + +public class MockServerTest extends TestCase { + + public void testIsMockServerCanRespond() throws Exception { + + final byte[] mockClientData = new byte[] { 0x01, 0x02, 0x03 }; + final byte[] mockServerData = new byte[] { 0x03, 0x02, 0x01 }; + + MockServer server = new MockServer(new Packet[] { new Packet("Client hello") { + { + type = CLIENT; + data = mockClientData; + } + }, new Packet("Server hello") { + { + type = SERVER; + data = mockServerData; + } + } }); + + server.start(); + + // Connect to server and send and receive mock data + + Socket socket = SocketFactory.getDefault().createSocket(); + try { + socket.connect(server.getAddress()); + + InputStream is = socket.getInputStream(); + OutputStream os = socket.getOutputStream(); + + // Write mock data to server + os.write(mockClientData); + + // Read data from server + byte actualData[] = new byte[mockServerData.length]; + int actualDataLength = is.read(actualData); + + // Compare mock data with actual data + assertEquals("Unexpected length of actual data read from server.", mockServerData.length, actualDataLength); + + for (int i = 0; i < actualDataLength; i++) { + assertEquals("Unexpected byte #" + i + " in response", mockServerData[i], actualData[i]); + } + + server.waitUntilShutdowned(1 * 1000 /* up to 1 second */); + + assertNull("Unexpected exception at mock server side.", server.getException()); + assertTrue("Server is not shutdowned at after conversation.", server.isShutdowned()); + + } finally { + socket.close(); + } + } + + public void testIsMockServerCanUpgradeConnectionToSsl() throws Exception { + + final byte[] mockClientData1 = new byte[] { 0x01, 0x02, 0x03 }; + final byte[] mockServerData1 = new byte[] { 0x03, 0x02, 0x01 }; + + final byte[] mockClientData2 = new byte[] { 0x02, 0x04, 0x02, 0x03 }; + final byte[] mockServerData2 = new byte[] { 0x02, 0x02, 0x01, 0x04 }; + + MockServer server = new MockServer(new Packet[] { new Packet("Client hello") { + { + type = CLIENT; + data = mockClientData1; + } + }, new Packet("Server hello") { + { + type = SERVER; + data = mockServerData1; + } + }, new Packet("Upgrade connection to SSL") { + { + type = UPGRADE_TO_SSL; + } + }, new Packet("Client data over SSL") { + { + type = CLIENT; + data = mockClientData2; + } + }, new Packet("Server data over SSL") { + { + type = SERVER; + data = mockServerData2; + } + } }); + + server.start(); + + // Connect to server and send and receive mock data + + Socket socket = SocketFactory.getDefault().createSocket(); + try { + InetSocketAddress address = server.getAddress(); + socket.connect(address); + + // Send hello data over plain connection + { + InputStream is = socket.getInputStream(); + OutputStream os = socket.getOutputStream(); + + // Write mock data to server + os.write(mockClientData1); + + // Read data from server + byte actualData[] = new byte[mockServerData1.length]; + int actualDataLength = is.read(actualData); + + // Compare mock data with actual data + assertEquals("Unexpected length of actual data read from server.", mockServerData1.length, actualDataLength); + + for (int i = 0; i < actualDataLength; i++) { + assertEquals("Unexpected byte #" + i + " in response", mockServerData1[i], actualData[i]); + } + } + + // Upgrade connection to SSL and send mock data + { + //System.setProperty("javax.net.debug", "ssl"); + + final SSLSocketFactory sslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault(); + SSLSocket sslSocket = (SSLSocket) sslSocketFactory.createSocket(socket, address.getHostString(), address.getPort(), true); + sslSocket.setEnabledCipherSuites(sslSocket.getSupportedCipherSuites()); + sslSocket.startHandshake(); + + InputStream is = sslSocket.getInputStream(); + OutputStream os = sslSocket.getOutputStream(); + + // Write mock data to server + os.write(mockClientData2); + + // Read data from server + byte actualData[] = new byte[mockServerData2.length]; + int actualDataLength = is.read(actualData); + + // Compare mock data with actual data + assertEquals("Unexpected length of actual data read from server.", mockServerData2.length, actualDataLength); + + for (int i = 0; i < actualDataLength; i++) { + assertEquals("Unexpected byte #" + i + " in response", mockServerData2[i], actualData[i]); + } + + } + + server.waitUntilShutdowned(1 * 1000 /* up to 1 second */); + + assertNull("Unexpected exception at mock server side.", server.getException()); + assertTrue("Server is not shutdowned at after conversation.", server.isShutdowned()); + } finally { + socket.close(); + } + + } +} From 810bfa90e25c3824c7e304487b35b8cdb5cc2689 Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Fri, 8 Nov 2013 14:51:04 +0530 Subject: [PATCH 087/108] Integrating the rdp client to get build in the regular build process. --- services/console-proxy-rdp/rdpconsole/pom.xml | 5 ++--- services/pom.xml | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/console-proxy-rdp/rdpconsole/pom.xml b/services/console-proxy-rdp/rdpconsole/pom.xml index d1b4918f316..71d0241d671 100644 --- a/services/console-proxy-rdp/rdpconsole/pom.xml +++ b/services/console-proxy-rdp/rdpconsole/pom.xml @@ -19,13 +19,12 @@ 4.0.0 - rdpclient - rdpclient + cloudstack-service-console-proxy-rdpclient 4.3.0-SNAPSHOT jar - rdpclient + Apache CloudStack Console Proxy - RDP Client http://maven.apache.org diff --git a/services/pom.xml b/services/pom.xml index c2f7f88ad88..5d1403b18c8 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -32,6 +32,7 @@ console-proxy + console-proxy-rdp/rdpconsole secondary-storage From b36ed1289acf9f5a1d52242f2febb3e56ea91163 Mon Sep 17 00:00:00 2001 From: Sebastien Goasguen Date: Fri, 8 Nov 2013 03:49:36 -0500 Subject: [PATCH 088/108] CLOUDSTACK-4998 additional bug fixed --- .../org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java index 6da4b6c9034..6b3e4ddf3ad 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java @@ -107,7 +107,7 @@ public class AssignVMCmd extends BaseCmd { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to move vm"); } UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", userVm).get(0); - response.setResponseName(DeployVMCmd.getResultObjectName()); + response.setResponseName(getCommandName()); this.setResponseObject(response); }catch (Exception e){ e.printStackTrace(); From ea2eafcd85da6cafb8b35563d9abb472d176799f Mon Sep 17 00:00:00 2001 From: John Kinsella Date: Thu, 7 Nov 2013 19:54:30 -0800 Subject: [PATCH 089/108] Summary: Implement stored-password encryption for Stratosphere plugin BUG-ID: CLOUDSTACK-4929 Bugfix-for: Reviewed-by: Reported-by: Signed-off-by: John Kinsella 1383882870 -0800 Signed-off-by: Abhinandan Prateek --- .../src/org/apache/cloudstack/network/dao/SspCredentialVO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspCredentialVO.java b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspCredentialVO.java index 1780296841c..d828f64e645 100644 --- a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspCredentialVO.java +++ b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspCredentialVO.java @@ -23,6 +23,8 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; +import com.cloud.utils.db.Encrypt; + @Entity @Table(name="external_stratosphere_ssp_credentials") public class SspCredentialVO { @@ -38,6 +40,7 @@ public class SspCredentialVO { @Column(name="username") private String username; + @Encrypt @Column(name="password") private String password; From 089f43a1ebe32bbd7e71b58f1af7076b3324e725 Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Wed, 6 Nov 2013 22:41:38 +0530 Subject: [PATCH 090/108] Added fix for bug 5056. The fix contains fixes related to ssh library majorly. Complete description should be available under bug description. Signed-off-by: Santhosh Edukulla Signed-off-by: SrikanteswaraRao Talluri --- tools/marvin/marvin/codes.py | 2 + tools/marvin/marvin/integration/lib/utils.py | 17 ++- tools/marvin/marvin/remoteSSHClient.py | 150 ++++++++++++++----- 3 files changed, 127 insertions(+), 42 deletions(-) diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py index b6580d0d199..f409c7c8d13 100644 --- a/tools/marvin/marvin/codes.py +++ b/tools/marvin/marvin/codes.py @@ -40,3 +40,5 @@ EMPTY_LIST = "EMPTY_LIST" FAIL = 0 PASS = 1 MATCH_NOT_FOUND = "ELEMENT NOT FOUND IN THE INPUT" +SUCCESS = "SUCCESS" +EXCEPTION_OCCURRED = "Exception Occurred" diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index 4d048f0f4e9..f5d7c5bdf83 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -113,8 +113,16 @@ def cleanup_resources(api_client, resources): obj.delete(api_client) -def is_server_ssh_ready(ipaddress, port, username, password, retries=10, timeout=30, keyPairFileLocation=None): - """Return ssh handle else wait till sshd is running""" +def is_server_ssh_ready(ipaddress, port, username, password, retries=10, retryinterv=30, timeout=3.0, keyPairFileLocation=None): + ''' + @Name: is_server_ssh_ready + @Input: timeout: tcp connection timeout flag, + others information need to be added + @Output:object for remoteSSHClient + Name of the function is little misnomer and is not + verifying anything as such mentioned + ''' + try: ssh = remoteSSHClient( host=ipaddress, @@ -123,9 +131,10 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=10, timeout passwd=password, keyPairFileLocation=keyPairFileLocation, retries=retries, - delay=timeout) + delay=retryinterv, + timeout=timeout) except Exception, e: - raise Exception("Failed to bring up ssh service in time. Waited %ss. Error is %s" % (retries * timeout, e)) + raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, e)) else: return ssh diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py index fea9b125d19..19df16e507f 100644 --- a/tools/marvin/marvin/remoteSSHClient.py +++ b/tools/marvin/marvin/remoteSSHClient.py @@ -20,57 +20,48 @@ import time import cloudstackException import contextlib import logging +from marvin.codes import ( + SUCCESS, FAIL, INVALID_INPUT, EXCEPTION_OCCURRED + ) from contextlib import closing class remoteSSHClient(object): + ''' + Added timeout flag for ssh connect calls.Default to 3.0 seconds + ''' def __init__(self, host, port, user, passwd, retries=10, delay=30, - log_lvl=logging.INFO, keyPairFileLocation=None): - self.host = host - self.port = port + log_lvl=logging.INFO, keyPairFiles=None, timeout=3.0): + self.host = None + self.port = 22 self.user = user self.passwd = passwd - self.keyPairFile = keyPairFileLocation + self.keyPairFiles = keyPairFiles self.ssh = paramiko.SSHClient() self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.logger = logging.getLogger('sshClient') + self.retryCnt = 0 + self.delay = 0 + self.timeout = 3.0 ch = logging.StreamHandler() ch.setLevel(log_lvl) self.logger.addHandler(ch) - retry_count = retries - while retry_count >= 0: - try: - if keyPairFileLocation is None: - self.ssh.connect(str(host), int(port), user, passwd) - self.logger.debug("SSH connect: %s@%s with passwd %s" % - (user, str(host), passwd)) - else: - self.ssh.connect(hostname=str(host), - port=int(port), - username=str(user), - key_filename=str(keyPairFileLocation), - look_for_keys=False - ) - self.logger.debug( - "connecting to server %s with user %s key %s" % - (str(host), user, keyPairFileLocation)) - self.logger.debug("SSH connect: %s@%s with passwd %s" % - (user, str(host), passwd)) - #except paramiko.AuthenticationException, authEx: - # raise cloudstackException. \ - # InvalidParameterException("Invalid credentials to " - # + "login to %s on port %s" % - # (str(host), port)) - except Exception as se: - if retry_count == 0: - raise cloudstackException. \ - InvalidParameterException(repr(se)) - else: - return - - retry_count = retry_count - 1 - time.sleep(delay) + #Check invalid host value and raise exception + #Atleast host is required for connection + if host is not None and host != '': + self.host = host + if retries is not None and retries > 0: + self.retryCnt = retries + if delay is not None and delay > 0: + self.delay = delay + if timeout is not None and timeout > 0: + self.timeout = timeout + if port is not None or port >= 0: + self.port = port + if self.createConnection() == FAIL: + raise cloudstackException.\ + internalError("Connection Failed") def execute(self, command): stdin, stdout, stderr = self.ssh.exec_command(command) @@ -89,6 +80,88 @@ class remoteSSHClient(object): (command, str(self.host), results)) return results + def createConnection(self): + ''' + @Name: createConnection + @Desc: Creates an ssh connection for + retries mentioned,along with sleep mentioned + @Output: SUCCESS on successful connection + FAIL If connection through ssh failed + ''' + ret = FAIL + while self.retryCnt >= 0: + try: + self.logger.debug("SSH Connection: Host:%s User:%s\ + Port:%s KeyPairFile: %s" % + (self.host, self.user, str(self.port), + str(self.keyPairFiles))) + if self.keyPairFiles is None: + self.ssh.connect(hostname=self.host, + port=self.port, + username=self.user, + password=self.passwd, + timeout=self.timeout) + else: + self.ssh.connect(hostname=self.host, + port=self.port, + username=self.user, + password=self.passwd, + key_filename=self.keyPairFiles, + timeout=self.timeout, + look_for_keys=False + ) + ret = SUCCESS + break + except Exception as se: + self.retryCnt = self.retryCnt - 1 + if self.retryCnt == 0: + break + time.sleep(self.delay) + return ret + + def runCommand(self, command): + ''' + @Name: runCommand + @Desc: Runs a command over ssh and + returns the result along with status code + @Input: command to execute + @Output: 1: status of command executed. + Default to None + SUCCESS : If command execution is successful + FAIL : If command execution has failed + EXCEPTION_OCCURRED: Exception occurred while executing + command + INVALID_INPUT : If invalid value for command is passed + 2: stdin,stdout,stderr values of command output + ''' + excep_msg = '' + ret = {"status": None, "stdin": None, "stdout": None, "stderr": None} + if command is None or command == '': + ret["status"] = INVALID_INPUT + return ret + try: + status_check = 1 + stdin, stdout, stderr = self.ssh.exec_command(command) + output = stdout.readlines() + errors = stderr.readlines() + inp = stdin.readlines() + ret["stdin"] = inp + ret["stdout"] = output + ret["stderr"] = errors + if stdout is not None: + status_check = stdout.channel.recv_exit_status() + if status_check == 0: + ret["status"] = SUCCESS + else: + ret["status"] = FAIL + except Exception as e: + excep_msg = str(e) + ret["status"] = EXCEPTION_OCCURRED + finally: + self.logger.debug(" Host: %s Cmd: %s Output:%s Exception: %s" % + (self.host, command, str(ret), excep_msg)) + return ret + def scp(self, srcFile, destPath): transport = paramiko.Transport((self.host, int(self.port))) transport.connect(username=self.user, password=self.passwd) @@ -99,7 +172,8 @@ class remoteSSHClient(object): raise e def close(self): - self.ssh.close() + if self.ssh is not None: + self.ssh.close() if __name__ == "__main__": From 3342a82f39900f2ee733cb5d684d54992d14a413 Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Thu, 7 Nov 2013 21:18:22 +0530 Subject: [PATCH 091/108] Increasing the timeout values to 600 seconds from 300 seconds Timeout for ssh related test cases is increased based upon few test run observations where ssh is taking more time during restart scenarios as an example. We have done few changes to streamline ssh library. This is in addition to those to keep less ssh script issues Signed-off-by: Santhosh Edukulla Signed-off-by: SrikanteswaraRao Talluri --- tools/marvin/marvin/integration/lib/utils.py | 2 +- tools/marvin/marvin/remoteSSHClient.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index f5d7c5bdf83..58a9bf9ae99 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -113,7 +113,7 @@ def cleanup_resources(api_client, resources): obj.delete(api_client) -def is_server_ssh_ready(ipaddress, port, username, password, retries=10, retryinterv=30, timeout=3.0, keyPairFileLocation=None): +def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryinterv=30, timeout=10.0, keyPairFileLocation=None): ''' @Name: is_server_ssh_ready @Input: timeout: tcp connection timeout flag, diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py index 19df16e507f..c9720e39e40 100644 --- a/tools/marvin/marvin/remoteSSHClient.py +++ b/tools/marvin/marvin/remoteSSHClient.py @@ -30,8 +30,8 @@ class remoteSSHClient(object): ''' Added timeout flag for ssh connect calls.Default to 3.0 seconds ''' - def __init__(self, host, port, user, passwd, retries=10, delay=30, - log_lvl=logging.INFO, keyPairFiles=None, timeout=3.0): + def __init__(self, host, port, user, passwd, retries=20, delay=30, + log_lvl=logging.INFO, keyPairFiles=None, timeout=10.0): self.host = None self.port = 22 self.user = user From ec00a6fb74042259ceea6add676de3f15e642d4a Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Fri, 8 Nov 2013 16:02:10 +0530 Subject: [PATCH 092/108] CLOUSTACK-5099: Utils.py-has-wrong-reference, cleaned it. As well added Uniform naming convention Signed-off-by: SrikanteswaraRao Talluri --- .../test_egress_rules_host_maintenance.py | 2 +- .../component/maint/test_high_availability.py | 2 +- .../maint/test_vpc_host_maintenance.py | 2 +- test/integration/component/test_accounts.py | 2 +- .../component/test_affinity_groups.py | 2 +- .../integration/component/test_asa1000v_fw.py | 2 +- test/integration/component/test_baremetal.py | 2 +- .../component/test_deploy_vm_userdata_reg.py | 2 +- .../component/test_egress_fw_rules.py | 4 +- .../component/test_egress_rules.py | 2 +- test/integration/component/test_eip_elb.py | 18 +- .../component/test_explicit_dedication.py | 2 +- test/integration/component/test_haproxy.py | 4 +- .../component/test_implicit_planner.py | 2 +- .../component/test_netscaler_configs.py | 16 +- .../component/test_netscaler_lb.py | 20 +- .../component/test_netscaler_lb_algo.py | 32 +- .../component/test_netscaler_lb_sticky.py | 20 +- .../component/test_netscaler_nw_off.py | 2 +- .../component/test_network_offering.py | 2 +- .../integration/component/test_portable_ip.py | 6 +- .../component/test_project_configs.py | 2 +- .../component/test_project_resources.py | 2 +- .../component/test_project_usage.py | 2 +- test/integration/component/test_projects.py | 2 +- .../component/test_security_groups.py | 6 +- .../component/test_snapshot_limits.py | 2 +- test/integration/component/test_stopped_vm.py | 2 +- .../component/test_storage_motion.py | 2 +- test/integration/component/test_templates.py | 2 +- test/integration/component/test_usage.py | 2 +- .../component/test_vm_passwdenabled.py | 2 +- .../integration/component/test_vpc_network.py | 2 +- .../component/test_vpc_offerings.py | 2 +- .../integration/component/test_vpc_routers.py | 2 +- .../component/test_vpc_vm_life_cycle.py | 2 +- .../component/test_vpc_vm_life_cycle.py.rej | 10 + .../component/test_vpc_vms_deployment.py | 2 +- .../integration/smoke/test_affinity_groups.py | 2 +- test/integration/smoke/test_loadbalance.py | 4 +- test/integration/smoke/test_network.py | 10 +- test/integration/smoke/test_nic.py | 2 +- test/integration/smoke/test_pvlan.py | 2 +- .../integration/smoke/test_resource_detail.py | 2 +- test/integration/smoke/test_routers.py | 2 +- test/integration/smoke/test_ssvm.py | 2 +- test/integration/smoke/test_templates.py | 2 +- test/integration/smoke/test_volumes.py | 2 +- .../build/lib/marvin/TestCaseExecuteEngine.py | 102 + tools/marvin/build/lib/marvin/__init__.py | 18 + tools/marvin/build/lib/marvin/asyncJobMgr.py | 261 ++ .../lib/marvin/cloudstackAPI/__init__.py | 18 + .../marvin/cloudstackAPI/activateProject.py | 141 + .../cloudstackAPI/addAccountToProject.py | 40 + .../marvin/cloudstackAPI/addBaremetalDhcp.py | 54 + .../marvin/cloudstackAPI/addBaremetalHost.py | 147 + .../addBaremetalPxeKickStartServer.py | 51 + .../addBaremetalPxePingServer.py | 65 + .../cloudstackAPI/addBigSwitchVnsDevice.py | 45 + .../lib/marvin/cloudstackAPI/addCluster.py | 115 + .../build/lib/marvin/cloudstackAPI/addHost.py | 145 + .../lib/marvin/cloudstackAPI/addImageStore.py | 58 + .../lib/marvin/cloudstackAPI/addIpToNic.py | 44 + .../cloudstackAPI/addLdapConfiguration.py | 39 + .../marvin/cloudstackAPI/addNetworkDevice.py | 35 + .../addNetworkServiceProvider.py | 53 + .../cloudstackAPI/addNicToVirtualMachine.py | 374 ++ .../cloudstackAPI/addNiciraNvpDevice.py | 60 + .../lib/marvin/cloudstackAPI/addRegion.py | 48 + .../marvin/cloudstackAPI/addResourceDetail.py | 42 + .../build/lib/marvin/cloudstackAPI/addS3.py | 66 + .../cloudstackAPI/addSecondaryStorage.py | 52 + .../lib/marvin/cloudstackAPI/addSwift.py | 56 + .../marvin/cloudstackAPI/addTrafficMonitor.py | 49 + .../marvin/cloudstackAPI/addTrafficType.py | 55 + .../lib/marvin/cloudstackAPI/addUcsManager.py | 51 + .../lib/marvin/cloudstackAPI/addVpnUser.py | 57 + .../lib/marvin/cloudstackAPI/archiveAlerts.py | 41 + .../lib/marvin/cloudstackAPI/archiveEvents.py | 41 + .../assignToGlobalLoadBalancerRule.py | 41 + .../cloudstackAPI/assignToLoadBalancerRule.py | 39 + .../cloudstackAPI/assignVirtualMachine.py | 379 ++ .../cloudstackAPI/associateIpAddress.py | 130 + .../associateUcsProfileToBlade.py | 48 + .../lib/marvin/cloudstackAPI/attachIso.py | 372 ++ .../lib/marvin/cloudstackAPI/attachVolume.py | 148 + .../authorizeSecurityGroupEgress.py | 71 + .../authorizeSecurityGroupIngress.py | 71 + .../build/lib/marvin/cloudstackAPI/baseCmd.py | 20 + .../lib/marvin/cloudstackAPI/baseResponse.py | 20 + .../cloudstackAPI/cancelHostMaintenance.py | 122 + .../cloudstackAPI/cancelStorageMaintenance.py | 78 + .../cloudstackAPI/changeServiceForRouter.py | 154 + .../cloudstackAPI/changeServiceForSystemVm.py | 89 + .../changeServiceForVirtualMachine.py | 372 ++ .../cloudstackAPI/cleanVMReservations.py | 33 + .../cloudstackAPI/cloudstackAPIClient.py | 2513 ++++++++++++ .../configureInternalLoadBalancerElement.py | 41 + .../configureVirtualRouterElement.py | 51 + .../build/lib/marvin/cloudstackAPI/copyIso.py | 137 + .../lib/marvin/cloudstackAPI/copyTemplate.py | 137 + .../lib/marvin/cloudstackAPI/createAccount.py | 202 + .../cloudstackAPI/createAffinityGroup.py | 57 + .../cloudstackAPI/createAutoScalePolicy.py | 60 + .../cloudstackAPI/createAutoScaleVmGroup.py | 77 + .../cloudstackAPI/createAutoScaleVmProfile.py | 70 + .../marvin/cloudstackAPI/createCondition.py | 62 + .../lib/marvin/cloudstackAPI/createCounter.py | 48 + .../cloudstackAPI/createDiskOffering.py | 97 + .../lib/marvin/cloudstackAPI/createDomain.py | 54 + .../cloudstackAPI/createEgressFirewallRule.py | 94 + .../cloudstackAPI/createFirewallRule.py | 94 + .../createGlobalLoadBalancerRule.py | 161 + .../cloudstackAPI/createInstanceGroup.py | 54 + .../createInternalLoadBalancerElement.py | 38 + .../cloudstackAPI/createIpForwardingRule.py | 97 + .../createLBHealthCheckPolicy.py | 75 + .../cloudstackAPI/createLBStickinessPolicy.py | 75 + .../cloudstackAPI/createLoadBalancer.py | 127 + .../cloudstackAPI/createLoadBalancerRule.py | 116 + .../lib/marvin/cloudstackAPI/createNetwork.py | 251 ++ .../marvin/cloudstackAPI/createNetworkACL.py | 101 + .../cloudstackAPI/createNetworkACLList.py | 45 + .../cloudstackAPI/createNetworkOffering.py | 167 + .../cloudstackAPI/createPhysicalNetwork.py | 67 + .../lib/marvin/cloudstackAPI/createPod.py | 91 + .../cloudstackAPI/createPortForwardingRule.py | 109 + .../cloudstackAPI/createPortableIpRange.py | 85 + .../cloudstackAPI/createPrivateGateway.py | 86 + .../lib/marvin/cloudstackAPI/createProject.py | 148 + .../cloudstackAPI/createRemoteAccessVpn.py | 62 + .../marvin/cloudstackAPI/createSSHKeyPair.py | 44 + .../createSecondaryStagingStore.py | 58 + .../cloudstackAPI/createSecurityGroup.py | 131 + .../cloudstackAPI/createServiceOffering.py | 151 + .../marvin/cloudstackAPI/createSnapshot.py | 97 + .../cloudstackAPI/createSnapshotPolicy.py | 56 + .../marvin/cloudstackAPI/createStaticRoute.py | 80 + .../createStorageNetworkIpRange.py | 63 + .../marvin/cloudstackAPI/createStoragePool.py | 104 + .../lib/marvin/cloudstackAPI/createTags.py | 44 + .../marvin/cloudstackAPI/createTemplate.py | 161 + .../lib/marvin/cloudstackAPI/createUser.py | 87 + .../marvin/cloudstackAPI/createVMSnapshot.py | 72 + .../lib/marvin/cloudstackAPI/createVPC.py | 413 ++ .../marvin/cloudstackAPI/createVPCOffering.py | 109 + .../createVirtualRouterElement.py | 50 + .../marvin/cloudstackAPI/createVlanIpRange.py | 107 + .../lib/marvin/cloudstackAPI/createVolume.py | 163 + .../cloudstackAPI/createVpnConnection.py | 75 + .../cloudstackAPI/createVpnCustomerGateway.py | 90 + .../marvin/cloudstackAPI/createVpnGateway.py | 50 + .../lib/marvin/cloudstackAPI/createZone.py | 153 + .../marvin/cloudstackAPI/dedicateCluster.py | 49 + .../cloudstackAPI/dedicateGuestVlanRange.py | 61 + .../lib/marvin/cloudstackAPI/dedicateHost.py | 49 + .../lib/marvin/cloudstackAPI/dedicatePod.py | 49 + .../cloudstackAPI/dedicatePublicIpRange.py | 84 + .../lib/marvin/cloudstackAPI/dedicateZone.py | 49 + .../lib/marvin/cloudstackAPI/deleteAccount.py | 36 + .../cloudstackAPI/deleteAccountFromProject.py | 39 + .../cloudstackAPI/deleteAffinityGroup.py | 41 + .../lib/marvin/cloudstackAPI/deleteAlerts.py | 41 + .../cloudstackAPI/deleteAutoScalePolicy.py | 36 + .../cloudstackAPI/deleteAutoScaleVmGroup.py | 36 + .../cloudstackAPI/deleteAutoScaleVmProfile.py | 36 + .../cloudstackAPI/deleteBigSwitchVnsDevice.py | 36 + .../lib/marvin/cloudstackAPI/deleteCluster.py | 36 + .../marvin/cloudstackAPI/deleteCondition.py | 36 + .../lib/marvin/cloudstackAPI/deleteCounter.py | 36 + .../cloudstackAPI/deleteDiskOffering.py | 36 + .../lib/marvin/cloudstackAPI/deleteDomain.py | 38 + .../cloudstackAPI/deleteEgressFirewallRule.py | 36 + .../lib/marvin/cloudstackAPI/deleteEvents.py | 41 + .../cloudstackAPI/deleteFirewallRule.py | 36 + .../deleteGlobalLoadBalancerRule.py | 36 + .../lib/marvin/cloudstackAPI/deleteHost.py | 40 + .../marvin/cloudstackAPI/deleteImageStore.py | 36 + .../cloudstackAPI/deleteInstanceGroup.py | 36 + .../cloudstackAPI/deleteIpForwardingRule.py | 36 + .../lib/marvin/cloudstackAPI/deleteIso.py | 38 + .../deleteLBHealthCheckPolicy.py | 36 + .../cloudstackAPI/deleteLBStickinessPolicy.py | 36 + .../cloudstackAPI/deleteLdapConfiguration.py | 36 + .../cloudstackAPI/deleteLoadBalancer.py | 36 + .../cloudstackAPI/deleteLoadBalancerRule.py | 36 + .../lib/marvin/cloudstackAPI/deleteNetwork.py | 36 + .../marvin/cloudstackAPI/deleteNetworkACL.py | 36 + .../cloudstackAPI/deleteNetworkACLList.py | 36 + .../cloudstackAPI/deleteNetworkDevice.py | 36 + .../cloudstackAPI/deleteNetworkOffering.py | 36 + .../deleteNetworkServiceProvider.py | 36 + .../cloudstackAPI/deleteNiciraNvpDevice.py | 36 + .../cloudstackAPI/deletePhysicalNetwork.py | 36 + .../lib/marvin/cloudstackAPI/deletePod.py | 36 + .../cloudstackAPI/deletePortForwardingRule.py | 36 + .../cloudstackAPI/deletePortableIpRange.py | 36 + .../cloudstackAPI/deletePrivateGateway.py | 36 + .../lib/marvin/cloudstackAPI/deleteProject.py | 36 + .../cloudstackAPI/deleteProjectInvitation.py | 36 + .../cloudstackAPI/deleteRemoteAccessVpn.py | 36 + .../marvin/cloudstackAPI/deleteSSHKeyPair.py | 42 + .../deleteSecondaryStagingStore.py | 36 + .../cloudstackAPI/deleteSecurityGroup.py | 43 + .../cloudstackAPI/deleteServiceOffering.py | 36 + .../marvin/cloudstackAPI/deleteSnapshot.py | 36 + .../cloudstackAPI/deleteSnapshotPolicies.py | 37 + .../marvin/cloudstackAPI/deleteStaticRoute.py | 36 + .../deleteStorageNetworkIpRange.py | 36 + .../marvin/cloudstackAPI/deleteStoragePool.py | 38 + .../lib/marvin/cloudstackAPI/deleteTags.py | 41 + .../marvin/cloudstackAPI/deleteTemplate.py | 38 + .../cloudstackAPI/deleteTrafficMonitor.py | 36 + .../marvin/cloudstackAPI/deleteTrafficType.py | 36 + .../lib/marvin/cloudstackAPI/deleteUser.py | 36 + .../marvin/cloudstackAPI/deleteVMSnapshot.py | 36 + .../lib/marvin/cloudstackAPI/deleteVPC.py | 36 + .../marvin/cloudstackAPI/deleteVPCOffering.py | 36 + .../marvin/cloudstackAPI/deleteVlanIpRange.py | 36 + .../lib/marvin/cloudstackAPI/deleteVolume.py | 36 + .../cloudstackAPI/deleteVpnConnection.py | 36 + .../cloudstackAPI/deleteVpnCustomerGateway.py | 36 + .../marvin/cloudstackAPI/deleteVpnGateway.py | 36 + .../lib/marvin/cloudstackAPI/deleteZone.py | 36 + .../cloudstackAPI/deployVirtualMachine.py | 421 ++ .../lib/marvin/cloudstackAPI/destroyRouter.py | 151 + .../marvin/cloudstackAPI/destroySystemVm.py | 86 + .../cloudstackAPI/destroyVirtualMachine.py | 369 ++ .../lib/marvin/cloudstackAPI/detachIso.py | 369 ++ .../lib/marvin/cloudstackAPI/detachVolume.py | 146 + .../marvin/cloudstackAPI/disableAccount.py | 179 + .../cloudstackAPI/disableAutoScaleVmGroup.py | 60 + .../marvin/cloudstackAPI/disableStaticNat.py | 36 + .../lib/marvin/cloudstackAPI/disableUser.py | 66 + .../cloudstackAPI/disassociateIpAddress.py | 36 + .../lib/marvin/cloudstackAPI/enableAccount.py | 176 + .../cloudstackAPI/enableAutoScaleVmGroup.py | 60 + .../marvin/cloudstackAPI/enableStaticNat.py | 43 + .../cloudstackAPI/enableStorageMaintenance.py | 78 + .../lib/marvin/cloudstackAPI/enableUser.py | 66 + .../lib/marvin/cloudstackAPI/extractIso.py | 65 + .../marvin/cloudstackAPI/extractTemplate.py | 65 + .../lib/marvin/cloudstackAPI/extractVolume.py | 66 + .../cloudstackAPI/findHostsForMigration.py | 126 + .../findStoragePoolsForMigration.py | 84 + .../cloudstackAPI/generateUsageRecords.py | 41 + .../lib/marvin/cloudstackAPI/getApiLimit.py | 39 + .../cloudstackAPI/getCloudIdentifier.py | 38 + .../build/lib/marvin/cloudstackAPI/getUser.py | 66 + .../lib/marvin/cloudstackAPI/getVMPassword.py | 34 + .../marvin/cloudstackAPI/ldapCreateAccount.py | 190 + .../lib/marvin/cloudstackAPI/listAccounts.py | 192 + .../cloudstackAPI/listAffinityGroupTypes.py | 37 + .../cloudstackAPI/listAffinityGroups.py | 67 + .../lib/marvin/cloudstackAPI/listAlerts.py | 47 + .../lib/marvin/cloudstackAPI/listApis.py | 75 + .../lib/marvin/cloudstackAPI/listAsyncJobs.py | 69 + .../cloudstackAPI/listAutoScalePolicies.py | 71 + .../cloudstackAPI/listAutoScaleVmGroups.py | 83 + .../cloudstackAPI/listAutoScaleVmProfiles.py | 75 + .../marvin/cloudstackAPI/listBaremetalDhcp.py | 49 + .../cloudstackAPI/listBaremetalPxeServers.py | 45 + .../cloudstackAPI/listBigSwitchVnsDevices.py | 49 + .../marvin/cloudstackAPI/listCapabilities.py | 49 + .../lib/marvin/cloudstackAPI/listCapacity.py | 67 + .../lib/marvin/cloudstackAPI/listClusters.py | 102 + .../marvin/cloudstackAPI/listConditions.py | 69 + .../cloudstackAPI/listConfigurations.py | 59 + .../lib/marvin/cloudstackAPI/listCounters.py | 51 + .../cloudstackAPI/listDedicatedClusters.py | 55 + .../listDedicatedGuestVlanRanges.py | 67 + .../cloudstackAPI/listDedicatedHosts.py | 55 + .../marvin/cloudstackAPI/listDedicatedPods.py | 55 + .../cloudstackAPI/listDedicatedZones.py | 55 + .../cloudstackAPI/listDeploymentPlanners.py | 37 + .../marvin/cloudstackAPI/listDiskOfferings.py | 77 + .../cloudstackAPI/listDomainChildren.py | 59 + .../lib/marvin/cloudstackAPI/listDomains.py | 59 + .../cloudstackAPI/listEgressFirewallRules.py | 102 + .../marvin/cloudstackAPI/listEventTypes.py | 31 + .../lib/marvin/cloudstackAPI/listEvents.py | 85 + .../marvin/cloudstackAPI/listFirewallRules.py | 98 + .../listGlobalLoadBalancerRules.py | 161 + .../lib/marvin/cloudstackAPI/listHosts.py | 147 + .../listHypervisorCapabilities.py | 55 + .../marvin/cloudstackAPI/listHypervisors.py | 33 + .../marvin/cloudstackAPI/listImageStores.py | 63 + .../cloudstackAPI/listInstanceGroups.py | 65 + .../listInternalLoadBalancerElements.py | 47 + .../listInternalLoadBalancerVMs.py | 182 + .../cloudstackAPI/listIpForwardingRules.py | 104 + .../cloudstackAPI/listIsoPermissions.py | 42 + .../lib/marvin/cloudstackAPI/listIsos.py | 162 + .../listLBHealthCheckPolicies.py | 69 + .../cloudstackAPI/listLBStickinessPolicies.py | 71 + .../cloudstackAPI/listLdapConfigurations.py | 43 + .../lib/marvin/cloudstackAPI/listLdapUsers.py | 47 + .../listLoadBalancerRuleInstances.py | 377 ++ .../cloudstackAPI/listLoadBalancerRules.py | 118 + .../marvin/cloudstackAPI/listLoadBalancers.py | 132 + .../cloudstackAPI/listNetworkACLLists.py | 51 + .../marvin/cloudstackAPI/listNetworkACLs.py | 108 + .../marvin/cloudstackAPI/listNetworkDevice.py | 41 + .../listNetworkIsolationMethods.py | 37 + .../cloudstackAPI/listNetworkOfferings.py | 166 + .../listNetworkServiceProviders.py | 55 + .../lib/marvin/cloudstackAPI/listNetworks.py | 243 ++ .../listNiciraNvpDeviceNetworks.py | 208 + .../cloudstackAPI/listNiciraNvpDevices.py | 53 + .../lib/marvin/cloudstackAPI/listNics.py | 72 + .../marvin/cloudstackAPI/listOsCategories.py | 43 + .../lib/marvin/cloudstackAPI/listOsTypes.py | 47 + .../cloudstackAPI/listPhysicalNetworks.py | 61 + .../lib/marvin/cloudstackAPI/listPods.py | 88 + .../cloudstackAPI/listPortForwardingRules.py | 104 + .../cloudstackAPI/listPortableIpRanges.py | 78 + .../cloudstackAPI/listPrivateGateways.py | 89 + .../cloudstackAPI/listProjectAccounts.py | 151 + .../cloudstackAPI/listProjectInvitations.py | 67 + .../lib/marvin/cloudstackAPI/listProjects.py | 162 + .../cloudstackAPI/listPublicIpAddresses.py | 156 + .../lib/marvin/cloudstackAPI/listRegions.py | 49 + .../cloudstackAPI/listRemoteAccessVpns.py | 70 + .../cloudstackAPI/listResourceDetails.py | 71 + .../cloudstackAPI/listResourceLimits.py | 63 + .../lib/marvin/cloudstackAPI/listRouters.py | 182 + .../build/lib/marvin/cloudstackAPI/listS3s.py | 53 + .../marvin/cloudstackAPI/listSSHKeyPairs.py | 55 + .../listSecondaryStagingStores.py | 63 + .../cloudstackAPI/listSecurityGroups.py | 144 + .../cloudstackAPI/listServiceOfferings.py | 124 + .../cloudstackAPI/listSnapshotPolicies.py | 50 + .../lib/marvin/cloudstackAPI/listSnapshots.py | 118 + .../marvin/cloudstackAPI/listStaticRoutes.py | 98 + .../listStorageNetworkIpRange.py | 59 + .../marvin/cloudstackAPI/listStoragePools.py | 97 + .../cloudstackAPI/listStorageProviders.py | 42 + .../listSupportedNetworkServices.py | 71 + .../lib/marvin/cloudstackAPI/listSwifts.py | 55 + .../lib/marvin/cloudstackAPI/listSystemVms.py | 105 + .../lib/marvin/cloudstackAPI/listTags.py | 75 + .../cloudstackAPI/listTemplatePermissions.py | 42 + .../lib/marvin/cloudstackAPI/listTemplates.py | 157 + .../cloudstackAPI/listTrafficMonitors.py | 48 + .../listTrafficTypeImplementors.py | 41 + .../marvin/cloudstackAPI/listTrafficTypes.py | 52 + .../lib/marvin/cloudstackAPI/listUcsBlades.py | 48 + .../marvin/cloudstackAPI/listUcsManagers.py | 47 + .../marvin/cloudstackAPI/listUcsProfiles.py | 40 + .../marvin/cloudstackAPI/listUsageRecords.py | 101 + .../marvin/cloudstackAPI/listUsageTypes.py | 33 + .../lib/marvin/cloudstackAPI/listUsers.py | 85 + .../marvin/cloudstackAPI/listVMSnapshot.py | 89 + .../marvin/cloudstackAPI/listVPCOfferings.py | 116 + .../lib/marvin/cloudstackAPI/listVPCs.py | 426 ++ .../cloudstackAPI/listVirtualMachines.py | 416 ++ .../listVirtualRouterElements.py | 57 + .../marvin/cloudstackAPI/listVlanIpRanges.py | 99 + .../lib/marvin/cloudstackAPI/listVolumes.py | 172 + .../cloudstackAPI/listVpnConnections.py | 89 + .../cloudstackAPI/listVpnCustomerGateways.py | 81 + .../marvin/cloudstackAPI/listVpnGateways.py | 67 + .../lib/marvin/cloudstackAPI/listVpnUsers.py | 65 + .../lib/marvin/cloudstackAPI/listZones.py | 141 + .../lib/marvin/cloudstackAPI/lockAccount.py | 176 + .../lib/marvin/cloudstackAPI/lockUser.py | 66 + .../build/lib/marvin/cloudstackAPI/login.py | 63 + .../build/lib/marvin/cloudstackAPI/logout.py | 31 + .../markDefaultZoneForAccount.py | 179 + .../marvin/cloudstackAPI/migrateSystemVm.py | 89 + .../cloudstackAPI/migrateVirtualMachine.py | 373 ++ .../migrateVirtualMachineWithVolume.py | 374 ++ .../lib/marvin/cloudstackAPI/migrateVolume.py | 148 + .../prepareHostForMaintenance.py | 122 + .../marvin/cloudstackAPI/prepareTemplate.py | 134 + .../cloudstackAPI/queryAsyncJobResult.py | 56 + .../lib/marvin/cloudstackAPI/rebootRouter.py | 151 + .../marvin/cloudstackAPI/rebootSystemVm.py | 86 + .../cloudstackAPI/rebootVirtualMachine.py | 369 ++ .../lib/marvin/cloudstackAPI/reconnectHost.py | 122 + .../cloudstackAPI/recoverVirtualMachine.py | 369 ++ .../lib/marvin/cloudstackAPI/registerIso.py | 162 + .../cloudstackAPI/registerSSHKeyPair.py | 47 + .../marvin/cloudstackAPI/registerTemplate.py | 179 + .../marvin/cloudstackAPI/registerUserKeys.py | 36 + .../cloudstackAPI/releaseDedicatedCluster.py | 36 + .../releaseDedicatedGuestVlanRange.py | 36 + .../cloudstackAPI/releaseDedicatedHost.py | 36 + .../cloudstackAPI/releaseDedicatedPod.py | 36 + .../cloudstackAPI/releaseDedicatedZone.py | 36 + .../cloudstackAPI/releaseHostReservation.py | 36 + .../cloudstackAPI/releasePublicIpRange.py | 36 + .../removeFromGlobalLoadBalancerRule.py | 39 + .../removeFromLoadBalancerRule.py | 39 + .../marvin/cloudstackAPI/removeIpFromNic.py | 36 + .../removeNicFromVirtualMachine.py | 372 ++ .../lib/marvin/cloudstackAPI/removeRegion.py | 36 + .../cloudstackAPI/removeResourceDetail.py | 41 + .../lib/marvin/cloudstackAPI/removeVpnUser.py | 42 + .../cloudstackAPI/replaceNetworkACLList.py | 40 + .../lib/marvin/cloudstackAPI/resetApiLimit.py | 41 + .../resetPasswordForVirtualMachine.py | 369 ++ .../resetSSHKeyForVirtualMachine.py | 378 ++ .../cloudstackAPI/resetVpnConnection.py | 76 + .../lib/marvin/cloudstackAPI/resizeVolume.py | 148 + .../marvin/cloudstackAPI/restartNetwork.py | 119 + .../lib/marvin/cloudstackAPI/restartVPC.py | 393 ++ .../cloudstackAPI/restoreVirtualMachine.py | 371 ++ .../marvin/cloudstackAPI/revertSnapshot.py | 91 + .../cloudstackAPI/revertToVMSnapshot.py | 369 ++ .../revokeSecurityGroupEgress.py | 36 + .../revokeSecurityGroupIngress.py | 36 + .../lib/marvin/cloudstackAPI/scaleSystemVm.py | 89 + .../cloudstackAPI/scaleVirtualMachine.py | 39 + .../startInternalLoadBalancerVM.py | 151 + .../lib/marvin/cloudstackAPI/startRouter.py | 151 + .../lib/marvin/cloudstackAPI/startSystemVm.py | 86 + .../cloudstackAPI/startVirtualMachine.py | 371 ++ .../stopInternalLoadBalancerVM.py | 153 + .../lib/marvin/cloudstackAPI/stopRouter.py | 153 + .../lib/marvin/cloudstackAPI/stopSystemVm.py | 88 + .../cloudstackAPI/stopVirtualMachine.py | 371 ++ .../marvin/cloudstackAPI/suspendProject.py | 141 + .../lib/marvin/cloudstackAPI/updateAccount.py | 183 + .../cloudstackAPI/updateAutoScalePolicy.py | 58 + .../cloudstackAPI/updateAutoScaleVmGroup.py | 70 + .../cloudstackAPI/updateAutoScaleVmProfile.py | 64 + .../lib/marvin/cloudstackAPI/updateCluster.py | 91 + .../cloudstackAPI/updateConfiguration.py | 54 + .../updateDefaultNicForVirtualMachine.py | 372 ++ .../cloudstackAPI/updateDiskOffering.py | 76 + .../lib/marvin/cloudstackAPI/updateDomain.py | 52 + .../updateGlobalLoadBalancerRule.py | 148 + .../lib/marvin/cloudstackAPI/updateHost.py | 130 + .../cloudstackAPI/updateHostPassword.py | 43 + .../updateHypervisorCapabilities.py | 51 + .../cloudstackAPI/updateInstanceGroup.py | 50 + .../lib/marvin/cloudstackAPI/updateIso.py | 149 + .../cloudstackAPI/updateIsoPermissions.py | 48 + .../cloudstackAPI/updateLoadBalancerRule.py | 97 + .../lib/marvin/cloudstackAPI/updateNetwork.py | 216 + .../cloudstackAPI/updateNetworkACLItem.py | 99 + .../cloudstackAPI/updateNetworkOffering.py | 140 + .../updateNetworkServiceProvider.py | 50 + .../cloudstackAPI/updatePhysicalNetwork.py | 60 + .../lib/marvin/cloudstackAPI/updatePod.py | 87 + .../cloudstackAPI/updatePortForwardingRule.py | 98 + .../lib/marvin/cloudstackAPI/updateProject.py | 145 + .../cloudstackAPI/updateProjectInvitation.py | 42 + .../lib/marvin/cloudstackAPI/updateRegion.py | 46 + .../cloudstackAPI/updateResourceCount.py | 52 + .../cloudstackAPI/updateResourceLimit.py | 54 + .../cloudstackAPI/updateServiceOffering.py | 113 + .../updateStorageNetworkIpRange.py | 58 + .../marvin/cloudstackAPI/updateStoragePool.py | 84 + .../marvin/cloudstackAPI/updateTemplate.py | 149 + .../updateTemplatePermissions.py | 48 + .../marvin/cloudstackAPI/updateTrafficType.py | 50 + .../lib/marvin/cloudstackAPI/updateUser.py | 82 + .../cloudstackAPI/updateVMAffinityGroup.py | 373 ++ .../lib/marvin/cloudstackAPI/updateVPC.py | 398 ++ .../marvin/cloudstackAPI/updateVPCOffering.py | 107 + .../cloudstackAPI/updateVirtualMachine.py | 383 ++ .../lib/marvin/cloudstackAPI/updateVolume.py | 150 + .../cloudstackAPI/updateVpnCustomerGateway.py | 93 + .../lib/marvin/cloudstackAPI/updateZone.py | 154 + .../cloudstackAPI/uploadCustomCertificate.py | 43 + .../lib/marvin/cloudstackAPI/uploadVolume.py | 162 + .../build/lib/marvin/cloudstackConnection.py | 235 ++ .../build/lib/marvin/cloudstackException.py | 48 + .../build/lib/marvin/cloudstackTestCase.py | 40 + .../build/lib/marvin/cloudstackTestClient.py | 201 + .../marvin/build/lib/marvin/codegenerator.py | 463 +++ .../build/lib/marvin/configGenerator.py | 870 ++++ tools/marvin/build/lib/marvin/dbConnection.py | 86 + tools/marvin/build/lib/marvin/deployAndRun.py | 96 + .../build/lib/marvin/deployDataCenter.py | 625 +++ .../build/lib/marvin/integration/__init__.py | 18 + .../lib/marvin/integration/lib/__init__.py | 16 + .../build/lib/marvin/integration/lib/base.py | 3593 +++++++++++++++++ .../lib/marvin/integration/lib/common.py | 739 ++++ .../build/lib/marvin/integration/lib/utils.py | 320 ++ tools/marvin/build/lib/marvin/jsonHelper.py | 381 ++ tools/marvin/build/lib/marvin/marvinPlugin.py | 144 + .../build/lib/marvin/remoteSSHClient.py | 108 + .../build/lib/marvin/sandbox/__init__.py | 18 + .../lib/marvin/sandbox/advanced/__init__.py | 18 + .../marvin/sandbox/advanced/advanced_env.py | 167 + .../lib/marvin/sandbox/advancedsg/__init__.py | 18 + .../sandbox/advancedsg/advancedsg_env.py | 151 + .../lib/marvin/sandbox/basic/__init__.py | 18 + .../lib/marvin/sandbox/basic/basic_env.py | 149 + .../lib/marvin/sandbox/testSetupSuccess.py | 81 + tools/marvin/build/lib/marvin/settings.py | 28 + .../build/lib/marvin/testSetupSuccess.py | 98 + tools/marvin/marvin/integration/lib/utils.py | 6 +- .../marvin/integration/lib/utils.py.rej | 10 + .../{remoteSSHClient.py => sshClient.py} | 10 +- 498 files changed, 51432 insertions(+), 114 deletions(-) create mode 100644 test/integration/component/test_vpc_vm_life_cycle.py.rej create mode 100644 tools/marvin/build/lib/marvin/TestCaseExecuteEngine.py create mode 100644 tools/marvin/build/lib/marvin/__init__.py create mode 100644 tools/marvin/build/lib/marvin/asyncJobMgr.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/__init__.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/activateProject.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addAccountToProject.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalDhcp.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalHost.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxeKickStartServer.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxePingServer.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBigSwitchVnsDevice.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addCluster.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addHost.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addImageStore.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addIpToNic.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addLdapConfiguration.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkDevice.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkServiceProvider.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addNicToVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addNiciraNvpDevice.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addRegion.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addResourceDetail.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addS3.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addSecondaryStorage.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addSwift.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficMonitor.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficType.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addUcsManager.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addVpnUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/archiveAlerts.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/archiveEvents.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/assignToGlobalLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/assignToLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/assignVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/associateIpAddress.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/associateUcsProfileToBlade.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/attachIso.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/attachVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupEgress.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupIngress.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/baseCmd.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/baseResponse.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/cancelHostMaintenance.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/cancelStorageMaintenance.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForRouter.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForSystemVm.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/cleanVMReservations.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/cloudstackAPIClient.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/configureInternalLoadBalancerElement.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/configureVirtualRouterElement.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/copyIso.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/copyTemplate.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAccount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAffinityGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScalePolicy.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmProfile.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createCondition.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createCounter.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createDiskOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createDomain.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createEgressFirewallRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createFirewallRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createGlobalLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createInstanceGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createInternalLoadBalancerElement.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createIpForwardingRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createLBHealthCheckPolicy.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createLBStickinessPolicy.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancer.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createNetwork.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACL.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACLList.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPhysicalNetwork.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPod.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPortForwardingRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPortableIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPrivateGateway.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createProject.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createRemoteAccessVpn.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSSHKeyPair.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSecondaryStagingStore.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSecurityGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createServiceOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshot.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshotPolicy.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createStaticRoute.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createStorageNetworkIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createStoragePool.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createTags.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createTemplate.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVMSnapshot.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVPC.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVPCOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVirtualRouterElement.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVlanIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVpnConnection.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVpnCustomerGateway.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVpnGateway.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createZone.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicateCluster.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicateGuestVlanRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicateHost.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePod.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePublicIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicateZone.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccountFromProject.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAffinityGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAlerts.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScalePolicy.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmProfile.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteBigSwitchVnsDevice.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteCluster.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteCondition.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteCounter.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteDiskOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteDomain.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteEgressFirewallRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteEvents.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteFirewallRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteHost.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteImageStore.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteInstanceGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteIpForwardingRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteIso.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBHealthCheckPolicy.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBStickinessPolicy.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLdapConfiguration.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancer.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetwork.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACL.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACLList.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkDevice.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkServiceProvider.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNiciraNvpDevice.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePhysicalNetwork.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePod.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePortForwardingRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePortableIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePrivateGateway.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteProject.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteProjectInvitation.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteRemoteAccessVpn.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSSHKeyPair.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecondaryStagingStore.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecurityGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteServiceOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshot.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshotPolicies.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteStaticRoute.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteStorageNetworkIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteStoragePool.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteTags.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteTemplate.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficMonitor.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficType.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVMSnapshot.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPC.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPCOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVlanIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnConnection.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnCustomerGateway.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnGateway.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteZone.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deployVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/destroyRouter.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/destroySystemVm.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/destroyVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/detachIso.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/detachVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disableAccount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disableAutoScaleVmGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disableStaticNat.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disableUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disassociateIpAddress.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableAccount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableAutoScaleVmGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableStaticNat.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableStorageMaintenance.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/extractIso.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/extractTemplate.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/extractVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/findHostsForMigration.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/findStoragePoolsForMigration.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/generateUsageRecords.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/getApiLimit.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/getCloudIdentifier.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/getUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/getVMPassword.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/ldapCreateAccount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAccounts.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroupTypes.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroups.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAlerts.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listApis.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAsyncJobs.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScalePolicies.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmGroups.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmProfiles.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalDhcp.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalPxeServers.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listBigSwitchVnsDevices.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listCapabilities.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listCapacity.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listClusters.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listConditions.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listConfigurations.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listCounters.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedClusters.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedGuestVlanRanges.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedHosts.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedPods.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedZones.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDeploymentPlanners.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDiskOfferings.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDomainChildren.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDomains.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listEgressFirewallRules.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listEventTypes.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listEvents.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listFirewallRules.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listGlobalLoadBalancerRules.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listHosts.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisorCapabilities.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisors.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listImageStores.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listInstanceGroups.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerElements.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerVMs.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listIpForwardingRules.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listIsoPermissions.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listIsos.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLBHealthCheckPolicies.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLBStickinessPolicies.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLdapConfigurations.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLdapUsers.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRuleInstances.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRules.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancers.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLLists.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLs.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkDevice.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkIsolationMethods.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkOfferings.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkServiceProviders.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworks.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDeviceNetworks.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDevices.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNics.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listOsCategories.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listOsTypes.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPhysicalNetworks.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPods.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPortForwardingRules.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPortableIpRanges.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPrivateGateways.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listProjectAccounts.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listProjectInvitations.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listProjects.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPublicIpAddresses.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listRegions.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listRemoteAccessVpns.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listResourceDetails.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listResourceLimits.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listRouters.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listS3s.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSSHKeyPairs.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSecondaryStagingStores.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSecurityGroups.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listServiceOfferings.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshotPolicies.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshots.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listStaticRoutes.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listStorageNetworkIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listStoragePools.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listStorageProviders.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSupportedNetworkServices.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSwifts.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSystemVms.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTags.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTemplatePermissions.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTemplates.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficMonitors.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypeImplementors.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypes.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUcsBlades.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUcsManagers.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUcsProfiles.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUsageRecords.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUsageTypes.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUsers.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVMSnapshot.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVPCOfferings.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVPCs.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualMachines.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualRouterElements.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVlanIpRanges.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVolumes.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVpnConnections.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVpnCustomerGateways.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVpnGateways.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVpnUsers.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listZones.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/lockAccount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/lockUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/login.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/logout.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/markDefaultZoneForAccount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/migrateSystemVm.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachineWithVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/migrateVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/prepareHostForMaintenance.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/prepareTemplate.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/queryAsyncJobResult.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/rebootRouter.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/rebootSystemVm.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/rebootVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/reconnectHost.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/recoverVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/registerIso.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/registerSSHKeyPair.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/registerTemplate.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/registerUserKeys.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedCluster.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedGuestVlanRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedHost.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedPod.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedZone.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseHostReservation.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releasePublicIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeFromGlobalLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeFromLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeIpFromNic.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeNicFromVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeRegion.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeResourceDetail.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeVpnUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/replaceNetworkACLList.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resetApiLimit.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resetPasswordForVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resetSSHKeyForVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resetVpnConnection.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resizeVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/restartNetwork.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/restartVPC.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/restoreVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/revertSnapshot.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/revertToVMSnapshot.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupEgress.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupIngress.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/scaleSystemVm.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/scaleVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/startInternalLoadBalancerVM.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/startRouter.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/startSystemVm.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/startVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/stopInternalLoadBalancerVM.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/stopRouter.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/stopSystemVm.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/stopVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/suspendProject.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateAccount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScalePolicy.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmProfile.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateCluster.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateConfiguration.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateDefaultNicForVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateDiskOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateDomain.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateGlobalLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateHost.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateHostPassword.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateHypervisorCapabilities.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateInstanceGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateIso.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateIsoPermissions.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateLoadBalancerRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateNetwork.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkACLItem.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkServiceProvider.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updatePhysicalNetwork.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updatePod.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updatePortForwardingRule.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateProject.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateProjectInvitation.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateRegion.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceCount.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceLimit.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateServiceOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateStorageNetworkIpRange.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateStoragePool.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplate.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplatePermissions.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateTrafficType.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateUser.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVMAffinityGroup.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVPC.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVPCOffering.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVirtualMachine.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVpnCustomerGateway.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateZone.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/uploadCustomCertificate.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/uploadVolume.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackConnection.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackException.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackTestCase.py create mode 100644 tools/marvin/build/lib/marvin/cloudstackTestClient.py create mode 100644 tools/marvin/build/lib/marvin/codegenerator.py create mode 100644 tools/marvin/build/lib/marvin/configGenerator.py create mode 100644 tools/marvin/build/lib/marvin/dbConnection.py create mode 100644 tools/marvin/build/lib/marvin/deployAndRun.py create mode 100644 tools/marvin/build/lib/marvin/deployDataCenter.py create mode 100644 tools/marvin/build/lib/marvin/integration/__init__.py create mode 100644 tools/marvin/build/lib/marvin/integration/lib/__init__.py create mode 100644 tools/marvin/build/lib/marvin/integration/lib/base.py create mode 100644 tools/marvin/build/lib/marvin/integration/lib/common.py create mode 100644 tools/marvin/build/lib/marvin/integration/lib/utils.py create mode 100644 tools/marvin/build/lib/marvin/jsonHelper.py create mode 100644 tools/marvin/build/lib/marvin/marvinPlugin.py create mode 100644 tools/marvin/build/lib/marvin/remoteSSHClient.py create mode 100644 tools/marvin/build/lib/marvin/sandbox/__init__.py create mode 100644 tools/marvin/build/lib/marvin/sandbox/advanced/__init__.py create mode 100644 tools/marvin/build/lib/marvin/sandbox/advanced/advanced_env.py create mode 100644 tools/marvin/build/lib/marvin/sandbox/advancedsg/__init__.py create mode 100644 tools/marvin/build/lib/marvin/sandbox/advancedsg/advancedsg_env.py create mode 100644 tools/marvin/build/lib/marvin/sandbox/basic/__init__.py create mode 100644 tools/marvin/build/lib/marvin/sandbox/basic/basic_env.py create mode 100644 tools/marvin/build/lib/marvin/sandbox/testSetupSuccess.py create mode 100644 tools/marvin/build/lib/marvin/settings.py create mode 100644 tools/marvin/build/lib/marvin/testSetupSuccess.py create mode 100644 tools/marvin/marvin/integration/lib/utils.py.rej rename tools/marvin/marvin/{remoteSSHClient.py => sshClient.py} (96%) diff --git a/test/integration/component/maint/test_egress_rules_host_maintenance.py b/test/integration/component/maint/test_egress_rules_host_maintenance.py index 6f0f768d37c..2b817879c4b 100644 --- a/test/integration/component/maint/test_egress_rules_host_maintenance.py +++ b/test/integration/component/maint/test_egress_rules_host_maintenance.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/maint/test_high_availability.py b/test/integration/component/maint/test_high_availability.py index 7b0f78e2446..6ada659cd4f 100644 --- a/test/integration/component/maint/test_high_availability.py +++ b/test/integration/component/maint/test_high_availability.py @@ -26,7 +26,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/maint/test_vpc_host_maintenance.py b/test/integration/component/maint/test_vpc_host_maintenance.py index 0946cebdb7e..57dfb4be8d0 100644 --- a/test/integration/component/maint/test_vpc_host_maintenance.py +++ b/test/integration/component/maint/test_vpc_host_maintenance.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index 4c73c3acc84..650a595936e 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -22,7 +22,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from nose.plugins.attrib import attr from marvin.cloudstackException import cloudstackAPIException diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py index ae53e399df9..7e4fabe5475 100644 --- a/test/integration/component/test_affinity_groups.py +++ b/test/integration/component/test_affinity_groups.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from nose.plugins.attrib import attr class Services: diff --git a/test/integration/component/test_asa1000v_fw.py b/test/integration/component/test_asa1000v_fw.py index 0d8cad09802..c8a11ab1701 100644 --- a/test/integration/component/test_asa1000v_fw.py +++ b/test/integration/component/test_asa1000v_fw.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_baremetal.py b/test/integration/component/test_baremetal.py index c6a877eca6e..2439d0d2132 100644 --- a/test/integration/component/test_baremetal.py +++ b/test/integration/component/test_baremetal.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_deploy_vm_userdata_reg.py b/test/integration/component/test_deploy_vm_userdata_reg.py index ca9179d77d2..b282a860816 100755 --- a/test/integration/component/test_deploy_vm_userdata_reg.py +++ b/test/integration/component/test_deploy_vm_userdata_reg.py @@ -23,7 +23,7 @@ from marvin.integration.lib.base import * from marvin.integration.lib.utils import * from marvin.integration.lib.common import * from nose.plugins.attrib import attr -from marvin import remoteSSHClient +from marvin.sshClient import SshClient import unittest import random import string diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py index 253cc46cab9..0aed95742ec 100644 --- a/test/integration/component/test_egress_fw_rules.py +++ b/test/integration/component/test_egress_fw_rules.py @@ -39,7 +39,7 @@ from marvin.integration.lib.common import (get_domain, from marvin.cloudstackAPI.createEgressFirewallRule import createEgressFirewallRuleCmd from marvin.cloudstackAPI.deleteEgressFirewallRule import deleteEgressFirewallRuleCmd -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import time class Services: @@ -270,7 +270,7 @@ class TestEgressFWRules(cloudstackTestCase): fd.write(expect_script) fd.close() - ssh = remoteSSHClient(host=sourceip, + ssh = SshClient(host=sourceip, port=22, user='root', passwd=self.services["host_password"]) diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py index f8e8e790248..34995ffd1a0 100644 --- a/test/integration/component/test_egress_rules.py +++ b/test/integration/component/test_egress_rules.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_eip_elb.py b/test/integration/component/test_eip_elb.py index 42a5148762e..d639d82d9f5 100644 --- a/test/integration/component/test_eip_elb.py +++ b/test/integration/component/test_eip_elb.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -314,7 +314,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -458,7 +458,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -657,7 +657,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -871,7 +871,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1138,7 +1138,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1287,7 +1287,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1366,7 +1366,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1512,7 +1512,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], diff --git a/test/integration/component/test_explicit_dedication.py b/test/integration/component/test_explicit_dedication.py index bd97551b5c6..7aefc21a1fb 100644 --- a/test/integration/component/test_explicit_dedication.py +++ b/test/integration/component/test_explicit_dedication.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_haproxy.py b/test/integration/component/test_haproxy.py index 799cfa3e925..c7340126b36 100644 --- a/test/integration/component/test_haproxy.py +++ b/test/integration/component/test_haproxy.py @@ -38,7 +38,7 @@ from marvin.integration.lib.common import (get_domain, random_gen ) from marvin.cloudstackAPI import createLBStickinessPolicy -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient class Services: @@ -383,7 +383,7 @@ class TestHAProxyStickyness(cloudstackTestCase): # If Round Robin Algorithm is chosen, # each ssh command should alternate between VMs - ssh_1 = remoteSSHClient( + ssh_1 = SshClient( ip_addr, 22, self.services["natrule"]["username"], diff --git a/test/integration/component/test_implicit_planner.py b/test/integration/component/test_implicit_planner.py index f233ba9791e..2b656d9f2c6 100644 --- a/test/integration/component/test_implicit_planner.py +++ b/test/integration/component/test_implicit_planner.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_netscaler_configs.py b/test/integration/component/test_netscaler_configs.py index c10f6882334..98c47485e34 100644 --- a/test/integration/component/test_netscaler_configs.py +++ b/test/integration/component/test_netscaler_configs.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -1745,7 +1745,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1891,7 +1891,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2051,7 +2051,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2249,7 +2249,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2334,7 +2334,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2396,7 +2396,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2458,7 +2458,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb.py b/test/integration/component/test_netscaler_lb.py index 4b380e904e1..5a8d6a4f6b5 100644 --- a/test/integration/component/test_netscaler_lb.py +++ b/test/integration/component/test_netscaler_lb.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -1228,7 +1228,7 @@ class TestAddMultipleVmsLb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -2104,7 +2104,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2430,7 +2430,7 @@ class TestVmWithLb(cloudstackTestCase): ) self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2523,7 +2523,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2596,7 +2596,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2709,7 +2709,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2797,7 +2797,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2880,7 +2880,7 @@ class TestVmWithLb(cloudstackTestCase): time.sleep(int(delay[0].value) + int(wait[0].value)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2936,7 +2936,7 @@ class TestVmWithLb(cloudstackTestCase): ) self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb_algo.py b/test/integration/component/test_netscaler_lb_algo.py index 4df7b897a5b..a5e1fe80b7b 100644 --- a/test/integration/component/test_netscaler_lb_algo.py +++ b/test/integration/component/test_netscaler_lb_algo.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -300,7 +300,7 @@ class TestLbWithRoundRobin(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -524,7 +524,7 @@ class TestLbWithLeastConn(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -739,7 +739,7 @@ class TestLbWithSourceIp(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -912,7 +912,7 @@ class TestLbAlgoRrLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -945,7 +945,7 @@ class TestLbAlgoRrLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1115,7 +1115,7 @@ class TestLbAlgoLcRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1147,7 +1147,7 @@ class TestLbAlgoLcRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1318,7 +1318,7 @@ class TestLbAlgoRrSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1351,7 +1351,7 @@ class TestLbAlgoRrSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1526,7 +1526,7 @@ class TestLbAlgoSbRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1560,7 +1560,7 @@ class TestLbAlgoSbRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1734,7 +1734,7 @@ class TestLbAlgoSbLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1767,7 +1767,7 @@ class TestLbAlgoSbLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1939,7 +1939,7 @@ class TestLbAlgoLcSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1972,7 +1972,7 @@ class TestLbAlgoLcSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb_sticky.py b/test/integration/component/test_netscaler_lb_sticky.py index 56964a9fd9e..6c27a08052a 100644 --- a/test/integration/component/test_netscaler_lb_sticky.py +++ b/test/integration/component/test_netscaler_lb_sticky.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -267,7 +267,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -356,7 +356,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -445,7 +445,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -536,7 +536,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -627,7 +627,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -718,7 +718,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -809,7 +809,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -900,7 +900,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -991,7 +991,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_nw_off.py b/test/integration/component/test_netscaler_nw_off.py index b94d47ea164..3372612abab 100644 --- a/test/integration/component/test_netscaler_nw_off.py +++ b/test/integration/component/test_netscaler_nw_off.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 335f8592ff0..04777b0c2a8 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index 917e7f2d1a9..a532b362751 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -23,7 +23,7 @@ from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * from netaddr import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from nose.plugins.attrib import attr @@ -808,7 +808,7 @@ class TestAssociatePublicIp(cloudstackTestCase): self.debug("Trying to SSH to ip: %s" % portableip.ipaddress.ipaddress) - remoteSSHClient( + SshClient( portableip.ipaddress.ipaddress, self.services['natrule']["publicport"], self.virtual_machine.username, @@ -1533,7 +1533,7 @@ class TestPortableIpTransferAcrossNetworks(cloudstackTestCase): self.debug("Trying to SSH to ip: %s" % portableip.ipaddress.ipaddress) - remoteSSHClient( + SshClient( portableip.ipaddress.ipaddress, self.services['natrule']["publicport"], self.virtual_machine2.username, diff --git a/test/integration/component/test_project_configs.py b/test/integration/component/test_project_configs.py index a9654c82f57..be6cf1ce279 100644 --- a/test/integration/component/test_project_configs.py +++ b/test/integration/component/test_project_configs.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index 131a9e21050..9b9b2e6ac2e 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index e836768591b..ba0a63c97e8 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index e4c2180dd42..4b82fc2639c 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index 5ec3ffb00d5..c90ccf6ee28 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient #Import System modules import time @@ -361,7 +361,7 @@ class TestDefaultSecurityGroup(cloudstackTestCase): # SSH Attempt to VM should fail with self.assertRaises(Exception): self.debug("SSH into VM: %s" % self.virtual_machine.ssh_ip) - ssh = remoteSSHClient.remoteSSHClient( + ssh = SshClient( self.virtual_machine.ssh_ip, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -656,7 +656,7 @@ class TestRevokeIngressRule(cloudstackTestCase): # SSH Attempt to VM should fail with self.assertRaises(Exception): self.debug("SSH into VM: %s" % self.virtual_machine.id) - remoteSSHClient.remoteSSHClient( + SshClient( self.virtual_machine.ssh_ip, self.virtual_machine.ssh_port, self.virtual_machine.username, diff --git a/test/integration/component/test_snapshot_limits.py b/test/integration/component/test_snapshot_limits.py index 2af77c3923d..e52a893587c 100644 --- a/test/integration/component/test_snapshot_limits.py +++ b/test/integration/component/test_snapshot_limits.py @@ -21,7 +21,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import is_snapshot_on_nfs import os diff --git a/test/integration/component/test_stopped_vm.py b/test/integration/component/test_stopped_vm.py index 3be915166ee..5a5c2981e2f 100644 --- a/test/integration/component/test_stopped_vm.py +++ b/test/integration/component/test_stopped_vm.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_storage_motion.py b/test/integration/component/test_storage_motion.py index 36376f373bc..bae5acf5514 100644 --- a/test/integration/component/test_storage_motion.py +++ b/test/integration/component/test_storage_motion.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_templates.py b/test/integration/component/test_templates.py index ea4b27755ca..af86d32a3bd 100644 --- a/test/integration/component/test_templates.py +++ b/test/integration/component/test_templates.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import urllib from random import random #Import System modules diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 75326f70a75..5979a0a495c 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_vm_passwdenabled.py b/test/integration/component/test_vm_passwdenabled.py index a6b45acc9d9..5cfa52556f7 100644 --- a/test/integration/component/test_vm_passwdenabled.py +++ b/test/integration/component/test_vm_passwdenabled.py @@ -17,7 +17,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_vpc_network.py b/test/integration/component/test_vpc_network.py index b9b4f0049f6..9f5e6f623f0 100644 --- a/test/integration/component/test_vpc_network.py +++ b/test/integration/component/test_vpc_network.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime # For more info on ddt refer to http://ddt.readthedocs.org/en/latest/api.html#module-ddt from ddt import ddt, data diff --git a/test/integration/component/test_vpc_offerings.py b/test/integration/component/test_vpc_offerings.py index 109c8d13687..4f5802285f2 100644 --- a/test/integration/component/test_vpc_offerings.py +++ b/test/integration/component/test_vpc_offerings.py @@ -26,7 +26,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_vpc_routers.py b/test/integration/component/test_vpc_routers.py index 9b772e41c67..8ed99ca3c36 100644 --- a/test/integration/component/test_vpc_routers.py +++ b/test/integration/component/test_vpc_routers.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_vpc_vm_life_cycle.py b/test/integration/component/test_vpc_vm_life_cycle.py index 5893cc35bc5..cc65eedff8a 100644 --- a/test/integration/component/test_vpc_vm_life_cycle.py +++ b/test/integration/component/test_vpc_vm_life_cycle.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.codes import PASS import time diff --git a/test/integration/component/test_vpc_vm_life_cycle.py.rej b/test/integration/component/test_vpc_vm_life_cycle.py.rej new file mode 100644 index 00000000000..98d859d3418 --- /dev/null +++ b/test/integration/component/test_vpc_vm_life_cycle.py.rej @@ -0,0 +1,10 @@ +diff a/test/integration/component/test_vpc_vm_life_cycle.py b/test/integration/component/test_vpc_vm_life_cycle.py (rejected hunks) +@@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * + from marvin.integration.lib.utils import * + from marvin.integration.lib.base import * + from marvin.integration.lib.common import * +-from marvin.remoteSSHClient import remoteSSHClient ++from marvin.sshClient import SshClient + + import time + diff --git a/test/integration/component/test_vpc_vms_deployment.py b/test/integration/component/test_vpc_vms_deployment.py index b01137b1ccd..ebf3b317d2b 100644 --- a/test/integration/component/test_vpc_vms_deployment.py +++ b/test/integration/component/test_vpc_vms_deployment.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py index db11adabe16..c96a580f199 100644 --- a/test/integration/smoke/test_affinity_groups.py +++ b/test/integration/smoke/test_affinity_groups.py @@ -21,7 +21,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from nose.plugins.attrib import attr class Services: diff --git a/test/integration/smoke/test_loadbalance.py b/test/integration/smoke/test_loadbalance.py index 3e48158442a..5f80c38303a 100644 --- a/test/integration/smoke/test_loadbalance.py +++ b/test/integration/smoke/test_loadbalance.py @@ -17,7 +17,7 @@ from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * @@ -197,7 +197,7 @@ class TestLoadBalance(cloudstackTestCase): # If Round Robin Algorithm is chosen, # each ssh command should alternate between VMs - ssh_1 = remoteSSHClient( + ssh_1 = SshClient( ip_addr, self.services['lbrule']["publicport"], self.vm_1.username, diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index f2045959697..09d6437cd86 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -21,7 +21,7 @@ import marvin from marvin.cloudstackException import cloudstackAPIException from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * @@ -460,7 +460,7 @@ class TestPortForwarding(cloudstackTestCase): "SSHing into VM with IP address %s after NAT rule deletion" % self.virtual_machine.ipaddress) - remoteSSHClient( + SshClient( src_nat_ip_addr.ipaddress, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -578,7 +578,7 @@ class TestPortForwarding(cloudstackTestCase): "SSHing into VM with IP address %s after NAT rule deletion" % self.virtual_machine.ipaddress) - remoteSSHClient( + SshClient( ip_address.ipaddress.ipaddress, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -741,7 +741,7 @@ class TestRebootRouter(cloudstackTestCase): try: self.debug("SSH into VM (ID : %s ) after reboot" % self.vm_1.id) - remoteSSHClient( + SshClient( self.public_ip.ipaddress.ipaddress, self.services["natrule"]["publicport"], self.vm_1.username, @@ -883,7 +883,7 @@ class TestReleaseIP(cloudstackTestCase): # SSH Attempt though public IP should fail with self.assertRaises(Exception): - ssh_2 = remoteSSHClient( + ssh_2 = SshClient( self.ip_addr.ipaddress, self.services["natrule"]["publicport"], self.virtual_machine.username, diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py index 583fc29c2c1..ac95685f37a 100644 --- a/test/integration/smoke/test_nic.py +++ b/test/integration/smoke/test_nic.py @@ -18,7 +18,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py index 0a427ba229d..aeb47f953c4 100644 --- a/test/integration/smoke/test_pvlan.py +++ b/test/integration/smoke/test_pvlan.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_resource_detail.py b/test/integration/smoke/test_resource_detail.py index 93bc2ffc1f1..00a7b5c4171 100644 --- a/test/integration/smoke/test_resource_detail.py +++ b/test/integration/smoke/test_resource_detail.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index 0f32e274338..7d324136e89 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index 9fa59a94d3f..a2b9eabc13c 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index 9478440f77e..e371ad436a8 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index b60b70e86ed..816ae03f267 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -21,7 +21,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackException import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/tools/marvin/build/lib/marvin/TestCaseExecuteEngine.py b/tools/marvin/build/lib/marvin/TestCaseExecuteEngine.py new file mode 100644 index 00000000000..f5af1fe2c1e --- /dev/null +++ b/tools/marvin/build/lib/marvin/TestCaseExecuteEngine.py @@ -0,0 +1,102 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 os +import sys +import logging +from functools import partial + + +def testCaseLogger(message, logger=None): + if logger is not None: + logger.debug(message) + + +class TestCaseExecuteEngine(object): + def __init__(self, testclient, config, testcaseLogFile=None, + testResultLogFile=None): + """ + Initialize the testcase execution engine, just the basics here + @var testcaseLogFile: client log file + @var testResultLogFile: summary report file + """ + self.testclient = testclient + self.config = config + self.logformat =\ + logging.Formatter( + "%(asctime)s - %(levelname)s - %(name)s - %(message)s") + self.loader = unittest.loader.TestLoader() + self.suite = None + + if testcaseLogFile is not None: + self.logfile = testcaseLogFile + self.logger = logging.getLogger("TestCaseExecuteEngine") + fh = logging.FileHandler(self.logfile) + fh.setFormatter(self.logformat) + self.logger.addHandler(fh) + self.logger.setLevel(logging.DEBUG) + if testResultLogFile is not None: + ch = logging.StreamHandler() + ch.setLevel(logging.ERROR) + ch.setFormatter(self.logformat) + self.logger.addHandler(ch) + fp = open(testResultLogFile, "w") + self.testResultLogFile = fp + else: + self.testResultLogFile = sys.stdout + + def loadTestsFromDir(self, testDirectory): + """ Load the test suites from a package with multiple test files """ + self.suite = self.loader.discover(testDirectory) + self.injectTestCase(self.suite) + + def loadTestsFromFile(self, file_name): + """ Load the tests from a single script/module """ + if os.path.isfile(file_name): + self.suite = self.loader.discover(os.path.dirname(file_name), + os.path.basename(file_name)) + self.injectTestCase(self.suite) + + def injectTestCase(self, testSuites): + for test in testSuites: + if isinstance(test, unittest.BaseTestSuite): + self.injectTestCase(test) + else: + #logger bears the name of the test class + testcaselogger = logging.getLogger("%s" % (test)) + fh = logging.FileHandler(self.logfile) + fh.setFormatter(self.logformat) + testcaselogger.addHandler(fh) + testcaselogger.setLevel(logging.DEBUG) + + #inject testclient and logger into each unittest + setattr(test, "testClient", self.testclient) + setattr(test, "config", self.config) + setattr(test, "debug", partial(testCaseLogger, + logger=testcaselogger)) + setattr(test.__class__, "clstestclient", self.testclient) + if hasattr(test, "user"): + # attribute when test is entirely executed as user + self.testclient.createUserApiClient(test.UserName, + test.DomainName, + test.AcctType) + + def run(self): + if self.suite: + unittest.TextTestRunner(stream=self.testResultLogFile, + verbosity=2).run(self.suite) diff --git a/tools/marvin/build/lib/marvin/__init__.py b/tools/marvin/build/lib/marvin/__init__.py new file mode 100644 index 00000000000..7af168e20bc --- /dev/null +++ b/tools/marvin/build/lib/marvin/__init__.py @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Marvin - The cloudstack test client diff --git a/tools/marvin/build/lib/marvin/asyncJobMgr.py b/tools/marvin/build/lib/marvin/asyncJobMgr.py new file mode 100644 index 00000000000..25818a62de5 --- /dev/null +++ b/tools/marvin/build/lib/marvin/asyncJobMgr.py @@ -0,0 +1,261 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 threading +import cloudstackException +import time +import Queue +import copy +import sys +import jsonHelper +import datetime + + +class job(object): + def __init__(self): + self.id = None + self.cmd = None + + +class jobStatus(object): + def __init__(self): + self.result = None + self.status = None + self.startTime = None + self.endTime = None + self.duration = None + self.jobId = None + self.responsecls = None + + def __str__(self): + return '{%s}' % str(', '.join('%s : %s' % (k, repr(v)) for (k, v) + in self.__dict__.iteritems())) + + +class workThread(threading.Thread): + def __init__(self, in_queue, outqueue, apiClient, db=None, lock=None): + threading.Thread.__init__(self) + self.inqueue = in_queue + self.output = outqueue + self.connection = apiClient.connection.__copy__() + self.db = None + self.lock = lock + + def queryAsynJob(self, job): + if job.jobId is None: + return job + + try: + self.lock.acquire() + result = self.connection.poll(job.jobId, job.responsecls).jobresult + except cloudstackException.cloudstackAPIException, e: + result = str(e) + finally: + self.lock.release() + + job.result = result + return job + + def executeCmd(self, job): + cmd = job.cmd + + jobstatus = jobStatus() + jobId = None + try: + self.lock.acquire() + + if cmd.isAsync == "false": + jobstatus.startTime = datetime.datetime.now() + + result = self.connection.make_request(cmd) + jobstatus.result = result + jobstatus.endTime = datetime.datetime.now() + jobstatus.duration =\ + time.mktime(jobstatus.endTime.timetuple()) - time.mktime( + jobstatus.startTime.timetuple()) + else: + result = self.connection.make_request(cmd, None, True) + if result is None: + jobstatus.status = False + else: + jobId = result.jobid + jobstatus.jobId = jobId + try: + responseName =\ + cmd.__class__.__name__.replace("Cmd", "Response") + jobstatus.responsecls =\ + jsonHelper.getclassFromName(cmd, responseName) + except: + pass + jobstatus.status = True + except cloudstackException.cloudstackAPIException, e: + jobstatus.result = str(e) + jobstatus.status = False + except: + jobstatus.status = False + jobstatus.result = sys.exc_info() + finally: + self.lock.release() + + return jobstatus + + def run(self): + while self.inqueue.qsize() > 0: + job = self.inqueue.get() + if isinstance(job, jobStatus): + jobstatus = self.queryAsynJob(job) + else: + jobstatus = self.executeCmd(job) + + self.output.put(jobstatus) + self.inqueue.task_done() + + '''release the resource''' + self.connection.close() + + +class jobThread(threading.Thread): + def __init__(self, inqueue, interval): + threading.Thread.__init__(self) + self.inqueue = inqueue + self.interval = interval + + def run(self): + while self.inqueue.qsize() > 0: + job = self.inqueue.get() + try: + job.run() + '''release the api connection''' + job.apiClient.connection.close() + except: + pass + + self.inqueue.task_done() + time.sleep(self.interval) + + +class outputDict(object): + def __init__(self): + self.lock = threading.Condition() + self.dict = {} + + +class asyncJobMgr(object): + def __init__(self, apiClient, db): + self.inqueue = Queue.Queue() + self.output = outputDict() + self.outqueue = Queue.Queue() + self.apiClient = apiClient + self.db = db + + def submitCmds(self, cmds): + if not self.inqueue.empty(): + return False + id = 0 + ids = [] + for cmd in cmds: + asyncjob = job() + asyncjob.id = id + asyncjob.cmd = cmd + self.inqueue.put(asyncjob) + id += 1 + ids.append(id) + return ids + + def updateTimeStamp(self, jobstatus): + jobId = jobstatus.jobId + if jobId is not None and self.db is not None: + result = self.db.execute( + "select job_status, created, last_updated from async_job where\ + id='%s'" % str(jobId)) + if result is not None and len(result) > 0: + if result[0][0] == 1: + jobstatus.status = True + else: + jobstatus.status = False + jobstatus.startTime = result[0][1] + jobstatus.endTime = result[0][2] + delta = jobstatus.endTime - jobstatus.startTime + jobstatus.duration = delta.total_seconds() + + def waitForComplete(self, workers=10): + self.inqueue.join() + lock = threading.Lock() + resultQueue = Queue.Queue() + '''intermediate result is stored in self.outqueue''' + for i in range(workers): + worker = workThread(self.outqueue, resultQueue, self.apiClient, + self.db, lock) + worker.start() + + self.outqueue.join() + + asyncJobResult = [] + while resultQueue.qsize() > 0: + jobstatus = resultQueue.get() + self.updateTimeStamp(jobstatus) + asyncJobResult.append(jobstatus) + + return asyncJobResult + + def submitCmdsAndWait(self, cmds, workers=10): + ''' + put commands into a queue at first, then start workers numbers + threads to execute this commands + ''' + self.submitCmds(cmds) + lock = threading.Lock() + for i in range(workers): + worker = workThread(self.inqueue, self.outqueue, self.apiClient, + self.db, lock) + worker.start() + + return self.waitForComplete(workers) + + def submitJobExecuteNtimes(self, job, ntimes=1, nums_threads=1, + interval=1): + ''' + submit one job and execute the same job ntimes, with nums_threads + of threads + ''' + inqueue1 = Queue.Queue() + lock = threading.Condition() + for i in range(ntimes): + newjob = copy.copy(job) + setattr(newjob, "apiClient", copy.copy(self.apiClient)) + setattr(newjob, "lock", lock) + inqueue1.put(newjob) + + for i in range(nums_threads): + work = jobThread(inqueue1, interval) + work.start() + inqueue1.join() + + def submitJobs(self, jobs, nums_threads=1, interval=1): + '''submit n jobs, execute them with nums_threads of threads''' + inqueue1 = Queue.Queue() + lock = threading.Condition() + + for job in jobs: + setattr(job, "apiClient", copy.copy(self.apiClient)) + setattr(job, "lock", lock) + inqueue1.put(job) + + for i in range(nums_threads): + work = jobThread(inqueue1, interval) + work.start() + inqueue1.join() diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/__init__.py b/tools/marvin/build/lib/marvin/cloudstackAPI/__init__.py new file mode 100644 index 00000000000..ad0c1e55f83 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/__init__.py @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +__all__ = ["createAccount","deleteAccount","updateAccount","disableAccount","enableAccount","lockAccount","listAccounts","markDefaultZoneForAccount","createUser","deleteUser","updateUser","listUsers","lockUser","disableUser","enableUser","getUser","createDomain","updateDomain","deleteDomain","listDomains","listDomainChildren","getCloudIdentifier","updateResourceLimit","updateResourceCount","listResourceLimits","deployVirtualMachine","destroyVirtualMachine","rebootVirtualMachine","startVirtualMachine","stopVirtualMachine","resetPasswordForVirtualMachine","resetSSHKeyForVirtualMachine","updateVirtualMachine","listVirtualMachines","getVMPassword","restoreVirtualMachine","changeServiceForVirtualMachine","scaleVirtualMachine","assignVirtualMachine","migrateVirtualMachine","migrateVirtualMachineWithVolume","recoverVirtualMachine","createSnapshot","listSnapshots","deleteSnapshot","createSnapshotPolicy","deleteSnapshotPolicies","listSnapshotPolicies","revertSnapshot","createTemplate","registerTemplate","updateTemplate","copyTemplate","deleteTemplate","listTemplates","updateTemplatePermissions","listTemplatePermissions","extractTemplate","prepareTemplate","attachIso","detachIso","listIsos","registerIso","updateIso","deleteIso","copyIso","updateIsoPermissions","listIsoPermissions","extractIso","listOsTypes","listOsCategories","createServiceOffering","deleteServiceOffering","updateServiceOffering","listServiceOfferings","createDiskOffering","updateDiskOffering","deleteDiskOffering","listDiskOfferings","createVlanIpRange","deleteVlanIpRange","listVlanIpRanges","dedicatePublicIpRange","releasePublicIpRange","dedicateGuestVlanRange","releaseDedicatedGuestVlanRange","listDedicatedGuestVlanRanges","associateIpAddress","disassociateIpAddress","listPublicIpAddresses","listPortForwardingRules","createPortForwardingRule","deletePortForwardingRule","updatePortForwardingRule","enableStaticNat","createIpForwardingRule","deleteIpForwardingRule","listIpForwardingRules","disableStaticNat","createLoadBalancerRule","deleteLoadBalancerRule","removeFromLoadBalancerRule","assignToLoadBalancerRule","createLBStickinessPolicy","deleteLBStickinessPolicy","listLoadBalancerRules","listLBStickinessPolicies","listLBHealthCheckPolicies","createLBHealthCheckPolicy","deleteLBHealthCheckPolicy","listLoadBalancerRuleInstances","updateLoadBalancerRule","createCounter","createCondition","createAutoScalePolicy","createAutoScaleVmProfile","createAutoScaleVmGroup","deleteCounter","deleteCondition","deleteAutoScalePolicy","deleteAutoScaleVmProfile","deleteAutoScaleVmGroup","listCounters","listConditions","listAutoScalePolicies","listAutoScaleVmProfiles","listAutoScaleVmGroups","enableAutoScaleVmGroup","disableAutoScaleVmGroup","updateAutoScalePolicy","updateAutoScaleVmProfile","updateAutoScaleVmGroup","startRouter","rebootRouter","stopRouter","destroyRouter","changeServiceForRouter","listRouters","listVirtualRouterElements","configureVirtualRouterElement","createVirtualRouterElement","startSystemVm","rebootSystemVm","stopSystemVm","destroySystemVm","listSystemVms","migrateSystemVm","changeServiceForSystemVm","scaleSystemVm","updateConfiguration","listConfigurations","listCapabilities","listDeploymentPlanners","cleanVMReservations","createPod","updatePod","deletePod","listPods","createZone","updateZone","deleteZone","listZones","listEvents","listEventTypes","archiveEvents","deleteEvents","listAlerts","archiveAlerts","deleteAlerts","listCapacity","addSwift","listSwifts","addS3","listS3s","addImageStore","listImageStores","deleteImageStore","createSecondaryStagingStore","listSecondaryStagingStores","deleteSecondaryStagingStore","addHost","addCluster","deleteCluster","updateCluster","reconnectHost","updateHost","deleteHost","prepareHostForMaintenance","cancelHostMaintenance","listHosts","findHostsForMigration","addSecondaryStorage","updateHostPassword","releaseHostReservation","attachVolume","uploadVolume","detachVolume","createVolume","deleteVolume","listVolumes","extractVolume","migrateVolume","resizeVolume","updateVolume","registerUserKeys","queryAsyncJobResult","listAsyncJobs","listStoragePools","listStorageProviders","createStoragePool","updateStoragePool","deleteStoragePool","listClusters","enableStorageMaintenance","cancelStorageMaintenance","findStoragePoolsForMigration","createSecurityGroup","deleteSecurityGroup","authorizeSecurityGroupIngress","revokeSecurityGroupIngress","authorizeSecurityGroupEgress","revokeSecurityGroupEgress","listSecurityGroups","createInstanceGroup","deleteInstanceGroup","updateInstanceGroup","listInstanceGroups","uploadCustomCertificate","listHypervisors","createRemoteAccessVpn","deleteRemoteAccessVpn","listRemoteAccessVpns","addVpnUser","removeVpnUser","listVpnUsers","createNetworkOffering","updateNetworkOffering","deleteNetworkOffering","listNetworkOfferings","createNetwork","deleteNetwork","listNetworks","restartNetwork","updateNetwork","addNicToVirtualMachine","removeNicFromVirtualMachine","updateDefaultNicForVirtualMachine","addIpToNic","removeIpFromNic","listNics","registerSSHKeyPair","createSSHKeyPair","deleteSSHKeyPair","listSSHKeyPairs","createProject","deleteProject","updateProject","activateProject","suspendProject","listProjects","addAccountToProject","deleteAccountFromProject","listProjectAccounts","listProjectInvitations","updateProjectInvitation","deleteProjectInvitation","createFirewallRule","deleteFirewallRule","listFirewallRules","createEgressFirewallRule","deleteEgressFirewallRule","listEgressFirewallRules","updateHypervisorCapabilities","listHypervisorCapabilities","createPhysicalNetwork","deletePhysicalNetwork","listPhysicalNetworks","updatePhysicalNetwork","listSupportedNetworkServices","addNetworkServiceProvider","deleteNetworkServiceProvider","listNetworkServiceProviders","updateNetworkServiceProvider","addTrafficType","deleteTrafficType","listTrafficTypes","updateTrafficType","listTrafficTypeImplementors","createStorageNetworkIpRange","deleteStorageNetworkIpRange","listStorageNetworkIpRange","updateStorageNetworkIpRange","addNetworkDevice","listNetworkDevice","deleteNetworkDevice","createVPC","listVPCs","deleteVPC","updateVPC","restartVPC","createVPCOffering","updateVPCOffering","deleteVPCOffering","listVPCOfferings","createPrivateGateway","listPrivateGateways","deletePrivateGateway","createNetworkACL","updateNetworkACLItem","deleteNetworkACL","listNetworkACLs","createNetworkACLList","deleteNetworkACLList","replaceNetworkACLList","listNetworkACLLists","createStaticRoute","deleteStaticRoute","listStaticRoutes","createTags","deleteTags","listTags","addResourceDetail","removeResourceDetail","listResourceDetails","createVpnCustomerGateway","createVpnGateway","createVpnConnection","deleteVpnCustomerGateway","deleteVpnGateway","deleteVpnConnection","updateVpnCustomerGateway","resetVpnConnection","listVpnCustomerGateways","listVpnGateways","listVpnConnections","generateUsageRecords","listUsageRecords","listUsageTypes","addTrafficMonitor","deleteTrafficMonitor","listTrafficMonitors","addNiciraNvpDevice","deleteNiciraNvpDevice","listNiciraNvpDevices","listNiciraNvpDeviceNetworks","addBigSwitchVnsDevice","deleteBigSwitchVnsDevice","listBigSwitchVnsDevices","listApis","getApiLimit","resetApiLimit","addRegion","updateRegion","removeRegion","listRegions","createGlobalLoadBalancerRule","deleteGlobalLoadBalancerRule","updateGlobalLoadBalancerRule","listGlobalLoadBalancerRules","assignToGlobalLoadBalancerRule","removeFromGlobalLoadBalancerRule","listVMSnapshot","createVMSnapshot","deleteVMSnapshot","revertToVMSnapshot","addBaremetalHost","addBaremetalPxeKickStartServer","addBaremetalPxePingServer","addBaremetalDhcp","listBaremetalDhcp","listBaremetalPxeServers","addUcsManager","listUcsManagers","listUcsProfiles","listUcsBlades","associateUcsProfileToBlade","createLoadBalancer","listLoadBalancers","deleteLoadBalancer","configureInternalLoadBalancerElement","createInternalLoadBalancerElement","listInternalLoadBalancerElements","createAffinityGroup","deleteAffinityGroup","listAffinityGroups","updateVMAffinityGroup","listAffinityGroupTypes","createPortableIpRange","deletePortableIpRange","listPortableIpRanges","stopInternalLoadBalancerVM","startInternalLoadBalancerVM","listInternalLoadBalancerVMs","listNetworkIsolationMethods","dedicateZone","dedicatePod","dedicateCluster","dedicateHost","releaseDedicatedZone","releaseDedicatedPod","releaseDedicatedCluster","releaseDedicatedHost","listDedicatedZones","listDedicatedPods","listDedicatedClusters","listDedicatedHosts","listLdapConfigurations","addLdapConfiguration","deleteLdapConfiguration","listLdapUsers","ldapCreateAccount","login","logout","cloudstackAPIClient"] \ No newline at end of file diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/activateProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/activateProject.py new file mode 100644 index 00000000000..cd7c7a774b6 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/activateProject.py @@ -0,0 +1,141 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Activates a project""" +from baseCmd import * +from baseResponse import * +class activateProjectCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of the project to be modified""" + """Required""" + self.id = None + self.required = ["id",] + +class activateProjectResponse (baseResponse): + def __init__(self): + """the id of the project""" + self.id = None + """the account name of the project's owner""" + self.account = None + """the total number of cpu cores available to be created for this project""" + self.cpuavailable = None + """the total number of cpu cores the project can own""" + self.cpulimit = None + """the total number of cpu cores owned by project""" + self.cputotal = None + """the displaytext of the project""" + self.displaytext = None + """the domain name where the project belongs to""" + self.domain = None + """the domain id the project belongs to""" + self.domainid = None + """the total number of public ip addresses available for this project to acquire""" + self.ipavailable = None + """the total number of public ip addresses this project can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this project""" + self.iptotal = None + """the total memory (in MB) available to be created for this project""" + self.memoryavailable = None + """the total memory (in MB) the project can own""" + self.memorylimit = None + """the total memory (in MB) owned by project""" + self.memorytotal = None + """the name of the project""" + self.name = None + """the total number of networks available to be created for this project""" + self.networkavailable = None + """the total number of networks the project can own""" + self.networklimit = None + """the total number of networks owned by project""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this project""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the project can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by project""" + self.primarystoragetotal = None + """the total secondary storage space (in GiB) available to be used for this project""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the project can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by project""" + self.secondarystoragetotal = None + """the total number of snapshots available for this project""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this project""" + self.snapshotlimit = None + """the total number of snapshots stored by this project""" + self.snapshottotal = None + """the state of the project""" + self.state = None + """the total number of templates available to be created by this project""" + self.templateavailable = None + """the total number of templates which can be created by this project""" + self.templatelimit = None + """the total number of templates which have been created by this project""" + self.templatetotal = None + """the total number of virtual machines available for this project to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this project""" + self.vmlimit = None + """the total number of virtual machines running for this project""" + self.vmrunning = None + """the total number of virtual machines stopped for this project""" + self.vmstopped = None + """the total number of virtual machines deployed by this project""" + self.vmtotal = None + """the total volume available for this project""" + self.volumeavailable = None + """the total volume which can be used by this project""" + self.volumelimit = None + """the total volume being used by this project""" + self.volumetotal = None + """the total number of vpcs available to be created for this project""" + self.vpcavailable = None + """the total number of vpcs the project can own""" + self.vpclimit = None + """the total number of vpcs owned by project""" + self.vpctotal = None + """the list of resource tags associated with vm""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addAccountToProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addAccountToProject.py new file mode 100644 index 00000000000..211c58d90ba --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addAccountToProject.py @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds acoount to a project""" +from baseCmd import * +from baseResponse import * +class addAccountToProjectCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of the project to add the account to""" + """Required""" + self.projectid = None + """name of the account to be added to the project""" + self.account = None + """email to which invitation to the project is going to be sent""" + self.email = None + self.required = ["projectid",] + +class addAccountToProjectResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalDhcp.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalDhcp.py new file mode 100644 index 00000000000..fa8b095e77e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalDhcp.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""adds a baremetal dhcp server""" +from baseCmd import * +from baseResponse import * +class addBaremetalDhcpCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Type of dhcp device""" + """Required""" + self.dhcpservertype = None + """Credentials to reach external dhcp device""" + """Required""" + self.password = None + """the Physical Network ID""" + """Required""" + self.physicalnetworkid = None + """URL of the external dhcp appliance.""" + """Required""" + self.url = None + """Credentials to reach external dhcp device""" + """Required""" + self.username = None + self.required = ["dhcpservertype","password","physicalnetworkid","url","username",] + +class addBaremetalDhcpResponse (baseResponse): + def __init__(self): + """device id of""" + self.id = None + """name of the provider""" + self.dhcpservertype = None + """the physical network to which this external dhcp device belongs to""" + self.physicalnetworkid = None + """name of the provider""" + self.provider = None + """url""" + self.url = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalHost.py new file mode 100644 index 00000000000..6fb003e15e3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalHost.py @@ -0,0 +1,147 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""add a baremetal host""" +from baseCmd import * +from baseResponse import * +class addBaremetalHostCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """hypervisor type of the host""" + """Required""" + self.hypervisor = None + """the password for the host""" + """Required""" + self.password = None + """the Pod ID for the host""" + """Required""" + self.podid = None + """the host URL""" + """Required""" + self.url = None + """the username for the host""" + """Required""" + self.username = None + """the Zone ID for the host""" + """Required""" + self.zoneid = None + """Allocation state of this Host for allocation of new resources""" + self.allocationstate = None + """the cluster ID for the host""" + self.clusterid = None + """the cluster name for the host""" + self.clustername = None + """list of tags to be added to the host""" + self.hosttags = [] + """ip address intentionally allocated to this host after provisioning""" + self.ipaddress = None + self.required = ["hypervisor","password","podid","url","username","zoneid",] + +class addBaremetalHostResponse (baseResponse): + def __init__(self): + """the ID of the host""" + self.id = None + """the cpu average load on the host""" + self.averageload = None + """capabilities of the host""" + self.capabilities = None + """the cluster ID of the host""" + self.clusterid = None + """the cluster name of the host""" + self.clustername = None + """the cluster type of the cluster that host belongs to""" + self.clustertype = None + """the amount of the host's CPU currently allocated""" + self.cpuallocated = None + """the CPU number of the host""" + self.cpunumber = None + """the CPU speed of the host""" + self.cpuspeed = None + """the amount of the host's CPU currently used""" + self.cpuused = None + """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" + self.cpuwithoverprovisioning = None + """the date and time the host was created""" + self.created = None + """true if the host is disconnected. False otherwise.""" + self.disconnected = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the host""" + self.disksizetotal = None + """events available for the host""" + self.events = None + """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" + self.hahost = None + """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" + self.hasenoughcapacity = None + """comma-separated list of tags for the host""" + self.hosttags = None + """the host hypervisor""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the IP address of the host""" + self.ipaddress = None + """true if local storage is active, false otherwise""" + self.islocalstorageactive = None + """the date and time the host was last pinged""" + self.lastpinged = None + """the management server ID of the host""" + self.managementserverid = None + """the amount of the host's memory currently allocated""" + self.memoryallocated = None + """the memory total of the host""" + self.memorytotal = None + """the amount of the host's memory currently used""" + self.memoryused = None + """the name of the host""" + self.name = None + """the incoming network traffic on the host""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the OS category ID of the host""" + self.oscategoryid = None + """the OS category name of the host""" + self.oscategoryname = None + """the Pod ID of the host""" + self.podid = None + """the Pod name of the host""" + self.podname = None + """the date and time the host was removed""" + self.removed = None + """the resource state of the host""" + self.resourcestate = None + """the state of the host""" + self.state = None + """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" + self.suitableformigration = None + """the host type""" + self.type = None + """the host version""" + self.version = None + """the Zone ID of the host""" + self.zoneid = None + """the Zone name of the host""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxeKickStartServer.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxeKickStartServer.py new file mode 100644 index 00000000000..14a1237cc14 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxeKickStartServer.py @@ -0,0 +1,51 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""add a baremetal pxe server""" +from baseCmd import * +from baseResponse import * +class addBaremetalPxeKickStartServerCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Credentials to reach external pxe device""" + """Required""" + self.password = None + """the Physical Network ID""" + """Required""" + self.physicalnetworkid = None + """type of pxe device""" + """Required""" + self.pxeservertype = None + """Tftp root directory of PXE server""" + """Required""" + self.tftpdir = None + """URL of the external pxe device""" + """Required""" + self.url = None + """Credentials to reach external pxe device""" + """Required""" + self.username = None + """Pod Id""" + self.podid = None + self.required = ["password","physicalnetworkid","pxeservertype","tftpdir","url","username",] + +class addBaremetalPxeKickStartServerResponse (baseResponse): + def __init__(self): + """Tftp root directory of PXE server""" + self.tftpdir = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxePingServer.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxePingServer.py new file mode 100644 index 00000000000..6e3d6bf03c8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxePingServer.py @@ -0,0 +1,65 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""add a baremetal ping pxe server""" +from baseCmd import * +from baseResponse import * +class addBaremetalPxePingServerCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Credentials to reach external pxe device""" + """Required""" + self.password = None + """the Physical Network ID""" + """Required""" + self.physicalnetworkid = None + """Root directory on PING storage server""" + """Required""" + self.pingdir = None + """PING storage server ip""" + """Required""" + self.pingstorageserverip = None + """type of pxe device""" + """Required""" + self.pxeservertype = None + """Tftp root directory of PXE server""" + """Required""" + self.tftpdir = None + """URL of the external pxe device""" + """Required""" + self.url = None + """Credentials to reach external pxe device""" + """Required""" + self.username = None + """Password of PING storage server""" + self.pingcifspassword = None + """Username of PING storage server""" + self.pingcifsusername = None + """Pod Id""" + self.podid = None + self.required = ["password","physicalnetworkid","pingdir","pingstorageserverip","pxeservertype","tftpdir","url","username",] + +class addBaremetalPxePingServerResponse (baseResponse): + def __init__(self): + """Root directory on PING storage server""" + self.pingdir = None + """PING storage server ip""" + self.pingstorageserverip = None + """Tftp root directory of PXE server""" + self.tftpdir = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBigSwitchVnsDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBigSwitchVnsDevice.py new file mode 100644 index 00000000000..77a74765932 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addBigSwitchVnsDevice.py @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds a BigSwitch VNS device""" +from baseCmd import * +from baseResponse import * +class addBigSwitchVnsDeviceCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Hostname of ip address of the BigSwitch VNS Controller.""" + """Required""" + self.hostname = None + """the Physical Network ID""" + """Required""" + self.physicalnetworkid = None + self.required = ["hostname","physicalnetworkid",] + +class addBigSwitchVnsDeviceResponse (baseResponse): + def __init__(self): + """device name""" + self.bigswitchdevicename = None + """the controller Ip address""" + self.hostname = None + """the physical network to which this BigSwitch Vns belongs to""" + self.physicalnetworkid = None + """name of the provider""" + self.provider = None + """device id of the BigSwitch Vns""" + self.vnsdeviceid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addCluster.py new file mode 100644 index 00000000000..26d7f6c2d5d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addCluster.py @@ -0,0 +1,115 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds a new cluster""" +from baseCmd import * +from baseResponse import * +class addClusterCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the cluster name""" + """Required""" + self.clustername = None + """type of the cluster: CloudManaged, ExternalManaged""" + """Required""" + self.clustertype = None + """hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator""" + """Required""" + self.hypervisor = None + """the Pod ID for the host""" + """Required""" + self.podid = None + """the Zone ID for the cluster""" + """Required""" + self.zoneid = None + """Allocation state of this cluster for allocation of new resources""" + self.allocationstate = None + """Name of virtual switch used for guest traffic in the cluster. This would override zone wide traffic label setting.""" + self.guestvswitchname = None + """Type of virtual switch used for guest traffic in the cluster. Allowed values are, vmwaresvs (for VMware standard vSwitch) and vmwaredvs (for VMware distributed vSwitch)""" + self.guestvswitchtype = None + """the password for the host""" + self.password = None + """Name of virtual switch used for public traffic in the cluster. This would override zone wide traffic label setting.""" + self.publicvswitchname = None + """Type of virtual switch used for public traffic in the cluster. Allowed values are, vmwaresvs (for VMware standard vSwitch) and vmwaredvs (for VMware distributed vSwitch)""" + self.publicvswitchtype = None + """the URL""" + self.url = None + """the username for the cluster""" + self.username = None + """the ipaddress of the VSM associated with this cluster""" + self.vsmipaddress = None + """the password for the VSM associated with this cluster""" + self.vsmpassword = None + """the username for the VSM associated with this cluster""" + self.vsmusername = None + self.required = ["clustername","clustertype","hypervisor","podid","zoneid",] + +class addClusterResponse (baseResponse): + def __init__(self): + """the cluster ID""" + self.id = None + """the allocation state of the cluster""" + self.allocationstate = None + """the type of the cluster""" + self.clustertype = None + """The cpu overcommit ratio of the cluster""" + self.cpuovercommitratio = None + """the hypervisor type of the cluster""" + self.hypervisortype = None + """whether this cluster is managed by cloudstack""" + self.managedstate = None + """The memory overcommit ratio of the cluster""" + self.memoryovercommitratio = None + """the cluster name""" + self.name = None + """the Pod ID of the cluster""" + self.podid = None + """the Pod name of the cluster""" + self.podname = None + """the Zone ID of the cluster""" + self.zoneid = None + """the Zone name of the cluster""" + self.zonename = None + """the capacity of the Cluster""" + self.capacity = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addHost.py new file mode 100644 index 00000000000..c1a96e084d3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addHost.py @@ -0,0 +1,145 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds a new host.""" +from baseCmd import * +from baseResponse import * +class addHostCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """hypervisor type of the host""" + """Required""" + self.hypervisor = None + """the password for the host""" + """Required""" + self.password = None + """the Pod ID for the host""" + """Required""" + self.podid = None + """the host URL""" + """Required""" + self.url = None + """the username for the host""" + """Required""" + self.username = None + """the Zone ID for the host""" + """Required""" + self.zoneid = None + """Allocation state of this Host for allocation of new resources""" + self.allocationstate = None + """the cluster ID for the host""" + self.clusterid = None + """the cluster name for the host""" + self.clustername = None + """list of tags to be added to the host""" + self.hosttags = [] + self.required = ["hypervisor","password","podid","url","username","zoneid",] + +class addHostResponse (baseResponse): + def __init__(self): + """the ID of the host""" + self.id = None + """the cpu average load on the host""" + self.averageload = None + """capabilities of the host""" + self.capabilities = None + """the cluster ID of the host""" + self.clusterid = None + """the cluster name of the host""" + self.clustername = None + """the cluster type of the cluster that host belongs to""" + self.clustertype = None + """the amount of the host's CPU currently allocated""" + self.cpuallocated = None + """the CPU number of the host""" + self.cpunumber = None + """the CPU speed of the host""" + self.cpuspeed = None + """the amount of the host's CPU currently used""" + self.cpuused = None + """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" + self.cpuwithoverprovisioning = None + """the date and time the host was created""" + self.created = None + """true if the host is disconnected. False otherwise.""" + self.disconnected = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the host""" + self.disksizetotal = None + """events available for the host""" + self.events = None + """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" + self.hahost = None + """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" + self.hasenoughcapacity = None + """comma-separated list of tags for the host""" + self.hosttags = None + """the host hypervisor""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the IP address of the host""" + self.ipaddress = None + """true if local storage is active, false otherwise""" + self.islocalstorageactive = None + """the date and time the host was last pinged""" + self.lastpinged = None + """the management server ID of the host""" + self.managementserverid = None + """the amount of the host's memory currently allocated""" + self.memoryallocated = None + """the memory total of the host""" + self.memorytotal = None + """the amount of the host's memory currently used""" + self.memoryused = None + """the name of the host""" + self.name = None + """the incoming network traffic on the host""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the OS category ID of the host""" + self.oscategoryid = None + """the OS category name of the host""" + self.oscategoryname = None + """the Pod ID of the host""" + self.podid = None + """the Pod name of the host""" + self.podname = None + """the date and time the host was removed""" + self.removed = None + """the resource state of the host""" + self.resourcestate = None + """the state of the host""" + self.state = None + """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" + self.suitableformigration = None + """the host type""" + self.type = None + """the host version""" + self.version = None + """the Zone ID of the host""" + self.zoneid = None + """the Zone name of the host""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addImageStore.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addImageStore.py new file mode 100644 index 00000000000..c8ea3e2d350 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addImageStore.py @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds backup image store.""" +from baseCmd import * +from baseResponse import * +class addImageStoreCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the image store provider name""" + """Required""" + self.provider = None + """the details for the image store. Example: details[0].key=accesskey&details[0].value=s389ddssaa&details[1].key=secretkey&details[1].value=8dshfsss""" + self.details = [] + """the name for the image store""" + self.name = None + """the URL for the image store""" + self.url = None + """the Zone ID for the image store""" + self.zoneid = None + self.required = ["provider",] + +class addImageStoreResponse (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addIpToNic.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addIpToNic.py new file mode 100644 index 00000000000..5810fe89abd --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addIpToNic.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Assigns secondary IP to NIC""" +from baseCmd import * +from baseResponse import * +class addIpToNicCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the nic to which you want to assign private IP""" + """Required""" + self.nicid = None + """Secondary IP Address""" + self.ipaddress = None + self.required = ["nicid",] + +class addIpToNicResponse (baseResponse): + def __init__(self): + """the ID of the secondary private IP addr""" + self.id = None + """Secondary IP address""" + self.ipaddress = None + """the ID of the network""" + self.networkid = None + """the ID of the nic""" + self.nicid = None + """the ID of the vm""" + self.virtualmachineid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addLdapConfiguration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addLdapConfiguration.py new file mode 100644 index 00000000000..993108e7d40 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addLdapConfiguration.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Add a new Ldap Configuration""" +from baseCmd import * +from baseResponse import * +class addLdapConfigurationCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Hostname""" + """Required""" + self.hostname = None + """Port""" + """Required""" + self.port = None + self.required = ["hostname","port",] + +class addLdapConfigurationResponse (baseResponse): + def __init__(self): + """hostname""" + self.hostname = None + """port""" + self.port = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkDevice.py new file mode 100644 index 00000000000..efd5b081b7d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkDevice.py @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds a network device of one of the following types: ExternalDhcp, ExternalFirewall, ExternalLoadBalancer, PxeServer""" +from baseCmd import * +from baseResponse import * +class addNetworkDeviceCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """parameters for network device""" + self.networkdeviceparameterlist = [] + """Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall""" + self.networkdevicetype = None + self.required = [] + +class addNetworkDeviceResponse (baseResponse): + def __init__(self): + """the ID of the network device""" + self.id = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkServiceProvider.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkServiceProvider.py new file mode 100644 index 00000000000..b00c20497d0 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkServiceProvider.py @@ -0,0 +1,53 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds a network serviceProvider to a physical network""" +from baseCmd import * +from baseResponse import * +class addNetworkServiceProviderCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the name for the physical network service provider""" + """Required""" + self.name = None + """the Physical Network ID to add the provider to""" + """Required""" + self.physicalnetworkid = None + """the destination Physical Network ID to bridge to""" + self.destinationphysicalnetworkid = None + """the list of services to be enabled for this physical network service provider""" + self.servicelist = [] + self.required = ["name","physicalnetworkid",] + +class addNetworkServiceProviderResponse (baseResponse): + def __init__(self): + """uuid of the network provider""" + self.id = None + """true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """the destination physical network""" + self.destinationphysicalnetworkid = None + """the provider name""" + self.name = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """services for this provider""" + self.servicelist = None + """state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addNicToVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addNicToVirtualMachine.py new file mode 100644 index 00000000000..0385acc65bd --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addNicToVirtualMachine.py @@ -0,0 +1,374 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds VM to specified network by creating a NIC""" +from baseCmd import * +from baseResponse import * +class addNicToVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Network ID""" + """Required""" + self.networkid = None + """Virtual Machine ID""" + """Required""" + self.virtualmachineid = None + """IP Address for the new network""" + self.ipaddress = None + self.required = ["networkid","virtualmachineid",] + +class addNicToVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addNiciraNvpDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addNiciraNvpDevice.py new file mode 100644 index 00000000000..2a1b3b9c8b0 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addNiciraNvpDevice.py @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds a Nicira NVP device""" +from baseCmd import * +from baseResponse import * +class addNiciraNvpDeviceCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Hostname of ip address of the Nicira NVP Controller.""" + """Required""" + self.hostname = None + """Credentials to access the Nicira Controller API""" + """Required""" + self.password = None + """the Physical Network ID""" + """Required""" + self.physicalnetworkid = None + """The Transportzone UUID configured on the Nicira Controller""" + """Required""" + self.transportzoneuuid = None + """Credentials to access the Nicira Controller API""" + """Required""" + self.username = None + """The L3 Gateway Service UUID configured on the Nicira Controller""" + self.l3gatewayserviceuuid = None + self.required = ["hostname","password","physicalnetworkid","transportzoneuuid","username",] + +class addNiciraNvpDeviceResponse (baseResponse): + def __init__(self): + """the controller Ip address""" + self.hostname = None + """this L3 gateway service Uuid""" + self.l3gatewayserviceuuid = None + """device name""" + self.niciradevicename = None + """device id of the Nicire Nvp""" + self.nvpdeviceid = None + """the physical network to which this Nirica Nvp belongs to""" + self.physicalnetworkid = None + """name of the provider""" + self.provider = None + """the transport zone Uuid""" + self.transportzoneuuid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addRegion.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addRegion.py new file mode 100644 index 00000000000..31dd483789c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addRegion.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds a Region""" +from baseCmd import * +from baseResponse import * +class addRegionCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Id of the Region""" + """Required""" + self.id = None + """Region service endpoint""" + """Required""" + self.endpoint = None + """Name of the region""" + """Required""" + self.name = None + self.required = ["id","endpoint","name",] + +class addRegionResponse (baseResponse): + def __init__(self): + """the ID of the region""" + self.id = None + """the end point of the region""" + self.endpoint = None + """true if GSLB service is enabled in the region, false otherwise""" + self.gslbserviceenabled = None + """the name of the region""" + self.name = None + """true if security groups support is enabled, false otherwise""" + self.portableipserviceenabled = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addResourceDetail.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addResourceDetail.py new file mode 100644 index 00000000000..d5f514b02d9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addResourceDetail.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds detail for the Resource.""" +from baseCmd import * +from baseResponse import * +class addResourceDetailCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Map of (key/value pairs)""" + """Required""" + self.details = [] + """resource id to create the details for""" + """Required""" + self.resourceid = None + """type of the resource""" + """Required""" + self.resourcetype = None + self.required = ["details","resourceid","resourcetype",] + +class addResourceDetailResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addS3.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addS3.py new file mode 100644 index 00000000000..18a4eb6b95b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addS3.py @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds S3""" +from baseCmd import * +from baseResponse import * +class addS3Cmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """S3 access key""" + """Required""" + self.accesskey = None + """name of the template storage bucket""" + """Required""" + self.bucket = None + """S3 secret key""" + """Required""" + self.secretkey = None + """connection timeout (milliseconds)""" + self.connectiontimeout = None + """S3 host name""" + self.endpoint = None + """maximum number of times to retry on error""" + self.maxerrorretry = None + """socket timeout (milliseconds)""" + self.sockettimeout = None + """connect to the S3 endpoint via HTTPS?""" + self.usehttps = None + self.required = ["accesskey","bucket","secretkey",] + +class addS3Response (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addSecondaryStorage.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addSecondaryStorage.py new file mode 100644 index 00000000000..1e112ffd80c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addSecondaryStorage.py @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds secondary storage.""" +from baseCmd import * +from baseResponse import * +class addSecondaryStorageCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the URL for the secondary storage""" + """Required""" + self.url = None + """the Zone ID for the secondary storage""" + self.zoneid = None + self.required = ["url",] + +class addSecondaryStorageResponse (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addSwift.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addSwift.py new file mode 100644 index 00000000000..1fe435be963 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addSwift.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds Swift.""" +from baseCmd import * +from baseResponse import * +class addSwiftCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the URL for swift""" + """Required""" + self.url = None + """the account for swift""" + self.account = None + """key for the user for swift""" + self.key = None + """the username for swift""" + self.username = None + self.required = ["url",] + +class addSwiftResponse (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficMonitor.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficMonitor.py new file mode 100644 index 00000000000..292e577914f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficMonitor.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds Traffic Monitor Host for Direct Network Usage""" +from baseCmd import * +from baseResponse import * +class addTrafficMonitorCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """URL of the traffic monitor Host""" + """Required""" + self.url = None + """Zone in which to add the external firewall appliance.""" + """Required""" + self.zoneid = None + """Traffic going into the listed zones will not be metered""" + self.excludezones = None + """Traffic going into the listed zones will be metered""" + self.includezones = None + self.required = ["url","zoneid",] + +class addTrafficMonitorResponse (baseResponse): + def __init__(self): + """the ID of the external firewall""" + self.id = None + """the management IP address of the external firewall""" + self.ipaddress = None + """the number of times to retry requests to the external firewall""" + self.numretries = None + """the timeout (in seconds) for requests to the external firewall""" + self.timeout = None + """the zone ID of the external firewall""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficType.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficType.py new file mode 100644 index 00000000000..5da6f553fd0 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficType.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds traffic type to a physical network""" +from baseCmd import * +from baseResponse import * +class addTrafficTypeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the Physical Network ID""" + """Required""" + self.physicalnetworkid = None + """the trafficType to be added to the physical network""" + """Required""" + self.traffictype = None + """The network name label of the physical device dedicated to this traffic on a KVM host""" + self.kvmnetworklabel = None + """The VLAN id to be used for Management traffic by VMware host""" + self.vlan = None + """The network name label of the physical device dedicated to this traffic on a VMware host""" + self.vmwarenetworklabel = None + """The network name label of the physical device dedicated to this traffic on a XenServer host""" + self.xennetworklabel = None + self.required = ["physicalnetworkid","traffictype",] + +class addTrafficTypeResponse (baseResponse): + def __init__(self): + """id of the network provider""" + self.id = None + """The network name label of the physical device dedicated to this traffic on a KVM host""" + self.kvmnetworklabel = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """the trafficType to be added to the physical network""" + self.traffictype = None + """The network name label of the physical device dedicated to this traffic on a VMware host""" + self.vmwarenetworklabel = None + """The network name label of the physical device dedicated to this traffic on a XenServer host""" + self.xennetworklabel = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addUcsManager.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addUcsManager.py new file mode 100644 index 00000000000..43ce10c853c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addUcsManager.py @@ -0,0 +1,51 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds a Ucs manager""" +from baseCmd import * +from baseResponse import * +class addUcsManagerCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the password of UCS""" + """Required""" + self.password = None + """the name of UCS url""" + """Required""" + self.url = None + """the username of UCS""" + """Required""" + self.username = None + """the Zone id for the ucs manager""" + """Required""" + self.zoneid = None + """the name of UCS manager""" + self.name = None + self.required = ["password","url","username","zoneid",] + +class addUcsManagerResponse (baseResponse): + def __init__(self): + """the ID of the ucs manager""" + self.id = None + """the name of ucs manager""" + self.name = None + """the url of ucs manager""" + self.url = None + """the zone ID of ucs manager""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addVpnUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addVpnUser.py new file mode 100644 index 00000000000..e5ef5862959 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/addVpnUser.py @@ -0,0 +1,57 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds vpn users""" +from baseCmd import * +from baseResponse import * +class addVpnUserCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """password for the username""" + """Required""" + self.password = None + """username for the vpn user""" + """Required""" + self.username = None + """an optional account for the vpn user. Must be used with domainId.""" + self.account = None + """an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """add vpn user to the specific project""" + self.projectid = None + self.required = ["password","username",] + +class addVpnUserResponse (baseResponse): + def __init__(self): + """the vpn userID""" + self.id = None + """the account of the remote access vpn""" + self.account = None + """the domain name of the account of the remote access vpn""" + self.domain = None + """the domain id of the account of the remote access vpn""" + self.domainid = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the state of the Vpn User""" + self.state = None + """the username of the vpn user""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/archiveAlerts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/archiveAlerts.py new file mode 100644 index 00000000000..c02e1251263 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/archiveAlerts.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Archive one or more alerts.""" +from baseCmd import * +from baseResponse import * +class archiveAlertsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """end date range to archive alerts (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" + self.enddate = None + """the IDs of the alerts""" + self.ids = [] + """start date range to archive alerts (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" + self.startdate = None + """archive by alert type""" + self.type = None + self.required = [] + +class archiveAlertsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/archiveEvents.py b/tools/marvin/build/lib/marvin/cloudstackAPI/archiveEvents.py new file mode 100644 index 00000000000..7a9dd572e01 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/archiveEvents.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Archive one or more events.""" +from baseCmd import * +from baseResponse import * +class archiveEventsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """end date range to archive events (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" + self.enddate = None + """the IDs of the events""" + self.ids = [] + """start date range to archive events (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" + self.startdate = None + """archive by event type""" + self.type = None + self.required = [] + +class archiveEventsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/assignToGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/assignToGlobalLoadBalancerRule.py new file mode 100644 index 00000000000..f0071437dbe --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/assignToGlobalLoadBalancerRule.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Assign load balancer rule or list of load balancer rules to a global load balancer rules.""" +from baseCmd import * +from baseResponse import * +class assignToGlobalLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the global load balancer rule""" + """Required""" + self.id = None + """the list load balancer rules that will be assigned to gloabal load balacner rule""" + """Required""" + self.loadbalancerrulelist = [] + """Map of LB rule id's and corresponding weights (between 1-100) in the GSLB rule, if not specified weight of a LB rule is defaulted to 1. Specified as 'gslblbruleweightsmap[0].loadbalancerid=UUID&gslblbruleweightsmap[0].weight=10'""" + self.gslblbruleweightsmap = [] + self.required = ["id","loadbalancerrulelist",] + +class assignToGlobalLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/assignToLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/assignToLoadBalancerRule.py new file mode 100644 index 00000000000..56901e8e13f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/assignToLoadBalancerRule.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Assigns virtual machine or a list of virtual machines to a load balancer rule.""" +from baseCmd import * +from baseResponse import * +class assignToLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the load balancer rule""" + """Required""" + self.id = None + """the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)""" + """Required""" + self.virtualmachineids = [] + self.required = ["id","virtualmachineids",] + +class assignToLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/assignVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/assignVirtualMachine.py new file mode 100644 index 00000000000..e193c0e4b00 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/assignVirtualMachine.py @@ -0,0 +1,379 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Change ownership of a VM from one account to another. This API is available for Basic zones with security groups and Advanced zones with guest networks. A root administrator can reassign a VM from any account to any other account in any domain. A domain administrator can reassign a VM to any account in the same domain.""" +from baseCmd import * +from baseResponse import * +class assignVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """account name of the new VM owner.""" + """Required""" + self.account = None + """domain id of the new VM owner.""" + """Required""" + self.domainid = None + """id of the VM to be moved""" + """Required""" + self.virtualmachineid = None + """list of new network ids in which the moved VM will participate. In case no network ids are provided the VM will be part of the default network for that zone. In case there is no network yet created for the new account the default network will be created.""" + self.networkids = [] + """list of security group ids to be applied on the virtual machine. In case no security groups are provided the VM is part of the default security group.""" + self.securitygroupids = [] + self.required = ["account","domainid","virtualmachineid",] + +class assignVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/associateIpAddress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/associateIpAddress.py new file mode 100644 index 00000000000..acf5e5f214c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/associateIpAddress.py @@ -0,0 +1,130 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Acquires and associates a public IP to an account.""" +from baseCmd import * +from baseResponse import * +class associateIpAddressCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the account to associate with this IP address""" + self.account = None + """the ID of the domain to associate with this IP address""" + self.domainid = None + """should be set to true if public IP is required to be transferable across zones, if not specified defaults to false""" + self.isportable = None + """The network this ip address should be associated to.""" + self.networkid = None + """Deploy vm for the project""" + self.projectid = None + """region ID from where portable ip is to be associated.""" + self.regionid = None + """the VPC you want the ip address to be associated with""" + self.vpcid = None + """the ID of the availability zone you want to acquire an public IP address from""" + self.zoneid = None + self.required = [] + +class associateIpAddressResponse (baseResponse): + def __init__(self): + """public IP address id""" + self.id = None + """the account the public IP address is associated with""" + self.account = None + """date the public IP address was acquired""" + self.allocated = None + """the ID of the Network associated with the IP address""" + self.associatednetworkid = None + """the name of the Network associated with the IP address""" + self.associatednetworkname = None + """the domain the public IP address is associated with""" + self.domain = None + """the domain ID the public IP address is associated with""" + self.domainid = None + """the virtual network for the IP address""" + self.forvirtualnetwork = None + """public IP address""" + self.ipaddress = None + """is public IP portable across the zones""" + self.isportable = None + """true if the IP address is a source nat address, false otherwise""" + self.issourcenat = None + """true if this ip is for static nat, false otherwise""" + self.isstaticnat = None + """true if this ip is system ip (was allocated as a part of deployVm or createLbRule)""" + self.issystem = None + """the ID of the Network where ip belongs to""" + self.networkid = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value""" + self.purpose = None + """State of the ip address. Can be: Allocatin, Allocated and Releasing""" + self.state = None + """virutal machine display name the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachinedisplayname = None + """virutal machine id the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachineid = None + """virutal machine name the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachinename = None + """the ID of the VLAN associated with the IP address. This parameter is visible to ROOT admins only""" + self.vlanid = None + """the VLAN associated with the IP address""" + self.vlanname = None + """virutal machine (dnat) ip address (not null only for static nat Ip)""" + self.vmipaddress = None + """VPC the ip belongs to""" + self.vpcid = None + """the ID of the zone the public IP address belongs to""" + self.zoneid = None + """the name of the zone the public IP address belongs to""" + self.zonename = None + """the list of resource tags associated with ip address""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/associateUcsProfileToBlade.py b/tools/marvin/build/lib/marvin/cloudstackAPI/associateUcsProfileToBlade.py new file mode 100644 index 00000000000..62d30c3293a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/associateUcsProfileToBlade.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""associate a profile to a blade""" +from baseCmd import * +from baseResponse import * +class associateUcsProfileToBladeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """blade id""" + """Required""" + self.bladeid = None + """profile dn""" + """Required""" + self.profiledn = None + """ucs manager id""" + """Required""" + self.ucsmanagerid = None + self.required = ["bladeid","profiledn","ucsmanagerid",] + +class associateUcsProfileToBladeResponse (baseResponse): + def __init__(self): + """ucs blade id""" + self.id = None + """ucs blade dn""" + self.bladedn = None + """cloudstack host id this blade associates to""" + self.hostid = None + """associated ucs profile dn""" + self.profiledn = None + """ucs manager id""" + self.ucsmanagerid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/attachIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/attachIso.py new file mode 100644 index 00000000000..68159da3a25 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/attachIso.py @@ -0,0 +1,372 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Attaches an ISO to a virtual machine.""" +from baseCmd import * +from baseResponse import * +class attachIsoCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the ISO file""" + """Required""" + self.id = None + """the ID of the virtual machine""" + """Required""" + self.virtualmachineid = None + self.required = ["id","virtualmachineid",] + +class attachIsoResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/attachVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/attachVolume.py new file mode 100644 index 00000000000..7298731d506 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/attachVolume.py @@ -0,0 +1,148 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Attaches a disk volume to a virtual machine.""" +from baseCmd import * +from baseResponse import * +class attachVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the disk volume""" + """Required""" + self.id = None + """the ID of the virtual machine""" + """Required""" + self.virtualmachineid = None + """the ID of the device to map the volume to within the guest OS. If no deviceId is passed in, the next available deviceId will be chosen. Possible values for a Linux OS are:* 1 - /dev/xvdb* 2 - /dev/xvdc* 4 - /dev/xvde* 5 - /dev/xvdf* 6 - /dev/xvdg* 7 - /dev/xvdh* 8 - /dev/xvdi* 9 - /dev/xvdj""" + self.deviceid = None + self.required = ["id","virtualmachineid",] + +class attachVolumeResponse (baseResponse): + def __init__(self): + """ID of the disk volume""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the date the volume was attached to a VM instance""" + self.attached = None + """the date the disk volume was created""" + self.created = None + """the boolean state of whether the volume is destroyed or not""" + self.destroyed = None + """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" + self.deviceid = None + """bytes read rate of the disk volume""" + self.diskBytesReadRate = None + """bytes write rate of the disk volume""" + self.diskBytesWriteRate = None + """io requests read rate of the disk volume""" + self.diskIopsReadRate = None + """io requests write rate of the disk volume""" + self.diskIopsWriteRate = None + """the display text of the disk offering""" + self.diskofferingdisplaytext = None + """ID of the disk offering""" + self.diskofferingid = None + """name of the disk offering""" + self.diskofferingname = None + """an optional field whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """Hypervisor the volume belongs to""" + self.hypervisor = None + """true if the volume is extractable, false otherwise""" + self.isextractable = None + """max iops of the disk volume""" + self.maxiops = None + """min iops of the disk volume""" + self.miniops = None + """name of the disk volume""" + self.name = None + """The path of the volume""" + self.path = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the display text of the service offering for root disk""" + self.serviceofferingdisplaytext = None + """ID of the service offering for root disk""" + self.serviceofferingid = None + """name of the service offering for root disk""" + self.serviceofferingname = None + """size of the disk volume""" + self.size = None + """ID of the snapshot from which this volume was created""" + self.snapshotid = None + """the state of the disk volume""" + self.state = None + """the status of the volume""" + self.status = None + """name of the primary storage hosting the disk volume""" + self.storage = None + """id of the primary storage hosting the disk volume; returned to admin user only""" + self.storageid = None + """shared or local storage""" + self.storagetype = None + """type of the disk volume (ROOT or DATADISK)""" + self.type = None + """id of the virtual machine""" + self.virtualmachineid = None + """display name of the virtual machine""" + self.vmdisplayname = None + """name of the virtual machine""" + self.vmname = None + """state of the virtual machine""" + self.vmstate = None + """ID of the availability zone""" + self.zoneid = None + """name of the availability zone""" + self.zonename = None + """the list of resource tags associated with volume""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupEgress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupEgress.py new file mode 100644 index 00000000000..42148080a6d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupEgress.py @@ -0,0 +1,71 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Authorizes a particular egress rule for this security group""" +from baseCmd import * +from baseResponse import * +class authorizeSecurityGroupEgressCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """an optional account for the security group. Must be used with domainId.""" + self.account = None + """the cidr list associated""" + self.cidrlist = [] + """an optional domainId for the security group. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """end port for this egress rule""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """an optional project of the security group""" + self.projectid = None + """TCP is default. UDP is the other supported protocol""" + self.protocol = None + """The ID of the security group. Mutually exclusive with securityGroupName parameter""" + self.securitygroupid = None + """The name of the security group. Mutually exclusive with securityGroupName parameter""" + self.securitygroupname = None + """start port for this egress rule""" + self.startport = None + """user to security group mapping""" + self.usersecuritygrouplist = [] + self.required = [] + +class authorizeSecurityGroupEgressResponse (baseResponse): + def __init__(self): + """account owning the security group rule""" + self.account = None + """the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """the ending IP of the security group rule""" + self.endport = None + """the code for the ICMP message response""" + self.icmpcode = None + """the type of the ICMP message response""" + self.icmptype = None + """the protocol of the security group rule""" + self.protocol = None + """the id of the security group rule""" + self.ruleid = None + """security group name""" + self.securitygroupname = None + """the starting IP of the security group rule""" + self.startport = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupIngress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupIngress.py new file mode 100644 index 00000000000..50c165027b3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupIngress.py @@ -0,0 +1,71 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Authorizes a particular ingress rule for this security group""" +from baseCmd import * +from baseResponse import * +class authorizeSecurityGroupIngressCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """an optional account for the security group. Must be used with domainId.""" + self.account = None + """the cidr list associated""" + self.cidrlist = [] + """an optional domainId for the security group. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """end port for this ingress rule""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """an optional project of the security group""" + self.projectid = None + """TCP is default. UDP is the other supported protocol""" + self.protocol = None + """The ID of the security group. Mutually exclusive with securityGroupName parameter""" + self.securitygroupid = None + """The name of the security group. Mutually exclusive with securityGroupName parameter""" + self.securitygroupname = None + """start port for this ingress rule""" + self.startport = None + """user to security group mapping""" + self.usersecuritygrouplist = [] + self.required = [] + +class authorizeSecurityGroupIngressResponse (baseResponse): + def __init__(self): + """account owning the security group rule""" + self.account = None + """the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """the ending IP of the security group rule""" + self.endport = None + """the code for the ICMP message response""" + self.icmpcode = None + """the type of the ICMP message response""" + self.icmptype = None + """the protocol of the security group rule""" + self.protocol = None + """the id of the security group rule""" + self.ruleid = None + """security group name""" + self.securitygroupname = None + """the starting IP of the security group rule""" + self.startport = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/baseCmd.py b/tools/marvin/build/lib/marvin/cloudstackAPI/baseCmd.py new file mode 100644 index 00000000000..f03f42ddc6d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/baseCmd.py @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""Base Command""" +class baseCmd(object): + pass diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/baseResponse.py b/tools/marvin/build/lib/marvin/cloudstackAPI/baseResponse.py new file mode 100644 index 00000000000..8c5742fe224 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/baseResponse.py @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""Base class for response""" +class baseResponse(object): + pass diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/cancelHostMaintenance.py b/tools/marvin/build/lib/marvin/cloudstackAPI/cancelHostMaintenance.py new file mode 100644 index 00000000000..b5b99766fbc --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/cancelHostMaintenance.py @@ -0,0 +1,122 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Cancels host maintenance.""" +from baseCmd import * +from baseResponse import * +class cancelHostMaintenanceCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the host ID""" + """Required""" + self.id = None + self.required = ["id",] + +class cancelHostMaintenanceResponse (baseResponse): + def __init__(self): + """the ID of the host""" + self.id = None + """the cpu average load on the host""" + self.averageload = None + """capabilities of the host""" + self.capabilities = None + """the cluster ID of the host""" + self.clusterid = None + """the cluster name of the host""" + self.clustername = None + """the cluster type of the cluster that host belongs to""" + self.clustertype = None + """the amount of the host's CPU currently allocated""" + self.cpuallocated = None + """the CPU number of the host""" + self.cpunumber = None + """the CPU speed of the host""" + self.cpuspeed = None + """the amount of the host's CPU currently used""" + self.cpuused = None + """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" + self.cpuwithoverprovisioning = None + """the date and time the host was created""" + self.created = None + """true if the host is disconnected. False otherwise.""" + self.disconnected = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the host""" + self.disksizetotal = None + """events available for the host""" + self.events = None + """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" + self.hahost = None + """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" + self.hasenoughcapacity = None + """comma-separated list of tags for the host""" + self.hosttags = None + """the host hypervisor""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the IP address of the host""" + self.ipaddress = None + """true if local storage is active, false otherwise""" + self.islocalstorageactive = None + """the date and time the host was last pinged""" + self.lastpinged = None + """the management server ID of the host""" + self.managementserverid = None + """the amount of the host's memory currently allocated""" + self.memoryallocated = None + """the memory total of the host""" + self.memorytotal = None + """the amount of the host's memory currently used""" + self.memoryused = None + """the name of the host""" + self.name = None + """the incoming network traffic on the host""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the OS category ID of the host""" + self.oscategoryid = None + """the OS category name of the host""" + self.oscategoryname = None + """the Pod ID of the host""" + self.podid = None + """the Pod name of the host""" + self.podname = None + """the date and time the host was removed""" + self.removed = None + """the resource state of the host""" + self.resourcestate = None + """the state of the host""" + self.state = None + """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" + self.suitableformigration = None + """the host type""" + self.type = None + """the host version""" + self.version = None + """the Zone ID of the host""" + self.zoneid = None + """the Zone name of the host""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/cancelStorageMaintenance.py b/tools/marvin/build/lib/marvin/cloudstackAPI/cancelStorageMaintenance.py new file mode 100644 index 00000000000..ccd954728c6 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/cancelStorageMaintenance.py @@ -0,0 +1,78 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Cancels maintenance for primary storage""" +from baseCmd import * +from baseResponse import * +class cancelStorageMaintenanceCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the primary storage ID""" + """Required""" + self.id = None + self.required = ["id",] + +class cancelStorageMaintenanceResponse (baseResponse): + def __init__(self): + """the ID of the storage pool""" + self.id = None + """IOPS CloudStack can provision from this storage pool""" + self.capacityiops = None + """the ID of the cluster for the storage pool""" + self.clusterid = None + """the name of the cluster for the storage pool""" + self.clustername = None + """the date and time the storage pool was created""" + self.created = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the storage pool""" + self.disksizetotal = None + """the host's currently used disk size""" + self.disksizeused = None + """the hypervisor type of the storage pool""" + self.hypervisor = None + """the IP address of the storage pool""" + self.ipaddress = None + """the name of the storage pool""" + self.name = None + """the storage pool path""" + self.path = None + """the Pod ID of the storage pool""" + self.podid = None + """the Pod name of the storage pool""" + self.podname = None + """the scope of the storage pool""" + self.scope = None + """the state of the storage pool""" + self.state = None + """true if this pool is suitable to migrate a volume, false otherwise""" + self.suitableformigration = None + """the tags for the storage pool""" + self.tags = None + """the storage pool type""" + self.type = None + """the Zone ID of the storage pool""" + self.zoneid = None + """the Zone name of the storage pool""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForRouter.py new file mode 100644 index 00000000000..a189633f62d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForRouter.py @@ -0,0 +1,154 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Upgrades domain router to a new service offering""" +from baseCmd import * +from baseResponse import * +class changeServiceForRouterCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """The ID of the router""" + """Required""" + self.id = None + """the service offering ID to apply to the domain router""" + """Required""" + self.serviceofferingid = None + self.required = ["id","serviceofferingid",] + +class changeServiceForRouterResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForSystemVm.py new file mode 100644 index 00000000000..1a6c1b25e25 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForSystemVm.py @@ -0,0 +1,89 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Changes the service offering for a system vm (console proxy or secondary storage). The system vm must be in a "Stopped" state for this command to take effect.""" +from baseCmd import * +from baseResponse import * +class changeServiceForSystemVmCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """The ID of the system vm""" + """Required""" + self.id = None + """the service offering ID to apply to the system vm""" + """Required""" + self.serviceofferingid = None + self.required = ["id","serviceofferingid",] + +class changeServiceForSystemVmResponse (baseResponse): + def __init__(self): + """the ID of the system VM""" + self.id = None + """the number of active console sessions for the console proxy system vm""" + self.activeviewersessions = None + """the date and time the system VM was created""" + self.created = None + """the first DNS for the system VM""" + self.dns1 = None + """the second DNS for the system VM""" + self.dns2 = None + """the gateway for the system VM""" + self.gateway = None + """the host ID for the system VM""" + self.hostid = None + """the hostname for the system VM""" + self.hostname = None + """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobid = None + """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobstatus = None + """the link local IP address for the system vm""" + self.linklocalip = None + """the link local MAC address for the system vm""" + self.linklocalmacaddress = None + """the link local netmask for the system vm""" + self.linklocalnetmask = None + """the name of the system VM""" + self.name = None + """the network domain for the system VM""" + self.networkdomain = None + """the Pod ID for the system VM""" + self.podid = None + """the private IP address for the system VM""" + self.privateip = None + """the private MAC address for the system VM""" + self.privatemacaddress = None + """the private netmask for the system VM""" + self.privatenetmask = None + """the public IP address for the system VM""" + self.publicip = None + """the public MAC address for the system VM""" + self.publicmacaddress = None + """the public netmask for the system VM""" + self.publicnetmask = None + """the state of the system VM""" + self.state = None + """the system VM type""" + self.systemvmtype = None + """the template ID for the system VM""" + self.templateid = None + """the Zone ID for the system VM""" + self.zoneid = None + """the Zone name for the system VM""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForVirtualMachine.py new file mode 100644 index 00000000000..e0d2edeac4b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForVirtualMachine.py @@ -0,0 +1,372 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Changes the service offering for a virtual machine. The virtual machine must be in a "Stopped" state for this command to take effect.""" +from baseCmd import * +from baseResponse import * +class changeServiceForVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """The ID of the virtual machine""" + """Required""" + self.id = None + """the service offering ID to apply to the virtual machine""" + """Required""" + self.serviceofferingid = None + self.required = ["id","serviceofferingid",] + +class changeServiceForVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/cleanVMReservations.py b/tools/marvin/build/lib/marvin/cloudstackAPI/cleanVMReservations.py new file mode 100644 index 00000000000..89113e256ec --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/cleanVMReservations.py @@ -0,0 +1,33 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Cleanups VM reservations in the database.""" +from baseCmd import * +from baseResponse import * +class cleanVMReservationsCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + self.required = [] + +class cleanVMReservationsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/cloudstackAPIClient.py b/tools/marvin/build/lib/marvin/cloudstackAPI/cloudstackAPIClient.py new file mode 100644 index 00000000000..caa457ec2f0 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/cloudstackAPIClient.py @@ -0,0 +1,2513 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""Test Client for CloudStack API""" +import copy +from createAccount import createAccountResponse +from deleteAccount import deleteAccountResponse +from updateAccount import updateAccountResponse +from disableAccount import disableAccountResponse +from enableAccount import enableAccountResponse +from lockAccount import lockAccountResponse +from listAccounts import listAccountsResponse +from markDefaultZoneForAccount import markDefaultZoneForAccountResponse +from createUser import createUserResponse +from deleteUser import deleteUserResponse +from updateUser import updateUserResponse +from listUsers import listUsersResponse +from lockUser import lockUserResponse +from disableUser import disableUserResponse +from enableUser import enableUserResponse +from getUser import getUserResponse +from createDomain import createDomainResponse +from updateDomain import updateDomainResponse +from deleteDomain import deleteDomainResponse +from listDomains import listDomainsResponse +from listDomainChildren import listDomainChildrenResponse +from getCloudIdentifier import getCloudIdentifierResponse +from updateResourceLimit import updateResourceLimitResponse +from updateResourceCount import updateResourceCountResponse +from listResourceLimits import listResourceLimitsResponse +from deployVirtualMachine import deployVirtualMachineResponse +from destroyVirtualMachine import destroyVirtualMachineResponse +from rebootVirtualMachine import rebootVirtualMachineResponse +from startVirtualMachine import startVirtualMachineResponse +from stopVirtualMachine import stopVirtualMachineResponse +from resetPasswordForVirtualMachine import resetPasswordForVirtualMachineResponse +from resetSSHKeyForVirtualMachine import resetSSHKeyForVirtualMachineResponse +from updateVirtualMachine import updateVirtualMachineResponse +from listVirtualMachines import listVirtualMachinesResponse +from getVMPassword import getVMPasswordResponse +from restoreVirtualMachine import restoreVirtualMachineResponse +from changeServiceForVirtualMachine import changeServiceForVirtualMachineResponse +from scaleVirtualMachine import scaleVirtualMachineResponse +from assignVirtualMachine import assignVirtualMachineResponse +from migrateVirtualMachine import migrateVirtualMachineResponse +from migrateVirtualMachineWithVolume import migrateVirtualMachineWithVolumeResponse +from recoverVirtualMachine import recoverVirtualMachineResponse +from createSnapshot import createSnapshotResponse +from listSnapshots import listSnapshotsResponse +from deleteSnapshot import deleteSnapshotResponse +from createSnapshotPolicy import createSnapshotPolicyResponse +from deleteSnapshotPolicies import deleteSnapshotPoliciesResponse +from listSnapshotPolicies import listSnapshotPoliciesResponse +from revertSnapshot import revertSnapshotResponse +from createTemplate import createTemplateResponse +from registerTemplate import registerTemplateResponse +from updateTemplate import updateTemplateResponse +from copyTemplate import copyTemplateResponse +from deleteTemplate import deleteTemplateResponse +from listTemplates import listTemplatesResponse +from updateTemplatePermissions import updateTemplatePermissionsResponse +from listTemplatePermissions import listTemplatePermissionsResponse +from extractTemplate import extractTemplateResponse +from prepareTemplate import prepareTemplateResponse +from attachIso import attachIsoResponse +from detachIso import detachIsoResponse +from listIsos import listIsosResponse +from registerIso import registerIsoResponse +from updateIso import updateIsoResponse +from deleteIso import deleteIsoResponse +from copyIso import copyIsoResponse +from updateIsoPermissions import updateIsoPermissionsResponse +from listIsoPermissions import listIsoPermissionsResponse +from extractIso import extractIsoResponse +from listOsTypes import listOsTypesResponse +from listOsCategories import listOsCategoriesResponse +from createServiceOffering import createServiceOfferingResponse +from deleteServiceOffering import deleteServiceOfferingResponse +from updateServiceOffering import updateServiceOfferingResponse +from listServiceOfferings import listServiceOfferingsResponse +from createDiskOffering import createDiskOfferingResponse +from updateDiskOffering import updateDiskOfferingResponse +from deleteDiskOffering import deleteDiskOfferingResponse +from listDiskOfferings import listDiskOfferingsResponse +from createVlanIpRange import createVlanIpRangeResponse +from deleteVlanIpRange import deleteVlanIpRangeResponse +from listVlanIpRanges import listVlanIpRangesResponse +from dedicatePublicIpRange import dedicatePublicIpRangeResponse +from releasePublicIpRange import releasePublicIpRangeResponse +from dedicateGuestVlanRange import dedicateGuestVlanRangeResponse +from releaseDedicatedGuestVlanRange import releaseDedicatedGuestVlanRangeResponse +from listDedicatedGuestVlanRanges import listDedicatedGuestVlanRangesResponse +from associateIpAddress import associateIpAddressResponse +from disassociateIpAddress import disassociateIpAddressResponse +from listPublicIpAddresses import listPublicIpAddressesResponse +from listPortForwardingRules import listPortForwardingRulesResponse +from createPortForwardingRule import createPortForwardingRuleResponse +from deletePortForwardingRule import deletePortForwardingRuleResponse +from updatePortForwardingRule import updatePortForwardingRuleResponse +from enableStaticNat import enableStaticNatResponse +from createIpForwardingRule import createIpForwardingRuleResponse +from deleteIpForwardingRule import deleteIpForwardingRuleResponse +from listIpForwardingRules import listIpForwardingRulesResponse +from disableStaticNat import disableStaticNatResponse +from createLoadBalancerRule import createLoadBalancerRuleResponse +from deleteLoadBalancerRule import deleteLoadBalancerRuleResponse +from removeFromLoadBalancerRule import removeFromLoadBalancerRuleResponse +from assignToLoadBalancerRule import assignToLoadBalancerRuleResponse +from createLBStickinessPolicy import createLBStickinessPolicyResponse +from deleteLBStickinessPolicy import deleteLBStickinessPolicyResponse +from listLoadBalancerRules import listLoadBalancerRulesResponse +from listLBStickinessPolicies import listLBStickinessPoliciesResponse +from listLBHealthCheckPolicies import listLBHealthCheckPoliciesResponse +from createLBHealthCheckPolicy import createLBHealthCheckPolicyResponse +from deleteLBHealthCheckPolicy import deleteLBHealthCheckPolicyResponse +from listLoadBalancerRuleInstances import listLoadBalancerRuleInstancesResponse +from updateLoadBalancerRule import updateLoadBalancerRuleResponse +from createCounter import createCounterResponse +from createCondition import createConditionResponse +from createAutoScalePolicy import createAutoScalePolicyResponse +from createAutoScaleVmProfile import createAutoScaleVmProfileResponse +from createAutoScaleVmGroup import createAutoScaleVmGroupResponse +from deleteCounter import deleteCounterResponse +from deleteCondition import deleteConditionResponse +from deleteAutoScalePolicy import deleteAutoScalePolicyResponse +from deleteAutoScaleVmProfile import deleteAutoScaleVmProfileResponse +from deleteAutoScaleVmGroup import deleteAutoScaleVmGroupResponse +from listCounters import listCountersResponse +from listConditions import listConditionsResponse +from listAutoScalePolicies import listAutoScalePoliciesResponse +from listAutoScaleVmProfiles import listAutoScaleVmProfilesResponse +from listAutoScaleVmGroups import listAutoScaleVmGroupsResponse +from enableAutoScaleVmGroup import enableAutoScaleVmGroupResponse +from disableAutoScaleVmGroup import disableAutoScaleVmGroupResponse +from updateAutoScalePolicy import updateAutoScalePolicyResponse +from updateAutoScaleVmProfile import updateAutoScaleVmProfileResponse +from updateAutoScaleVmGroup import updateAutoScaleVmGroupResponse +from startRouter import startRouterResponse +from rebootRouter import rebootRouterResponse +from stopRouter import stopRouterResponse +from destroyRouter import destroyRouterResponse +from changeServiceForRouter import changeServiceForRouterResponse +from listRouters import listRoutersResponse +from listVirtualRouterElements import listVirtualRouterElementsResponse +from configureVirtualRouterElement import configureVirtualRouterElementResponse +from createVirtualRouterElement import createVirtualRouterElementResponse +from startSystemVm import startSystemVmResponse +from rebootSystemVm import rebootSystemVmResponse +from stopSystemVm import stopSystemVmResponse +from destroySystemVm import destroySystemVmResponse +from listSystemVms import listSystemVmsResponse +from migrateSystemVm import migrateSystemVmResponse +from changeServiceForSystemVm import changeServiceForSystemVmResponse +from scaleSystemVm import scaleSystemVmResponse +from updateConfiguration import updateConfigurationResponse +from listConfigurations import listConfigurationsResponse +from listCapabilities import listCapabilitiesResponse +from listDeploymentPlanners import listDeploymentPlannersResponse +from cleanVMReservations import cleanVMReservationsResponse +from createPod import createPodResponse +from updatePod import updatePodResponse +from deletePod import deletePodResponse +from listPods import listPodsResponse +from createZone import createZoneResponse +from updateZone import updateZoneResponse +from deleteZone import deleteZoneResponse +from listZones import listZonesResponse +from listEvents import listEventsResponse +from listEventTypes import listEventTypesResponse +from archiveEvents import archiveEventsResponse +from deleteEvents import deleteEventsResponse +from listAlerts import listAlertsResponse +from archiveAlerts import archiveAlertsResponse +from deleteAlerts import deleteAlertsResponse +from listCapacity import listCapacityResponse +from addSwift import addSwiftResponse +from listSwifts import listSwiftsResponse +from addS3 import addS3Response +from listS3s import listS3sResponse +from addImageStore import addImageStoreResponse +from listImageStores import listImageStoresResponse +from deleteImageStore import deleteImageStoreResponse +from createSecondaryStagingStore import createSecondaryStagingStoreResponse +from listSecondaryStagingStores import listSecondaryStagingStoresResponse +from deleteSecondaryStagingStore import deleteSecondaryStagingStoreResponse +from addHost import addHostResponse +from addCluster import addClusterResponse +from deleteCluster import deleteClusterResponse +from updateCluster import updateClusterResponse +from reconnectHost import reconnectHostResponse +from updateHost import updateHostResponse +from deleteHost import deleteHostResponse +from prepareHostForMaintenance import prepareHostForMaintenanceResponse +from cancelHostMaintenance import cancelHostMaintenanceResponse +from listHosts import listHostsResponse +from findHostsForMigration import findHostsForMigrationResponse +from addSecondaryStorage import addSecondaryStorageResponse +from updateHostPassword import updateHostPasswordResponse +from releaseHostReservation import releaseHostReservationResponse +from attachVolume import attachVolumeResponse +from uploadVolume import uploadVolumeResponse +from detachVolume import detachVolumeResponse +from createVolume import createVolumeResponse +from deleteVolume import deleteVolumeResponse +from listVolumes import listVolumesResponse +from extractVolume import extractVolumeResponse +from migrateVolume import migrateVolumeResponse +from resizeVolume import resizeVolumeResponse +from updateVolume import updateVolumeResponse +from registerUserKeys import registerUserKeysResponse +from queryAsyncJobResult import queryAsyncJobResultResponse +from listAsyncJobs import listAsyncJobsResponse +from listStoragePools import listStoragePoolsResponse +from listStorageProviders import listStorageProvidersResponse +from createStoragePool import createStoragePoolResponse +from updateStoragePool import updateStoragePoolResponse +from deleteStoragePool import deleteStoragePoolResponse +from listClusters import listClustersResponse +from enableStorageMaintenance import enableStorageMaintenanceResponse +from cancelStorageMaintenance import cancelStorageMaintenanceResponse +from findStoragePoolsForMigration import findStoragePoolsForMigrationResponse +from createSecurityGroup import createSecurityGroupResponse +from deleteSecurityGroup import deleteSecurityGroupResponse +from authorizeSecurityGroupIngress import authorizeSecurityGroupIngressResponse +from revokeSecurityGroupIngress import revokeSecurityGroupIngressResponse +from authorizeSecurityGroupEgress import authorizeSecurityGroupEgressResponse +from revokeSecurityGroupEgress import revokeSecurityGroupEgressResponse +from listSecurityGroups import listSecurityGroupsResponse +from createInstanceGroup import createInstanceGroupResponse +from deleteInstanceGroup import deleteInstanceGroupResponse +from updateInstanceGroup import updateInstanceGroupResponse +from listInstanceGroups import listInstanceGroupsResponse +from uploadCustomCertificate import uploadCustomCertificateResponse +from listHypervisors import listHypervisorsResponse +from createRemoteAccessVpn import createRemoteAccessVpnResponse +from deleteRemoteAccessVpn import deleteRemoteAccessVpnResponse +from listRemoteAccessVpns import listRemoteAccessVpnsResponse +from addVpnUser import addVpnUserResponse +from removeVpnUser import removeVpnUserResponse +from listVpnUsers import listVpnUsersResponse +from createNetworkOffering import createNetworkOfferingResponse +from updateNetworkOffering import updateNetworkOfferingResponse +from deleteNetworkOffering import deleteNetworkOfferingResponse +from listNetworkOfferings import listNetworkOfferingsResponse +from createNetwork import createNetworkResponse +from deleteNetwork import deleteNetworkResponse +from listNetworks import listNetworksResponse +from restartNetwork import restartNetworkResponse +from updateNetwork import updateNetworkResponse +from addNicToVirtualMachine import addNicToVirtualMachineResponse +from removeNicFromVirtualMachine import removeNicFromVirtualMachineResponse +from updateDefaultNicForVirtualMachine import updateDefaultNicForVirtualMachineResponse +from addIpToNic import addIpToNicResponse +from removeIpFromNic import removeIpFromNicResponse +from listNics import listNicsResponse +from registerSSHKeyPair import registerSSHKeyPairResponse +from createSSHKeyPair import createSSHKeyPairResponse +from deleteSSHKeyPair import deleteSSHKeyPairResponse +from listSSHKeyPairs import listSSHKeyPairsResponse +from createProject import createProjectResponse +from deleteProject import deleteProjectResponse +from updateProject import updateProjectResponse +from activateProject import activateProjectResponse +from suspendProject import suspendProjectResponse +from listProjects import listProjectsResponse +from addAccountToProject import addAccountToProjectResponse +from deleteAccountFromProject import deleteAccountFromProjectResponse +from listProjectAccounts import listProjectAccountsResponse +from listProjectInvitations import listProjectInvitationsResponse +from updateProjectInvitation import updateProjectInvitationResponse +from deleteProjectInvitation import deleteProjectInvitationResponse +from createFirewallRule import createFirewallRuleResponse +from deleteFirewallRule import deleteFirewallRuleResponse +from listFirewallRules import listFirewallRulesResponse +from createEgressFirewallRule import createEgressFirewallRuleResponse +from deleteEgressFirewallRule import deleteEgressFirewallRuleResponse +from listEgressFirewallRules import listEgressFirewallRulesResponse +from updateHypervisorCapabilities import updateHypervisorCapabilitiesResponse +from listHypervisorCapabilities import listHypervisorCapabilitiesResponse +from createPhysicalNetwork import createPhysicalNetworkResponse +from deletePhysicalNetwork import deletePhysicalNetworkResponse +from listPhysicalNetworks import listPhysicalNetworksResponse +from updatePhysicalNetwork import updatePhysicalNetworkResponse +from listSupportedNetworkServices import listSupportedNetworkServicesResponse +from addNetworkServiceProvider import addNetworkServiceProviderResponse +from deleteNetworkServiceProvider import deleteNetworkServiceProviderResponse +from listNetworkServiceProviders import listNetworkServiceProvidersResponse +from updateNetworkServiceProvider import updateNetworkServiceProviderResponse +from addTrafficType import addTrafficTypeResponse +from deleteTrafficType import deleteTrafficTypeResponse +from listTrafficTypes import listTrafficTypesResponse +from updateTrafficType import updateTrafficTypeResponse +from listTrafficTypeImplementors import listTrafficTypeImplementorsResponse +from createStorageNetworkIpRange import createStorageNetworkIpRangeResponse +from deleteStorageNetworkIpRange import deleteStorageNetworkIpRangeResponse +from listStorageNetworkIpRange import listStorageNetworkIpRangeResponse +from updateStorageNetworkIpRange import updateStorageNetworkIpRangeResponse +from addNetworkDevice import addNetworkDeviceResponse +from listNetworkDevice import listNetworkDeviceResponse +from deleteNetworkDevice import deleteNetworkDeviceResponse +from createVPC import createVPCResponse +from listVPCs import listVPCsResponse +from deleteVPC import deleteVPCResponse +from updateVPC import updateVPCResponse +from restartVPC import restartVPCResponse +from createVPCOffering import createVPCOfferingResponse +from updateVPCOffering import updateVPCOfferingResponse +from deleteVPCOffering import deleteVPCOfferingResponse +from listVPCOfferings import listVPCOfferingsResponse +from createPrivateGateway import createPrivateGatewayResponse +from listPrivateGateways import listPrivateGatewaysResponse +from deletePrivateGateway import deletePrivateGatewayResponse +from createNetworkACL import createNetworkACLResponse +from updateNetworkACLItem import updateNetworkACLItemResponse +from deleteNetworkACL import deleteNetworkACLResponse +from listNetworkACLs import listNetworkACLsResponse +from createNetworkACLList import createNetworkACLListResponse +from deleteNetworkACLList import deleteNetworkACLListResponse +from replaceNetworkACLList import replaceNetworkACLListResponse +from listNetworkACLLists import listNetworkACLListsResponse +from createStaticRoute import createStaticRouteResponse +from deleteStaticRoute import deleteStaticRouteResponse +from listStaticRoutes import listStaticRoutesResponse +from createTags import createTagsResponse +from deleteTags import deleteTagsResponse +from listTags import listTagsResponse +from addResourceDetail import addResourceDetailResponse +from removeResourceDetail import removeResourceDetailResponse +from listResourceDetails import listResourceDetailsResponse +from createVpnCustomerGateway import createVpnCustomerGatewayResponse +from createVpnGateway import createVpnGatewayResponse +from createVpnConnection import createVpnConnectionResponse +from deleteVpnCustomerGateway import deleteVpnCustomerGatewayResponse +from deleteVpnGateway import deleteVpnGatewayResponse +from deleteVpnConnection import deleteVpnConnectionResponse +from updateVpnCustomerGateway import updateVpnCustomerGatewayResponse +from resetVpnConnection import resetVpnConnectionResponse +from listVpnCustomerGateways import listVpnCustomerGatewaysResponse +from listVpnGateways import listVpnGatewaysResponse +from listVpnConnections import listVpnConnectionsResponse +from generateUsageRecords import generateUsageRecordsResponse +from listUsageRecords import listUsageRecordsResponse +from listUsageTypes import listUsageTypesResponse +from addTrafficMonitor import addTrafficMonitorResponse +from deleteTrafficMonitor import deleteTrafficMonitorResponse +from listTrafficMonitors import listTrafficMonitorsResponse +from addNiciraNvpDevice import addNiciraNvpDeviceResponse +from deleteNiciraNvpDevice import deleteNiciraNvpDeviceResponse +from listNiciraNvpDevices import listNiciraNvpDevicesResponse +from listNiciraNvpDeviceNetworks import listNiciraNvpDeviceNetworksResponse +from addBigSwitchVnsDevice import addBigSwitchVnsDeviceResponse +from deleteBigSwitchVnsDevice import deleteBigSwitchVnsDeviceResponse +from listBigSwitchVnsDevices import listBigSwitchVnsDevicesResponse +from listApis import listApisResponse +from getApiLimit import getApiLimitResponse +from resetApiLimit import resetApiLimitResponse +from addRegion import addRegionResponse +from updateRegion import updateRegionResponse +from removeRegion import removeRegionResponse +from listRegions import listRegionsResponse +from createGlobalLoadBalancerRule import createGlobalLoadBalancerRuleResponse +from deleteGlobalLoadBalancerRule import deleteGlobalLoadBalancerRuleResponse +from updateGlobalLoadBalancerRule import updateGlobalLoadBalancerRuleResponse +from listGlobalLoadBalancerRules import listGlobalLoadBalancerRulesResponse +from assignToGlobalLoadBalancerRule import assignToGlobalLoadBalancerRuleResponse +from removeFromGlobalLoadBalancerRule import removeFromGlobalLoadBalancerRuleResponse +from listVMSnapshot import listVMSnapshotResponse +from createVMSnapshot import createVMSnapshotResponse +from deleteVMSnapshot import deleteVMSnapshotResponse +from revertToVMSnapshot import revertToVMSnapshotResponse +from addBaremetalHost import addBaremetalHostResponse +from addBaremetalPxeKickStartServer import addBaremetalPxeKickStartServerResponse +from addBaremetalPxePingServer import addBaremetalPxePingServerResponse +from addBaremetalDhcp import addBaremetalDhcpResponse +from listBaremetalDhcp import listBaremetalDhcpResponse +from listBaremetalPxeServers import listBaremetalPxeServersResponse +from addUcsManager import addUcsManagerResponse +from listUcsManagers import listUcsManagersResponse +from listUcsProfiles import listUcsProfilesResponse +from listUcsBlades import listUcsBladesResponse +from associateUcsProfileToBlade import associateUcsProfileToBladeResponse +from createLoadBalancer import createLoadBalancerResponse +from listLoadBalancers import listLoadBalancersResponse +from deleteLoadBalancer import deleteLoadBalancerResponse +from configureInternalLoadBalancerElement import configureInternalLoadBalancerElementResponse +from createInternalLoadBalancerElement import createInternalLoadBalancerElementResponse +from listInternalLoadBalancerElements import listInternalLoadBalancerElementsResponse +from createAffinityGroup import createAffinityGroupResponse +from deleteAffinityGroup import deleteAffinityGroupResponse +from listAffinityGroups import listAffinityGroupsResponse +from updateVMAffinityGroup import updateVMAffinityGroupResponse +from listAffinityGroupTypes import listAffinityGroupTypesResponse +from createPortableIpRange import createPortableIpRangeResponse +from deletePortableIpRange import deletePortableIpRangeResponse +from listPortableIpRanges import listPortableIpRangesResponse +from stopInternalLoadBalancerVM import stopInternalLoadBalancerVMResponse +from startInternalLoadBalancerVM import startInternalLoadBalancerVMResponse +from listInternalLoadBalancerVMs import listInternalLoadBalancerVMsResponse +from listNetworkIsolationMethods import listNetworkIsolationMethodsResponse +from dedicateZone import dedicateZoneResponse +from dedicatePod import dedicatePodResponse +from dedicateCluster import dedicateClusterResponse +from dedicateHost import dedicateHostResponse +from releaseDedicatedZone import releaseDedicatedZoneResponse +from releaseDedicatedPod import releaseDedicatedPodResponse +from releaseDedicatedCluster import releaseDedicatedClusterResponse +from releaseDedicatedHost import releaseDedicatedHostResponse +from listDedicatedZones import listDedicatedZonesResponse +from listDedicatedPods import listDedicatedPodsResponse +from listDedicatedClusters import listDedicatedClustersResponse +from listDedicatedHosts import listDedicatedHostsResponse +from listLdapConfigurations import listLdapConfigurationsResponse +from addLdapConfiguration import addLdapConfigurationResponse +from deleteLdapConfiguration import deleteLdapConfigurationResponse +from listLdapUsers import listLdapUsersResponse +from ldapCreateAccount import ldapCreateAccountResponse +from login import loginResponse +from logout import logoutResponse +class CloudStackAPIClient(object): + def __init__(self, connection): + self.connection = connection + self._id = None + + def __copy__(self): + return CloudStackAPIClient(copy.copy(self.connection)) + + @property + def id(self): + return self._id + + @id.setter + def id(self, identifier): + self._id = identifier + + def createAccount(self, command, method="GET"): + response = createAccountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteAccount(self, command, method="GET"): + response = deleteAccountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateAccount(self, command, method="GET"): + response = updateAccountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def disableAccount(self, command, method="GET"): + response = disableAccountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def enableAccount(self, command, method="GET"): + response = enableAccountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def lockAccount(self, command, method="GET"): + response = lockAccountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listAccounts(self, command, method="GET"): + response = listAccountsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def markDefaultZoneForAccount(self, command, method="GET"): + response = markDefaultZoneForAccountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createUser(self, command, method="GET"): + response = createUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteUser(self, command, method="GET"): + response = deleteUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateUser(self, command, method="GET"): + response = updateUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listUsers(self, command, method="GET"): + response = listUsersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def lockUser(self, command, method="GET"): + response = lockUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def disableUser(self, command, method="GET"): + response = disableUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def enableUser(self, command, method="GET"): + response = enableUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def getUser(self, command, method="GET"): + response = getUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createDomain(self, command, method="GET"): + response = createDomainResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateDomain(self, command, method="GET"): + response = updateDomainResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteDomain(self, command, method="GET"): + response = deleteDomainResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDomains(self, command, method="GET"): + response = listDomainsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDomainChildren(self, command, method="GET"): + response = listDomainChildrenResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def getCloudIdentifier(self, command, method="GET"): + response = getCloudIdentifierResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateResourceLimit(self, command, method="GET"): + response = updateResourceLimitResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateResourceCount(self, command, method="GET"): + response = updateResourceCountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listResourceLimits(self, command, method="GET"): + response = listResourceLimitsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deployVirtualMachine(self, command, method="GET"): + response = deployVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def destroyVirtualMachine(self, command, method="GET"): + response = destroyVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def rebootVirtualMachine(self, command, method="GET"): + response = rebootVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def startVirtualMachine(self, command, method="GET"): + response = startVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def stopVirtualMachine(self, command, method="GET"): + response = stopVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def resetPasswordForVirtualMachine(self, command, method="GET"): + response = resetPasswordForVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def resetSSHKeyForVirtualMachine(self, command, method="GET"): + response = resetSSHKeyForVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateVirtualMachine(self, command, method="GET"): + response = updateVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVirtualMachines(self, command, method="GET"): + response = listVirtualMachinesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def getVMPassword(self, command, method="GET"): + response = getVMPasswordResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def restoreVirtualMachine(self, command, method="GET"): + response = restoreVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def changeServiceForVirtualMachine(self, command, method="GET"): + response = changeServiceForVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def scaleVirtualMachine(self, command, method="GET"): + response = scaleVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def assignVirtualMachine(self, command, method="GET"): + response = assignVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def migrateVirtualMachine(self, command, method="GET"): + response = migrateVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def migrateVirtualMachineWithVolume(self, command, method="GET"): + response = migrateVirtualMachineWithVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def recoverVirtualMachine(self, command, method="GET"): + response = recoverVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createSnapshot(self, command, method="GET"): + response = createSnapshotResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listSnapshots(self, command, method="GET"): + response = listSnapshotsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteSnapshot(self, command, method="GET"): + response = deleteSnapshotResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createSnapshotPolicy(self, command, method="GET"): + response = createSnapshotPolicyResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteSnapshotPolicies(self, command, method="GET"): + response = deleteSnapshotPoliciesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listSnapshotPolicies(self, command, method="GET"): + response = listSnapshotPoliciesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def revertSnapshot(self, command, method="GET"): + response = revertSnapshotResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createTemplate(self, command, method="GET"): + response = createTemplateResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def registerTemplate(self, command, method="GET"): + response = registerTemplateResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateTemplate(self, command, method="GET"): + response = updateTemplateResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def copyTemplate(self, command, method="GET"): + response = copyTemplateResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteTemplate(self, command, method="GET"): + response = deleteTemplateResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listTemplates(self, command, method="GET"): + response = listTemplatesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateTemplatePermissions(self, command, method="GET"): + response = updateTemplatePermissionsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listTemplatePermissions(self, command, method="GET"): + response = listTemplatePermissionsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def extractTemplate(self, command, method="GET"): + response = extractTemplateResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def prepareTemplate(self, command, method="GET"): + response = prepareTemplateResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def attachIso(self, command, method="GET"): + response = attachIsoResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def detachIso(self, command, method="GET"): + response = detachIsoResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listIsos(self, command, method="GET"): + response = listIsosResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def registerIso(self, command, method="GET"): + response = registerIsoResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateIso(self, command, method="GET"): + response = updateIsoResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteIso(self, command, method="GET"): + response = deleteIsoResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def copyIso(self, command, method="GET"): + response = copyIsoResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateIsoPermissions(self, command, method="GET"): + response = updateIsoPermissionsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listIsoPermissions(self, command, method="GET"): + response = listIsoPermissionsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def extractIso(self, command, method="GET"): + response = extractIsoResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listOsTypes(self, command, method="GET"): + response = listOsTypesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listOsCategories(self, command, method="GET"): + response = listOsCategoriesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createServiceOffering(self, command, method="GET"): + response = createServiceOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteServiceOffering(self, command, method="GET"): + response = deleteServiceOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateServiceOffering(self, command, method="GET"): + response = updateServiceOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listServiceOfferings(self, command, method="GET"): + response = listServiceOfferingsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createDiskOffering(self, command, method="GET"): + response = createDiskOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateDiskOffering(self, command, method="GET"): + response = updateDiskOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteDiskOffering(self, command, method="GET"): + response = deleteDiskOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDiskOfferings(self, command, method="GET"): + response = listDiskOfferingsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVlanIpRange(self, command, method="GET"): + response = createVlanIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteVlanIpRange(self, command, method="GET"): + response = deleteVlanIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVlanIpRanges(self, command, method="GET"): + response = listVlanIpRangesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def dedicatePublicIpRange(self, command, method="GET"): + response = dedicatePublicIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def releasePublicIpRange(self, command, method="GET"): + response = releasePublicIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def dedicateGuestVlanRange(self, command, method="GET"): + response = dedicateGuestVlanRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def releaseDedicatedGuestVlanRange(self, command, method="GET"): + response = releaseDedicatedGuestVlanRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDedicatedGuestVlanRanges(self, command, method="GET"): + response = listDedicatedGuestVlanRangesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def associateIpAddress(self, command, method="GET"): + response = associateIpAddressResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def disassociateIpAddress(self, command, method="GET"): + response = disassociateIpAddressResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listPublicIpAddresses(self, command, method="GET"): + response = listPublicIpAddressesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listPortForwardingRules(self, command, method="GET"): + response = listPortForwardingRulesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createPortForwardingRule(self, command, method="GET"): + response = createPortForwardingRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deletePortForwardingRule(self, command, method="GET"): + response = deletePortForwardingRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updatePortForwardingRule(self, command, method="GET"): + response = updatePortForwardingRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def enableStaticNat(self, command, method="GET"): + response = enableStaticNatResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createIpForwardingRule(self, command, method="GET"): + response = createIpForwardingRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteIpForwardingRule(self, command, method="GET"): + response = deleteIpForwardingRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listIpForwardingRules(self, command, method="GET"): + response = listIpForwardingRulesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def disableStaticNat(self, command, method="GET"): + response = disableStaticNatResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createLoadBalancerRule(self, command, method="GET"): + response = createLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteLoadBalancerRule(self, command, method="GET"): + response = deleteLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def removeFromLoadBalancerRule(self, command, method="GET"): + response = removeFromLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def assignToLoadBalancerRule(self, command, method="GET"): + response = assignToLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createLBStickinessPolicy(self, command, method="GET"): + response = createLBStickinessPolicyResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteLBStickinessPolicy(self, command, method="GET"): + response = deleteLBStickinessPolicyResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listLoadBalancerRules(self, command, method="GET"): + response = listLoadBalancerRulesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listLBStickinessPolicies(self, command, method="GET"): + response = listLBStickinessPoliciesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listLBHealthCheckPolicies(self, command, method="GET"): + response = listLBHealthCheckPoliciesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createLBHealthCheckPolicy(self, command, method="GET"): + response = createLBHealthCheckPolicyResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteLBHealthCheckPolicy(self, command, method="GET"): + response = deleteLBHealthCheckPolicyResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listLoadBalancerRuleInstances(self, command, method="GET"): + response = listLoadBalancerRuleInstancesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateLoadBalancerRule(self, command, method="GET"): + response = updateLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createCounter(self, command, method="GET"): + response = createCounterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createCondition(self, command, method="GET"): + response = createConditionResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createAutoScalePolicy(self, command, method="GET"): + response = createAutoScalePolicyResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createAutoScaleVmProfile(self, command, method="GET"): + response = createAutoScaleVmProfileResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createAutoScaleVmGroup(self, command, method="GET"): + response = createAutoScaleVmGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteCounter(self, command, method="GET"): + response = deleteCounterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteCondition(self, command, method="GET"): + response = deleteConditionResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteAutoScalePolicy(self, command, method="GET"): + response = deleteAutoScalePolicyResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteAutoScaleVmProfile(self, command, method="GET"): + response = deleteAutoScaleVmProfileResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteAutoScaleVmGroup(self, command, method="GET"): + response = deleteAutoScaleVmGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listCounters(self, command, method="GET"): + response = listCountersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listConditions(self, command, method="GET"): + response = listConditionsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listAutoScalePolicies(self, command, method="GET"): + response = listAutoScalePoliciesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listAutoScaleVmProfiles(self, command, method="GET"): + response = listAutoScaleVmProfilesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listAutoScaleVmGroups(self, command, method="GET"): + response = listAutoScaleVmGroupsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def enableAutoScaleVmGroup(self, command, method="GET"): + response = enableAutoScaleVmGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def disableAutoScaleVmGroup(self, command, method="GET"): + response = disableAutoScaleVmGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateAutoScalePolicy(self, command, method="GET"): + response = updateAutoScalePolicyResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateAutoScaleVmProfile(self, command, method="GET"): + response = updateAutoScaleVmProfileResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateAutoScaleVmGroup(self, command, method="GET"): + response = updateAutoScaleVmGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def startRouter(self, command, method="GET"): + response = startRouterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def rebootRouter(self, command, method="GET"): + response = rebootRouterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def stopRouter(self, command, method="GET"): + response = stopRouterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def destroyRouter(self, command, method="GET"): + response = destroyRouterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def changeServiceForRouter(self, command, method="GET"): + response = changeServiceForRouterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listRouters(self, command, method="GET"): + response = listRoutersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVirtualRouterElements(self, command, method="GET"): + response = listVirtualRouterElementsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def configureVirtualRouterElement(self, command, method="GET"): + response = configureVirtualRouterElementResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVirtualRouterElement(self, command, method="GET"): + response = createVirtualRouterElementResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def startSystemVm(self, command, method="GET"): + response = startSystemVmResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def rebootSystemVm(self, command, method="GET"): + response = rebootSystemVmResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def stopSystemVm(self, command, method="GET"): + response = stopSystemVmResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def destroySystemVm(self, command, method="GET"): + response = destroySystemVmResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listSystemVms(self, command, method="GET"): + response = listSystemVmsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def migrateSystemVm(self, command, method="GET"): + response = migrateSystemVmResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def changeServiceForSystemVm(self, command, method="GET"): + response = changeServiceForSystemVmResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def scaleSystemVm(self, command, method="GET"): + response = scaleSystemVmResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateConfiguration(self, command, method="GET"): + response = updateConfigurationResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listConfigurations(self, command, method="GET"): + response = listConfigurationsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listCapabilities(self, command, method="GET"): + response = listCapabilitiesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDeploymentPlanners(self, command, method="GET"): + response = listDeploymentPlannersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def cleanVMReservations(self, command, method="GET"): + response = cleanVMReservationsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createPod(self, command, method="GET"): + response = createPodResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updatePod(self, command, method="GET"): + response = updatePodResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deletePod(self, command, method="GET"): + response = deletePodResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listPods(self, command, method="GET"): + response = listPodsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createZone(self, command, method="GET"): + response = createZoneResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateZone(self, command, method="GET"): + response = updateZoneResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteZone(self, command, method="GET"): + response = deleteZoneResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listZones(self, command, method="GET"): + response = listZonesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listEvents(self, command, method="GET"): + response = listEventsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listEventTypes(self, command, method="GET"): + response = listEventTypesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def archiveEvents(self, command, method="GET"): + response = archiveEventsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteEvents(self, command, method="GET"): + response = deleteEventsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listAlerts(self, command, method="GET"): + response = listAlertsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def archiveAlerts(self, command, method="GET"): + response = archiveAlertsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteAlerts(self, command, method="GET"): + response = deleteAlertsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listCapacity(self, command, method="GET"): + response = listCapacityResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addSwift(self, command, method="GET"): + response = addSwiftResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listSwifts(self, command, method="GET"): + response = listSwiftsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addS3(self, command, method="GET"): + response = addS3Response() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listS3s(self, command, method="GET"): + response = listS3sResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addImageStore(self, command, method="GET"): + response = addImageStoreResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listImageStores(self, command, method="GET"): + response = listImageStoresResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteImageStore(self, command, method="GET"): + response = deleteImageStoreResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createSecondaryStagingStore(self, command, method="GET"): + response = createSecondaryStagingStoreResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listSecondaryStagingStores(self, command, method="GET"): + response = listSecondaryStagingStoresResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteSecondaryStagingStore(self, command, method="GET"): + response = deleteSecondaryStagingStoreResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addHost(self, command, method="GET"): + response = addHostResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addCluster(self, command, method="GET"): + response = addClusterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteCluster(self, command, method="GET"): + response = deleteClusterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateCluster(self, command, method="GET"): + response = updateClusterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def reconnectHost(self, command, method="GET"): + response = reconnectHostResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateHost(self, command, method="GET"): + response = updateHostResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteHost(self, command, method="GET"): + response = deleteHostResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def prepareHostForMaintenance(self, command, method="GET"): + response = prepareHostForMaintenanceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def cancelHostMaintenance(self, command, method="GET"): + response = cancelHostMaintenanceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listHosts(self, command, method="GET"): + response = listHostsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def findHostsForMigration(self, command, method="GET"): + response = findHostsForMigrationResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addSecondaryStorage(self, command, method="GET"): + response = addSecondaryStorageResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateHostPassword(self, command, method="GET"): + response = updateHostPasswordResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def releaseHostReservation(self, command, method="GET"): + response = releaseHostReservationResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def attachVolume(self, command, method="GET"): + response = attachVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def uploadVolume(self, command, method="GET"): + response = uploadVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def detachVolume(self, command, method="GET"): + response = detachVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVolume(self, command, method="GET"): + response = createVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteVolume(self, command, method="GET"): + response = deleteVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVolumes(self, command, method="GET"): + response = listVolumesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def extractVolume(self, command, method="GET"): + response = extractVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def migrateVolume(self, command, method="GET"): + response = migrateVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def resizeVolume(self, command, method="GET"): + response = resizeVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateVolume(self, command, method="GET"): + response = updateVolumeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def registerUserKeys(self, command, method="GET"): + response = registerUserKeysResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def queryAsyncJobResult(self, command, method="GET"): + response = queryAsyncJobResultResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listAsyncJobs(self, command, method="GET"): + response = listAsyncJobsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listStoragePools(self, command, method="GET"): + response = listStoragePoolsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listStorageProviders(self, command, method="GET"): + response = listStorageProvidersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createStoragePool(self, command, method="GET"): + response = createStoragePoolResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateStoragePool(self, command, method="GET"): + response = updateStoragePoolResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteStoragePool(self, command, method="GET"): + response = deleteStoragePoolResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listClusters(self, command, method="GET"): + response = listClustersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def enableStorageMaintenance(self, command, method="GET"): + response = enableStorageMaintenanceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def cancelStorageMaintenance(self, command, method="GET"): + response = cancelStorageMaintenanceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def findStoragePoolsForMigration(self, command, method="GET"): + response = findStoragePoolsForMigrationResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createSecurityGroup(self, command, method="GET"): + response = createSecurityGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteSecurityGroup(self, command, method="GET"): + response = deleteSecurityGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def authorizeSecurityGroupIngress(self, command, method="GET"): + response = authorizeSecurityGroupIngressResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def revokeSecurityGroupIngress(self, command, method="GET"): + response = revokeSecurityGroupIngressResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def authorizeSecurityGroupEgress(self, command, method="GET"): + response = authorizeSecurityGroupEgressResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def revokeSecurityGroupEgress(self, command, method="GET"): + response = revokeSecurityGroupEgressResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listSecurityGroups(self, command, method="GET"): + response = listSecurityGroupsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createInstanceGroup(self, command, method="GET"): + response = createInstanceGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteInstanceGroup(self, command, method="GET"): + response = deleteInstanceGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateInstanceGroup(self, command, method="GET"): + response = updateInstanceGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listInstanceGroups(self, command, method="GET"): + response = listInstanceGroupsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def uploadCustomCertificate(self, command, method="GET"): + response = uploadCustomCertificateResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listHypervisors(self, command, method="GET"): + response = listHypervisorsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createRemoteAccessVpn(self, command, method="GET"): + response = createRemoteAccessVpnResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteRemoteAccessVpn(self, command, method="GET"): + response = deleteRemoteAccessVpnResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listRemoteAccessVpns(self, command, method="GET"): + response = listRemoteAccessVpnsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addVpnUser(self, command, method="GET"): + response = addVpnUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def removeVpnUser(self, command, method="GET"): + response = removeVpnUserResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVpnUsers(self, command, method="GET"): + response = listVpnUsersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createNetworkOffering(self, command, method="GET"): + response = createNetworkOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateNetworkOffering(self, command, method="GET"): + response = updateNetworkOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteNetworkOffering(self, command, method="GET"): + response = deleteNetworkOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNetworkOfferings(self, command, method="GET"): + response = listNetworkOfferingsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createNetwork(self, command, method="GET"): + response = createNetworkResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteNetwork(self, command, method="GET"): + response = deleteNetworkResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNetworks(self, command, method="GET"): + response = listNetworksResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def restartNetwork(self, command, method="GET"): + response = restartNetworkResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateNetwork(self, command, method="GET"): + response = updateNetworkResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addNicToVirtualMachine(self, command, method="GET"): + response = addNicToVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def removeNicFromVirtualMachine(self, command, method="GET"): + response = removeNicFromVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateDefaultNicForVirtualMachine(self, command, method="GET"): + response = updateDefaultNicForVirtualMachineResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addIpToNic(self, command, method="GET"): + response = addIpToNicResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def removeIpFromNic(self, command, method="GET"): + response = removeIpFromNicResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNics(self, command, method="GET"): + response = listNicsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def registerSSHKeyPair(self, command, method="GET"): + response = registerSSHKeyPairResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createSSHKeyPair(self, command, method="GET"): + response = createSSHKeyPairResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteSSHKeyPair(self, command, method="GET"): + response = deleteSSHKeyPairResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listSSHKeyPairs(self, command, method="GET"): + response = listSSHKeyPairsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createProject(self, command, method="GET"): + response = createProjectResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteProject(self, command, method="GET"): + response = deleteProjectResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateProject(self, command, method="GET"): + response = updateProjectResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def activateProject(self, command, method="GET"): + response = activateProjectResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def suspendProject(self, command, method="GET"): + response = suspendProjectResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listProjects(self, command, method="GET"): + response = listProjectsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addAccountToProject(self, command, method="GET"): + response = addAccountToProjectResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteAccountFromProject(self, command, method="GET"): + response = deleteAccountFromProjectResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listProjectAccounts(self, command, method="GET"): + response = listProjectAccountsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listProjectInvitations(self, command, method="GET"): + response = listProjectInvitationsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateProjectInvitation(self, command, method="GET"): + response = updateProjectInvitationResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteProjectInvitation(self, command, method="GET"): + response = deleteProjectInvitationResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createFirewallRule(self, command, method="GET"): + response = createFirewallRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteFirewallRule(self, command, method="GET"): + response = deleteFirewallRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listFirewallRules(self, command, method="GET"): + response = listFirewallRulesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createEgressFirewallRule(self, command, method="GET"): + response = createEgressFirewallRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteEgressFirewallRule(self, command, method="GET"): + response = deleteEgressFirewallRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listEgressFirewallRules(self, command, method="GET"): + response = listEgressFirewallRulesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateHypervisorCapabilities(self, command, method="GET"): + response = updateHypervisorCapabilitiesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listHypervisorCapabilities(self, command, method="GET"): + response = listHypervisorCapabilitiesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createPhysicalNetwork(self, command, method="GET"): + response = createPhysicalNetworkResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deletePhysicalNetwork(self, command, method="GET"): + response = deletePhysicalNetworkResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listPhysicalNetworks(self, command, method="GET"): + response = listPhysicalNetworksResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updatePhysicalNetwork(self, command, method="GET"): + response = updatePhysicalNetworkResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listSupportedNetworkServices(self, command, method="GET"): + response = listSupportedNetworkServicesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addNetworkServiceProvider(self, command, method="GET"): + response = addNetworkServiceProviderResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteNetworkServiceProvider(self, command, method="GET"): + response = deleteNetworkServiceProviderResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNetworkServiceProviders(self, command, method="GET"): + response = listNetworkServiceProvidersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateNetworkServiceProvider(self, command, method="GET"): + response = updateNetworkServiceProviderResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addTrafficType(self, command, method="GET"): + response = addTrafficTypeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteTrafficType(self, command, method="GET"): + response = deleteTrafficTypeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listTrafficTypes(self, command, method="GET"): + response = listTrafficTypesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateTrafficType(self, command, method="GET"): + response = updateTrafficTypeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listTrafficTypeImplementors(self, command, method="GET"): + response = listTrafficTypeImplementorsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createStorageNetworkIpRange(self, command, method="GET"): + response = createStorageNetworkIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteStorageNetworkIpRange(self, command, method="GET"): + response = deleteStorageNetworkIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listStorageNetworkIpRange(self, command, method="GET"): + response = listStorageNetworkIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateStorageNetworkIpRange(self, command, method="GET"): + response = updateStorageNetworkIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addNetworkDevice(self, command, method="GET"): + response = addNetworkDeviceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNetworkDevice(self, command, method="GET"): + response = listNetworkDeviceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteNetworkDevice(self, command, method="GET"): + response = deleteNetworkDeviceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVPC(self, command, method="GET"): + response = createVPCResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVPCs(self, command, method="GET"): + response = listVPCsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteVPC(self, command, method="GET"): + response = deleteVPCResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateVPC(self, command, method="GET"): + response = updateVPCResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def restartVPC(self, command, method="GET"): + response = restartVPCResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVPCOffering(self, command, method="GET"): + response = createVPCOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateVPCOffering(self, command, method="GET"): + response = updateVPCOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteVPCOffering(self, command, method="GET"): + response = deleteVPCOfferingResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVPCOfferings(self, command, method="GET"): + response = listVPCOfferingsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createPrivateGateway(self, command, method="GET"): + response = createPrivateGatewayResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listPrivateGateways(self, command, method="GET"): + response = listPrivateGatewaysResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deletePrivateGateway(self, command, method="GET"): + response = deletePrivateGatewayResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createNetworkACL(self, command, method="GET"): + response = createNetworkACLResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateNetworkACLItem(self, command, method="GET"): + response = updateNetworkACLItemResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteNetworkACL(self, command, method="GET"): + response = deleteNetworkACLResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNetworkACLs(self, command, method="GET"): + response = listNetworkACLsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createNetworkACLList(self, command, method="GET"): + response = createNetworkACLListResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteNetworkACLList(self, command, method="GET"): + response = deleteNetworkACLListResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def replaceNetworkACLList(self, command, method="GET"): + response = replaceNetworkACLListResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNetworkACLLists(self, command, method="GET"): + response = listNetworkACLListsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createStaticRoute(self, command, method="GET"): + response = createStaticRouteResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteStaticRoute(self, command, method="GET"): + response = deleteStaticRouteResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listStaticRoutes(self, command, method="GET"): + response = listStaticRoutesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createTags(self, command, method="GET"): + response = createTagsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteTags(self, command, method="GET"): + response = deleteTagsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listTags(self, command, method="GET"): + response = listTagsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addResourceDetail(self, command, method="GET"): + response = addResourceDetailResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def removeResourceDetail(self, command, method="GET"): + response = removeResourceDetailResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listResourceDetails(self, command, method="GET"): + response = listResourceDetailsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVpnCustomerGateway(self, command, method="GET"): + response = createVpnCustomerGatewayResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVpnGateway(self, command, method="GET"): + response = createVpnGatewayResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVpnConnection(self, command, method="GET"): + response = createVpnConnectionResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteVpnCustomerGateway(self, command, method="GET"): + response = deleteVpnCustomerGatewayResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteVpnGateway(self, command, method="GET"): + response = deleteVpnGatewayResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteVpnConnection(self, command, method="GET"): + response = deleteVpnConnectionResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateVpnCustomerGateway(self, command, method="GET"): + response = updateVpnCustomerGatewayResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def resetVpnConnection(self, command, method="GET"): + response = resetVpnConnectionResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVpnCustomerGateways(self, command, method="GET"): + response = listVpnCustomerGatewaysResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVpnGateways(self, command, method="GET"): + response = listVpnGatewaysResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVpnConnections(self, command, method="GET"): + response = listVpnConnectionsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def generateUsageRecords(self, command, method="GET"): + response = generateUsageRecordsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listUsageRecords(self, command, method="GET"): + response = listUsageRecordsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listUsageTypes(self, command, method="GET"): + response = listUsageTypesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addTrafficMonitor(self, command, method="GET"): + response = addTrafficMonitorResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteTrafficMonitor(self, command, method="GET"): + response = deleteTrafficMonitorResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listTrafficMonitors(self, command, method="GET"): + response = listTrafficMonitorsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addNiciraNvpDevice(self, command, method="GET"): + response = addNiciraNvpDeviceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteNiciraNvpDevice(self, command, method="GET"): + response = deleteNiciraNvpDeviceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNiciraNvpDevices(self, command, method="GET"): + response = listNiciraNvpDevicesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNiciraNvpDeviceNetworks(self, command, method="GET"): + response = listNiciraNvpDeviceNetworksResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addBigSwitchVnsDevice(self, command, method="GET"): + response = addBigSwitchVnsDeviceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteBigSwitchVnsDevice(self, command, method="GET"): + response = deleteBigSwitchVnsDeviceResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listBigSwitchVnsDevices(self, command, method="GET"): + response = listBigSwitchVnsDevicesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listApis(self, command, method="GET"): + response = listApisResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def getApiLimit(self, command, method="GET"): + response = getApiLimitResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def resetApiLimit(self, command, method="GET"): + response = resetApiLimitResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addRegion(self, command, method="GET"): + response = addRegionResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateRegion(self, command, method="GET"): + response = updateRegionResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def removeRegion(self, command, method="GET"): + response = removeRegionResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listRegions(self, command, method="GET"): + response = listRegionsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createGlobalLoadBalancerRule(self, command, method="GET"): + response = createGlobalLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteGlobalLoadBalancerRule(self, command, method="GET"): + response = deleteGlobalLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateGlobalLoadBalancerRule(self, command, method="GET"): + response = updateGlobalLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listGlobalLoadBalancerRules(self, command, method="GET"): + response = listGlobalLoadBalancerRulesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def assignToGlobalLoadBalancerRule(self, command, method="GET"): + response = assignToGlobalLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def removeFromGlobalLoadBalancerRule(self, command, method="GET"): + response = removeFromGlobalLoadBalancerRuleResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listVMSnapshot(self, command, method="GET"): + response = listVMSnapshotResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createVMSnapshot(self, command, method="GET"): + response = createVMSnapshotResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteVMSnapshot(self, command, method="GET"): + response = deleteVMSnapshotResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def revertToVMSnapshot(self, command, method="GET"): + response = revertToVMSnapshotResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addBaremetalHost(self, command, method="GET"): + response = addBaremetalHostResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addBaremetalPxeKickStartServer(self, command, method="GET"): + response = addBaremetalPxeKickStartServerResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addBaremetalPxePingServer(self, command, method="GET"): + response = addBaremetalPxePingServerResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addBaremetalDhcp(self, command, method="GET"): + response = addBaremetalDhcpResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listBaremetalDhcp(self, command, method="GET"): + response = listBaremetalDhcpResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listBaremetalPxeServers(self, command, method="GET"): + response = listBaremetalPxeServersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addUcsManager(self, command, method="GET"): + response = addUcsManagerResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listUcsManagers(self, command, method="GET"): + response = listUcsManagersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listUcsProfiles(self, command, method="GET"): + response = listUcsProfilesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listUcsBlades(self, command, method="GET"): + response = listUcsBladesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def associateUcsProfileToBlade(self, command, method="GET"): + response = associateUcsProfileToBladeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createLoadBalancer(self, command, method="GET"): + response = createLoadBalancerResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listLoadBalancers(self, command, method="GET"): + response = listLoadBalancersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteLoadBalancer(self, command, method="GET"): + response = deleteLoadBalancerResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def configureInternalLoadBalancerElement(self, command, method="GET"): + response = configureInternalLoadBalancerElementResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createInternalLoadBalancerElement(self, command, method="GET"): + response = createInternalLoadBalancerElementResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listInternalLoadBalancerElements(self, command, method="GET"): + response = listInternalLoadBalancerElementsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createAffinityGroup(self, command, method="GET"): + response = createAffinityGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteAffinityGroup(self, command, method="GET"): + response = deleteAffinityGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listAffinityGroups(self, command, method="GET"): + response = listAffinityGroupsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def updateVMAffinityGroup(self, command, method="GET"): + response = updateVMAffinityGroupResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listAffinityGroupTypes(self, command, method="GET"): + response = listAffinityGroupTypesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def createPortableIpRange(self, command, method="GET"): + response = createPortableIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deletePortableIpRange(self, command, method="GET"): + response = deletePortableIpRangeResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listPortableIpRanges(self, command, method="GET"): + response = listPortableIpRangesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def stopInternalLoadBalancerVM(self, command, method="GET"): + response = stopInternalLoadBalancerVMResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def startInternalLoadBalancerVM(self, command, method="GET"): + response = startInternalLoadBalancerVMResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listInternalLoadBalancerVMs(self, command, method="GET"): + response = listInternalLoadBalancerVMsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listNetworkIsolationMethods(self, command, method="GET"): + response = listNetworkIsolationMethodsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def dedicateZone(self, command, method="GET"): + response = dedicateZoneResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def dedicatePod(self, command, method="GET"): + response = dedicatePodResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def dedicateCluster(self, command, method="GET"): + response = dedicateClusterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def dedicateHost(self, command, method="GET"): + response = dedicateHostResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def releaseDedicatedZone(self, command, method="GET"): + response = releaseDedicatedZoneResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def releaseDedicatedPod(self, command, method="GET"): + response = releaseDedicatedPodResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def releaseDedicatedCluster(self, command, method="GET"): + response = releaseDedicatedClusterResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def releaseDedicatedHost(self, command, method="GET"): + response = releaseDedicatedHostResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDedicatedZones(self, command, method="GET"): + response = listDedicatedZonesResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDedicatedPods(self, command, method="GET"): + response = listDedicatedPodsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDedicatedClusters(self, command, method="GET"): + response = listDedicatedClustersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listDedicatedHosts(self, command, method="GET"): + response = listDedicatedHostsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listLdapConfigurations(self, command, method="GET"): + response = listLdapConfigurationsResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def addLdapConfiguration(self, command, method="GET"): + response = addLdapConfigurationResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def deleteLdapConfiguration(self, command, method="GET"): + response = deleteLdapConfigurationResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def listLdapUsers(self, command, method="GET"): + response = listLdapUsersResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def ldapCreateAccount(self, command, method="GET"): + response = ldapCreateAccountResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def login(self, command, method="GET"): + response = loginResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + + def logout(self, command, method="GET"): + response = logoutResponse() + response = self.connection.marvin_request(command, response_type=response, method=method) + return response + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/configureInternalLoadBalancerElement.py b/tools/marvin/build/lib/marvin/cloudstackAPI/configureInternalLoadBalancerElement.py new file mode 100644 index 00000000000..26357e5993d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/configureInternalLoadBalancerElement.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Configures an Internal Load Balancer element.""" +from baseCmd import * +from baseResponse import * +class configureInternalLoadBalancerElementCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the internal lb provider""" + """Required""" + self.id = None + """Enables/Disables the Internal Load Balancer element""" + """Required""" + self.enabled = None + self.required = ["id","enabled",] + +class configureInternalLoadBalancerElementResponse (baseResponse): + def __init__(self): + """the id of the internal load balancer element""" + self.id = None + """Enabled/Disabled the element""" + self.enabled = None + """the physical network service provider id of the element""" + self.nspid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/configureVirtualRouterElement.py b/tools/marvin/build/lib/marvin/cloudstackAPI/configureVirtualRouterElement.py new file mode 100644 index 00000000000..5004dcdb4f2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/configureVirtualRouterElement.py @@ -0,0 +1,51 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Configures a virtual router element.""" +from baseCmd import * +from baseResponse import * +class configureVirtualRouterElementCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the virtual router provider""" + """Required""" + self.id = None + """Enabled/Disabled the service provider""" + """Required""" + self.enabled = None + self.required = ["id","enabled",] + +class configureVirtualRouterElementResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the provider""" + self.account = None + """the domain associated with the provider""" + self.domain = None + """the domain ID associated with the provider""" + self.domainid = None + """Enabled/Disabled the service provider""" + self.enabled = None + """the physical network service provider id of the provider""" + self.nspid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/copyIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/copyIso.py new file mode 100644 index 00000000000..34a9bece654 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/copyIso.py @@ -0,0 +1,137 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Copies an iso from one zone to another.""" +from baseCmd import * +from baseResponse import * +class copyIsoCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Template ID.""" + """Required""" + self.id = None + """ID of the zone the template is being copied to.""" + """Required""" + self.destzoneid = None + """ID of the zone the template is currently hosted on.""" + """Required""" + self.sourcezoneid = None + self.required = ["id","destzoneid","sourcezoneid",] + +class copyIsoResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/copyTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/copyTemplate.py new file mode 100644 index 00000000000..fba0f4f9613 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/copyTemplate.py @@ -0,0 +1,137 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Copies a template from one zone to another.""" +from baseCmd import * +from baseResponse import * +class copyTemplateCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Template ID.""" + """Required""" + self.id = None + """ID of the zone the template is being copied to.""" + """Required""" + self.destzoneid = None + """ID of the zone the template is currently hosted on.""" + """Required""" + self.sourcezoneid = None + self.required = ["id","destzoneid","sourcezoneid",] + +class copyTemplateResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAccount.py new file mode 100644 index 00000000000..9e04ec26ff2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createAccount.py @@ -0,0 +1,202 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates an account""" +from baseCmd import * +from baseResponse import * +class createAccountCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Type of the account. Specify 0 for user, 1 for root admin, and 2 for domain admin""" + """Required""" + self.accounttype = None + """email""" + """Required""" + self.email = None + """firstname""" + """Required""" + self.firstname = None + """lastname""" + """Required""" + self.lastname = None + """Clear text password (Default hashed to SHA256SALT). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.""" + """Required""" + self.password = None + """Unique username.""" + """Required""" + self.username = None + """Creates the user under the specified account. If no account is specified, the username will be used as the account name.""" + self.account = None + """details for account used to store specific parameters""" + self.accountdetails = [] + """Account UUID, required for adding account from external provisioning system""" + self.accountid = None + """Creates the user under the specified domain.""" + self.domainid = None + """Network domain for the account's networks""" + self.networkdomain = None + """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" + self.timezone = None + """User UUID, required for adding account from external provisioning system""" + self.userid = None + self.required = ["accounttype","email","firstname","lastname","password","username",] + +class createAccountResponse (baseResponse): + def __init__(self): + """the id of the account""" + self.id = None + """details for the account""" + self.accountdetails = None + """account type (admin, domain-admin, user)""" + self.accounttype = None + """the total number of cpu cores available to be created for this account""" + self.cpuavailable = None + """the total number of cpu cores the account can own""" + self.cpulimit = None + """the total number of cpu cores owned by account""" + self.cputotal = None + """the default zone of the account""" + self.defaultzoneid = None + """name of the Domain the account belongs too""" + self.domain = None + """id of the Domain the account belongs too""" + self.domainid = None + """the total number of public ip addresses available for this account to acquire""" + self.ipavailable = None + """the total number of public ip addresses this account can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this account""" + self.iptotal = None + """true if the account requires cleanup""" + self.iscleanuprequired = None + """true if account is default, false otherwise""" + self.isdefault = None + """the total memory (in MB) available to be created for this account""" + self.memoryavailable = None + """the total memory (in MB) the account can own""" + self.memorylimit = None + """the total memory (in MB) owned by account""" + self.memorytotal = None + """the name of the account""" + self.name = None + """the total number of networks available to be created for this account""" + self.networkavailable = None + """the network domain""" + self.networkdomain = None + """the total number of networks the account can own""" + self.networklimit = None + """the total number of networks owned by account""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this account""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the account can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by account""" + self.primarystoragetotal = None + """the total number of projects available for administration by this account""" + self.projectavailable = None + """the total number of projects the account can own""" + self.projectlimit = None + """the total number of projects being administrated by this account""" + self.projecttotal = None + """the total number of network traffic bytes received""" + self.receivedbytes = None + """the total secondary storage space (in GiB) available to be used for this account""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the account can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by account""" + self.secondarystoragetotal = None + """the total number of network traffic bytes sent""" + self.sentbytes = None + """the total number of snapshots available for this account""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this account""" + self.snapshotlimit = None + """the total number of snapshots stored by this account""" + self.snapshottotal = None + """the state of the account""" + self.state = None + """the total number of templates available to be created by this account""" + self.templateavailable = None + """the total number of templates which can be created by this account""" + self.templatelimit = None + """the total number of templates which have been created by this account""" + self.templatetotal = None + """the total number of virtual machines available for this account to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this account""" + self.vmlimit = None + """the total number of virtual machines running for this account""" + self.vmrunning = None + """the total number of virtual machines stopped for this account""" + self.vmstopped = None + """the total number of virtual machines deployed by this account""" + self.vmtotal = None + """the total volume available for this account""" + self.volumeavailable = None + """the total volume which can be used by this account""" + self.volumelimit = None + """the total volume being used by this account""" + self.volumetotal = None + """the total number of vpcs available to be created for this account""" + self.vpcavailable = None + """the total number of vpcs the account can own""" + self.vpclimit = None + """the total number of vpcs owned by account""" + self.vpctotal = None + """the list of users associated with account""" + self.user = [] + +class user: + def __init__(self): + """"the user ID""" + self.id = None + """"the account name of the user""" + self.account = None + """"the account ID of the user""" + self.accountid = None + """"the account type of the user""" + self.accounttype = None + """"the api key of the user""" + self.apikey = None + """"the date and time the user account was created""" + self.created = None + """"the domain name of the user""" + self.domain = None + """"the domain ID of the user""" + self.domainid = None + """"the user email address""" + self.email = None + """"the user firstname""" + self.firstname = None + """"the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """"true if user is default, false otherwise""" + self.isdefault = None + """"the user lastname""" + self.lastname = None + """"the secret key of the user""" + self.secretkey = None + """"the user state""" + self.state = None + """"the timezone user was created in""" + self.timezone = None + """"the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAffinityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAffinityGroup.py new file mode 100644 index 00000000000..473e3ee2444 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createAffinityGroup.py @@ -0,0 +1,57 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates an affinity/anti-affinity group""" +from baseCmd import * +from baseResponse import * +class createAffinityGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """name of the affinity group""" + """Required""" + self.name = None + """Type of the affinity group from the available affinity/anti-affinity group types""" + """Required""" + self.type = None + """an account for the affinity group. Must be used with domainId.""" + self.account = None + """optional description of the affinity group""" + self.description = None + """domainId of the account owning the affinity group""" + self.domainid = None + self.required = ["name","type",] + +class createAffinityGroupResponse (baseResponse): + def __init__(self): + """the ID of the affinity group""" + self.id = None + """the account owning the affinity group""" + self.account = None + """the description of the affinity group""" + self.description = None + """the domain name of the affinity group""" + self.domain = None + """the domain ID of the affinity group""" + self.domainid = None + """the name of the affinity group""" + self.name = None + """the type of the affinity group""" + self.type = None + """virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScalePolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScalePolicy.py new file mode 100644 index 00000000000..500284660d3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScalePolicy.py @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates an autoscale policy for a provision or deprovision action, the action is taken when the all the conditions evaluates to true for the specified duration. The policy is in effect once it is attached to a autscale vm group.""" +from baseCmd import * +from baseResponse import * +class createAutoScalePolicyCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the action to be executed if all the conditions evaluate to true for the specified duration.""" + """Required""" + self.action = None + """the list of IDs of the conditions that are being evaluated on every interval""" + """Required""" + self.conditionids = [] + """the duration for which the conditions have to be true before action is taken""" + """Required""" + self.duration = None + """the cool down period for which the policy should not be evaluated after the action has been taken""" + self.quiettime = None + self.required = ["action","conditionids","duration",] + +class createAutoScalePolicyResponse (baseResponse): + def __init__(self): + """the autoscale policy ID""" + self.id = None + """the account owning the autoscale policy""" + self.account = None + """the action to be executed if all the conditions evaluate to true for the specified duration.""" + self.action = None + """the list of IDs of the conditions that are being evaluated on every interval""" + self.conditions = None + """the domain name of the autoscale policy""" + self.domain = None + """the domain ID of the autoscale policy""" + self.domainid = None + """the duration for which the conditions have to be true before action is taken""" + self.duration = None + """the project name of the autoscale policy""" + self.project = None + """the project id autoscale policy""" + self.projectid = None + """the cool down period for which the policy should not be evaluated after the action has been taken""" + self.quiettime = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmGroup.py new file mode 100644 index 00000000000..f8a35b62d01 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmGroup.py @@ -0,0 +1,77 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.""" +from baseCmd import * +from baseResponse import * +class createAutoScaleVmGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the load balancer rule""" + """Required""" + self.lbruleid = None + """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" + """Required""" + self.maxmembers = None + """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" + """Required""" + self.minmembers = None + """list of scaledown autoscale policies""" + """Required""" + self.scaledownpolicyids = [] + """list of scaleup autoscale policies""" + """Required""" + self.scaleuppolicyids = [] + """the autoscale profile that contains information about the vms in the vm group.""" + """Required""" + self.vmprofileid = None + """the frequency at which the conditions have to be evaluated""" + self.interval = None + self.required = ["lbruleid","maxmembers","minmembers","scaledownpolicyids","scaleuppolicyids","vmprofileid",] + +class createAutoScaleVmGroupResponse (baseResponse): + def __init__(self): + """the autoscale vm group ID""" + self.id = None + """the account owning the instance group""" + self.account = None + """the domain name of the vm profile""" + self.domain = None + """the domain ID of the vm profile""" + self.domainid = None + """the frequency at which the conditions have to be evaluated""" + self.interval = None + """the load balancer rule ID""" + self.lbruleid = None + """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" + self.maxmembers = None + """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" + self.minmembers = None + """the project name of the vm profile""" + self.project = None + """the project id vm profile""" + self.projectid = None + """list of scaledown autoscale policies""" + self.scaledownpolicies = None + """list of scaleup autoscale policies""" + self.scaleuppolicies = None + """the current state of the AutoScale Vm Group""" + self.state = None + """the autoscale profile that contains information about the vms in the vm group.""" + self.vmprofileid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmProfile.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmProfile.py new file mode 100644 index 00000000000..00250322f92 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmProfile.py @@ -0,0 +1,70 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a profile that contains information about the virtual machine which will be provisioned automatically by autoscale feature.""" +from baseCmd import * +from baseResponse import * +class createAutoScaleVmProfileCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the service offering of the auto deployed virtual machine""" + """Required""" + self.serviceofferingid = None + """the template of the auto deployed virtual machine""" + """Required""" + self.templateid = None + """availability zone for the auto deployed virtual machine""" + """Required""" + self.zoneid = None + """the ID of the user used to launch and destroy the VMs""" + self.autoscaleuserid = None + """counterparam list. Example: counterparam[0].name=snmpcommunity&counterparam[0].value=public&counterparam[1].name=snmpport&counterparam[1].value=161""" + self.counterparam = [] + """the time allowed for existing connections to get closed before a vm is destroyed""" + self.destroyvmgraceperiod = None + """parameters other than zoneId/serviceOfferringId/templateId of the auto deployed virtual machine""" + self.otherdeployparams = None + self.required = ["serviceofferingid","templateid","zoneid",] + +class createAutoScaleVmProfileResponse (baseResponse): + def __init__(self): + """the autoscale vm profile ID""" + self.id = None + """the account owning the instance group""" + self.account = None + """the ID of the user used to launch and destroy the VMs""" + self.autoscaleuserid = None + """the time allowed for existing connections to get closed before a vm is destroyed""" + self.destroyvmgraceperiod = None + """the domain name of the vm profile""" + self.domain = None + """the domain ID of the vm profile""" + self.domainid = None + """parameters other than zoneId/serviceOfferringId/templateId to be used while deploying a virtual machine""" + self.otherdeployparams = None + """the project name of the vm profile""" + self.project = None + """the project id vm profile""" + self.projectid = None + """the service offering to be used while deploying a virtual machine""" + self.serviceofferingid = None + """the template to be used while deploying a virtual machine""" + self.templateid = None + """the availability zone to be used while deploying a virtual machine""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createCondition.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createCondition.py new file mode 100644 index 00000000000..74a9dafaa4f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createCondition.py @@ -0,0 +1,62 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a condition""" +from baseCmd import * +from baseResponse import * +class createConditionCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """ID of the Counter.""" + """Required""" + self.counterid = None + """Relational Operator to be used with threshold.""" + """Required""" + self.relationaloperator = None + """Threshold value.""" + """Required""" + self.threshold = None + """the account of the condition. Must be used with the domainId parameter.""" + self.account = None + """the domain ID of the account.""" + self.domainid = None + self.required = ["counterid","relationaloperator","threshold",] + +class createConditionResponse (baseResponse): + def __init__(self): + """the id of the Condition""" + self.id = None + """the owner of the Condition.""" + self.account = None + """Details of the Counter.""" + self.counter = None + """the domain name of the owner.""" + self.domain = None + """the domain id of the Condition owner""" + self.domainid = None + """the project name of the Condition""" + self.project = None + """the project id of the Condition.""" + self.projectid = None + """Relational Operator to be used with threshold.""" + self.relationaloperator = None + """Threshold Value for the counter.""" + self.threshold = None + """zone id of counter""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createCounter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createCounter.py new file mode 100644 index 00000000000..240a486a291 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createCounter.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Adds metric counter""" +from baseCmd import * +from baseResponse import * +class createCounterCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Name of the counter.""" + """Required""" + self.name = None + """Source of the counter.""" + """Required""" + self.source = None + """Value of the counter e.g. oid in case of snmp.""" + """Required""" + self.value = None + self.required = ["name","source","value",] + +class createCounterResponse (baseResponse): + def __init__(self): + """the id of the Counter""" + self.id = None + """Name of the counter.""" + self.name = None + """Source of the counter.""" + self.source = None + """Value in case of snmp or other specific counters.""" + self.value = None + """zone id of counter""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createDiskOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createDiskOffering.py new file mode 100644 index 00000000000..736a0cf5f16 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createDiskOffering.py @@ -0,0 +1,97 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a disk offering.""" +from baseCmd import * +from baseResponse import * +class createDiskOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """alternate display text of the disk offering""" + """Required""" + self.displaytext = None + """name of the disk offering""" + """Required""" + self.name = None + """bytes read rate of the disk offering""" + self.bytesreadrate = None + """bytes write rate of the disk offering""" + self.byteswriterate = None + """whether disk offering size is custom or not""" + self.customized = None + """whether disk offering iops is custom or not""" + self.customizediops = None + """size of the disk offering in GB""" + self.disksize = None + """an optional field, whether to display the offering to the end user or not.""" + self.displayoffering = None + """the ID of the containing domain, null for public offerings""" + self.domainid = None + """io requests read rate of the disk offering""" + self.iopsreadrate = None + """io requests write rate of the disk offering""" + self.iopswriterate = None + """max iops of the disk offering""" + self.maxiops = None + """min iops of the disk offering""" + self.miniops = None + """the storage type of the disk offering. Values are local and shared.""" + self.storagetype = None + """tags for the disk offering""" + self.tags = None + self.required = ["displaytext","name",] + +class createDiskOfferingResponse (baseResponse): + def __init__(self): + """unique ID of the disk offering""" + self.id = None + """the date this disk offering was created""" + self.created = None + """bytes read rate of the disk offering""" + self.diskBytesReadRate = None + """bytes write rate of the disk offering""" + self.diskBytesWriteRate = None + """io requests read rate of the disk offering""" + self.diskIopsReadRate = None + """io requests write rate of the disk offering""" + self.diskIopsWriteRate = None + """the size of the disk offering in GB""" + self.disksize = None + """whether to display the offering to the end user or not.""" + self.displayoffering = None + """an alternate display text of the disk offering.""" + self.displaytext = None + """the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.""" + self.domain = None + """the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.""" + self.domainid = None + """true if disk offering uses custom size, false otherwise""" + self.iscustomized = None + """true if disk offering uses custom iops, false otherwise""" + self.iscustomizediops = None + """the max iops of the disk offering""" + self.maxiops = None + """the min iops of the disk offering""" + self.miniops = None + """the name of the disk offering""" + self.name = None + """the storage type for this disk offering""" + self.storagetype = None + """the tags for the disk offering""" + self.tags = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createDomain.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createDomain.py new file mode 100644 index 00000000000..12b4854e981 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createDomain.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a domain""" +from baseCmd import * +from baseResponse import * +class createDomainCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """creates domain with this name""" + """Required""" + self.name = None + """Domain UUID, required for adding domain from another Region""" + self.domainid = None + """Network domain for networks in the domain""" + self.networkdomain = None + """assigns new domain a parent domain by domain ID of the parent. If no parent domain is specied, the ROOT domain is assumed.""" + self.parentdomainid = None + self.required = ["name",] + +class createDomainResponse (baseResponse): + def __init__(self): + """the ID of the domain""" + self.id = None + """whether the domain has one or more sub-domains""" + self.haschild = None + """the level of the domain""" + self.level = None + """the name of the domain""" + self.name = None + """the network domain""" + self.networkdomain = None + """the domain ID of the parent domain""" + self.parentdomainid = None + """the domain name of the parent domain""" + self.parentdomainname = None + """the path of the domain""" + self.path = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createEgressFirewallRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createEgressFirewallRule.py new file mode 100644 index 00000000000..61a5e7eec4e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createEgressFirewallRule.py @@ -0,0 +1,94 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a egress firewall rule for a given network""" +from baseCmd import * +from baseResponse import * +class createEgressFirewallRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the network id of the port forwarding rule""" + """Required""" + self.networkid = None + """the protocol for the firewall rule. Valid values are TCP/UDP/ICMP.""" + """Required""" + self.protocol = None + """the cidr list to forward traffic from""" + self.cidrlist = [] + """the ending port of firewall rule""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """the starting port of firewall rule""" + self.startport = None + """type of firewallrule: system/user""" + self.type = None + self.required = ["networkid","protocol",] + +class createEgressFirewallRuleResponse (baseResponse): + def __init__(self): + """the ID of the firewall rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the ending port of firewall rule's port range""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """the public ip address for the firewall rule""" + self.ipaddress = None + """the public ip address id for the firewall rule""" + self.ipaddressid = None + """the network id of the firewall rule""" + self.networkid = None + """the protocol of the firewall rule""" + self.protocol = None + """the starting port of firewall rule's port range""" + self.startport = None + """the state of the rule""" + self.state = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createFirewallRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createFirewallRule.py new file mode 100644 index 00000000000..4faeb6bde1b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createFirewallRule.py @@ -0,0 +1,94 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a firewall rule for a given ip address""" +from baseCmd import * +from baseResponse import * +class createFirewallRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the IP address id of the port forwarding rule""" + """Required""" + self.ipaddressid = None + """the protocol for the firewall rule. Valid values are TCP/UDP/ICMP.""" + """Required""" + self.protocol = None + """the cidr list to forward traffic from""" + self.cidrlist = [] + """the ending port of firewall rule""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """the starting port of firewall rule""" + self.startport = None + """type of firewallrule: system/user""" + self.type = None + self.required = ["ipaddressid","protocol",] + +class createFirewallRuleResponse (baseResponse): + def __init__(self): + """the ID of the firewall rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the ending port of firewall rule's port range""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """the public ip address for the firewall rule""" + self.ipaddress = None + """the public ip address id for the firewall rule""" + self.ipaddressid = None + """the network id of the firewall rule""" + self.networkid = None + """the protocol of the firewall rule""" + self.protocol = None + """the starting port of firewall rule's port range""" + self.startport = None + """the state of the rule""" + self.state = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createGlobalLoadBalancerRule.py new file mode 100644 index 00000000000..dd0c610a530 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createGlobalLoadBalancerRule.py @@ -0,0 +1,161 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a global load balancer rule""" +from baseCmd import * +from baseResponse import * +class createGlobalLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """domain name for the GSLB service.""" + """Required""" + self.gslbdomainname = None + """GSLB service type (tcp, udp)""" + """Required""" + self.gslbservicetype = None + """name of the load balancer rule""" + """Required""" + self.name = None + """region where the global load balancer is going to be created.""" + """Required""" + self.regionid = None + """the account associated with the global load balancer. Must be used with the domainId parameter.""" + self.account = None + """the description of the load balancer rule""" + self.description = None + """the domain ID associated with the load balancer""" + self.domainid = None + """load balancer algorithm (roundrobin, leastconn, proximity) that method is used to distribute traffic across the zones participating in global server load balancing, if not specified defaults to 'round robin'""" + self.gslblbmethod = None + """session sticky method (sourceip) if not specified defaults to sourceip""" + self.gslbstickysessionmethodname = None + self.required = ["gslbdomainname","gslbservicetype","name","regionid",] + +class createGlobalLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """global load balancer rule ID""" + self.id = None + """the account of the load balancer rule""" + self.account = None + """the description of the global load balancer rule""" + self.description = None + """the domain of the load balancer rule""" + self.domain = None + """the domain ID of the load balancer rule""" + self.domainid = None + """DNS domain name given for the global load balancer""" + self.gslbdomainname = None + """Load balancing method used for the global load balancer""" + self.gslblbmethod = None + """GSLB service type""" + self.gslbservicetype = None + """session persistence method used for the global load balancer""" + self.gslbstickysessionmethodname = None + """name of the global load balancer rule""" + self.name = None + """the project name of the load balancer""" + self.project = None + """the project id of the load balancer""" + self.projectid = None + """Region Id in which global load balancer is created""" + self.regionid = None + """List of load balancer rules that are part of GSLB rule""" + self.loadbalancerrule = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class loadbalancerrule: + def __init__(self): + """"the load balancer rule ID""" + self.id = None + """"the account of the load balancer rule""" + self.account = None + """"the load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """"the cidr list to forward traffic from""" + self.cidrlist = None + """"the description of the load balancer""" + self.description = None + """"the domain of the load balancer rule""" + self.domain = None + """"the domain ID of the load balancer rule""" + self.domainid = None + """"the name of the load balancer""" + self.name = None + """"the id of the guest network the lb rule belongs to""" + self.networkid = None + """"the private port""" + self.privateport = None + """"the project name of the load balancer""" + self.project = None + """"the project id of the load balancer""" + self.projectid = None + """"the public ip address""" + self.publicip = None + """"the public ip address id""" + self.publicipid = None + """"the public port""" + self.publicport = None + """"the state of the rule""" + self.state = None + """"the id of the zone the rule belongs to""" + self.zoneid = None + """"the list of resource tags associated with load balancer""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createInstanceGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createInstanceGroup.py new file mode 100644 index 00000000000..37f72727c2d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createInstanceGroup.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a vm group""" +from baseCmd import * +from baseResponse import * +class createInstanceGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the name of the instance group""" + """Required""" + self.name = None + """the account of the instance group. The account parameter must be used with the domainId parameter.""" + self.account = None + """the domain ID of account owning the instance group""" + self.domainid = None + """The project of the instance group""" + self.projectid = None + self.required = ["name",] + +class createInstanceGroupResponse (baseResponse): + def __init__(self): + """the id of the instance group""" + self.id = None + """the account owning the instance group""" + self.account = None + """time and date the instance group was created""" + self.created = None + """the domain name of the instance group""" + self.domain = None + """the domain ID of the instance group""" + self.domainid = None + """the name of the instance group""" + self.name = None + """the project name of the group""" + self.project = None + """the project id of the group""" + self.projectid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createInternalLoadBalancerElement.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createInternalLoadBalancerElement.py new file mode 100644 index 00000000000..7a84929783e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createInternalLoadBalancerElement.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Create an Internal Load Balancer element.""" +from baseCmd import * +from baseResponse import * +class createInternalLoadBalancerElementCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the network service provider ID of the internal load balancer element""" + """Required""" + self.nspid = None + self.required = ["nspid",] + +class createInternalLoadBalancerElementResponse (baseResponse): + def __init__(self): + """the id of the internal load balancer element""" + self.id = None + """Enabled/Disabled the element""" + self.enabled = None + """the physical network service provider id of the element""" + self.nspid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createIpForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createIpForwardingRule.py new file mode 100644 index 00000000000..06f7b07388d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createIpForwardingRule.py @@ -0,0 +1,97 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates an ip forwarding rule""" +from baseCmd import * +from baseResponse import * +class createIpForwardingRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the public IP address id of the forwarding rule, already associated via associateIp""" + """Required""" + self.ipaddressid = None + """the protocol for the rule. Valid values are TCP or UDP.""" + """Required""" + self.protocol = None + """the start port for the rule""" + """Required""" + self.startport = None + """the cidr list to forward traffic from""" + self.cidrlist = [] + """the end port for the rule""" + self.endport = None + """if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. Has value true by default""" + self.openfirewall = None + self.required = ["ipaddressid","protocol","startport",] + +class createIpForwardingRuleResponse (baseResponse): + def __init__(self): + """the ID of the port forwarding rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the public ip address for the port forwarding rule""" + self.ipaddress = None + """the public ip address id for the port forwarding rule""" + self.ipaddressid = None + """the ending port of port forwarding rule's private port range""" + self.privateendport = None + """the starting port of port forwarding rule's private port range""" + self.privateport = None + """the protocol of the port forwarding rule""" + self.protocol = None + """the ending port of port forwarding rule's private port range""" + self.publicendport = None + """the starting port of port forwarding rule's public port range""" + self.publicport = None + """the state of the rule""" + self.state = None + """the VM display name for the port forwarding rule""" + self.virtualmachinedisplayname = None + """the VM ID for the port forwarding rule""" + self.virtualmachineid = None + """the VM name for the port forwarding rule""" + self.virtualmachinename = None + """the vm ip address for the port forwarding rule""" + self.vmguestip = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createLBHealthCheckPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createLBHealthCheckPolicy.py new file mode 100644 index 00000000000..e650d15e033 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createLBHealthCheckPolicy.py @@ -0,0 +1,75 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a Load Balancer healthcheck policy""" +from baseCmd import * +from baseResponse import * +class createLBHealthCheckPolicyCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the load balancer rule""" + """Required""" + self.lbruleid = None + """the description of the load balancer HealthCheck policy""" + self.description = None + """Number of consecutive health check success before declaring an instance healthy""" + self.healthythreshold = None + """Amount of time between health checks (1 sec - 20940 sec)""" + self.intervaltime = None + """HTTP Ping Path""" + self.pingpath = None + """Time to wait when receiving a response from the health check (2sec - 60 sec)""" + self.responsetimeout = None + """Number of consecutive health check failures before declaring an instance unhealthy""" + self.unhealthythreshold = None + self.required = ["lbruleid",] + +class createLBHealthCheckPolicyResponse (baseResponse): + def __init__(self): + """the account of the HealthCheck policy""" + self.account = None + """the domain of the HealthCheck policy""" + self.domain = None + """the domain ID of the HealthCheck policy""" + self.domainid = None + """the LB rule ID""" + self.lbruleid = None + """the id of the zone the HealthCheck policy belongs to""" + self.zoneid = None + """the list of healthcheckpolicies""" + self.healthcheckpolicy = [] + +class healthcheckpolicy: + def __init__(self): + """"the LB HealthCheck policy ID""" + self.id = None + """"the description of the healthcheck policy""" + self.description = None + """"Amount of time between health checks""" + self.healthcheckinterval = None + """"Number of consecutive health check success before declaring an instance healthy""" + self.healthcheckthresshold = None + """"the pingpath of the healthcheck policy""" + self.pingpath = None + """"Time to wait when receiving a response from the health check""" + self.responsetime = None + """"the state of the policy""" + self.state = None + """"Number of consecutive health check failures before declaring an instance unhealthy.""" + self.unhealthcheckthresshold = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createLBStickinessPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createLBStickinessPolicy.py new file mode 100644 index 00000000000..5accb88135c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createLBStickinessPolicy.py @@ -0,0 +1,75 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a Load Balancer stickiness policy""" +from baseCmd import * +from baseResponse import * +class createLBStickinessPolicyCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the load balancer rule""" + """Required""" + self.lbruleid = None + """name of the LB Stickiness policy method, possible values can be obtained from ListNetworks API""" + """Required""" + self.methodname = None + """name of the LB Stickiness policy""" + """Required""" + self.name = None + """the description of the LB Stickiness policy""" + self.description = None + """param list. Example: param[0].name=cookiename¶m[0].value=LBCookie""" + self.param = [] + self.required = ["lbruleid","methodname","name",] + +class createLBStickinessPolicyResponse (baseResponse): + def __init__(self): + """the account of the Stickiness policy""" + self.account = None + """the description of the Stickiness policy""" + self.description = None + """the domain of the Stickiness policy""" + self.domain = None + """the domain ID of the Stickiness policy""" + self.domainid = None + """the LB rule ID""" + self.lbruleid = None + """the name of the Stickiness policy""" + self.name = None + """the state of the policy""" + self.state = None + """the id of the zone the Stickiness policy belongs to""" + self.zoneid = None + """the list of stickinesspolicies""" + self.stickinesspolicy = [] + +class stickinesspolicy: + def __init__(self): + """"the LB Stickiness policy ID""" + self.id = None + """"the description of the Stickiness policy""" + self.description = None + """"the method name of the Stickiness policy""" + self.methodname = None + """"the name of the Stickiness policy""" + self.name = None + """"the params of the policy""" + self.params = None + """"the state of the policy""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancer.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancer.py new file mode 100644 index 00000000000..0dcb5e91724 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancer.py @@ -0,0 +1,127 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a Load Balancer""" +from baseCmd import * +from baseResponse import * +class createLoadBalancerCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """load balancer algorithm (source, roundrobin, leastconn)""" + """Required""" + self.algorithm = None + """the TCP port of the virtual machine where the network traffic will be load balanced to""" + """Required""" + self.instanceport = None + """name of the Load Balancer""" + """Required""" + self.name = None + """The guest network the Load Balancer will be created for""" + """Required""" + self.networkid = None + """the load balancer scheme. Supported value in this release is Internal""" + """Required""" + self.scheme = None + """the network id of the source ip address""" + """Required""" + self.sourceipaddressnetworkid = None + """the source port the network traffic will be load balanced from""" + """Required""" + self.sourceport = None + """the description of the Load Balancer""" + self.description = None + """the source ip address the network traffic will be load balanced from""" + self.sourceipaddress = None + self.required = ["algorithm","instanceport","name","networkid","scheme","sourceipaddressnetworkid","sourceport",] + +class createLoadBalancerResponse (baseResponse): + def __init__(self): + """the Load Balancer ID""" + self.id = None + """the account of the Load Balancer""" + self.account = None + """the load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """the description of the Load Balancer""" + self.description = None + """the domain of the Load Balancer""" + self.domain = None + """the domain ID of the Load Balancer""" + self.domainid = None + """the name of the Load Balancer""" + self.name = None + """Load Balancer network id""" + self.networkid = None + """the project name of the Load Balancer""" + self.project = None + """the project id of the Load Balancer""" + self.projectid = None + """Load Balancer source ip""" + self.sourceipaddress = None + """Load Balancer source ip network id""" + self.sourceipaddressnetworkid = None + """the list of instances associated with the Load Balancer""" + self.loadbalancerinstance = [] + """the list of rules associated with the Load Balancer""" + self.loadbalancerrule = [] + """the list of resource tags associated with the Load Balancer""" + self.tags = [] + +class loadbalancerinstance: + def __init__(self): + """"the instance ID""" + self.id = None + """"the ip address of the instance""" + self.ipaddress = None + """"the name of the instance""" + self.name = None + """"the state of the instance""" + self.state = None + +class loadbalancerrule: + def __init__(self): + """"instance port of the load balancer rule""" + self.instanceport = None + """"source port of the load balancer rule""" + self.sourceport = None + """"the state of the load balancer rule""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancerRule.py new file mode 100644 index 00000000000..e30877ee289 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancerRule.py @@ -0,0 +1,116 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a load balancer rule""" +from baseCmd import * +from baseResponse import * +class createLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """load balancer algorithm (source, roundrobin, leastconn)""" + """Required""" + self.algorithm = None + """name of the load balancer rule""" + """Required""" + self.name = None + """the private port of the private ip address/virtual machine where the network traffic will be load balanced to""" + """Required""" + self.privateport = None + """the public port from where the network traffic will be load balanced from""" + """Required""" + self.publicport = None + """the account associated with the load balancer. Must be used with the domainId parameter.""" + self.account = None + """the cidr list to forward traffic from""" + self.cidrlist = [] + """the description of the load balancer rule""" + self.description = None + """the domain ID associated with the load balancer""" + self.domainid = None + """The guest network this rule will be created for. Required when public Ip address is not associated with any Guest network yet (VPC case)""" + self.networkid = None + """if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. If not specified 1) defaulted to false when LB rule is being created for VPC guest network 2) in all other cases defaulted to true""" + self.openfirewall = None + """public ip address id from where the network traffic will be load balanced from""" + self.publicipid = None + """zone where the load balancer is going to be created. This parameter is required when LB service provider is ElasticLoadBalancerVm""" + self.zoneid = None + self.required = ["algorithm","name","privateport","publicport",] + +class createLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """the load balancer rule ID""" + self.id = None + """the account of the load balancer rule""" + self.account = None + """the load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the description of the load balancer""" + self.description = None + """the domain of the load balancer rule""" + self.domain = None + """the domain ID of the load balancer rule""" + self.domainid = None + """the name of the load balancer""" + self.name = None + """the id of the guest network the lb rule belongs to""" + self.networkid = None + """the private port""" + self.privateport = None + """the project name of the load balancer""" + self.project = None + """the project id of the load balancer""" + self.projectid = None + """the public ip address""" + self.publicip = None + """the public ip address id""" + self.publicipid = None + """the public port""" + self.publicport = None + """the state of the rule""" + self.state = None + """the id of the zone the rule belongs to""" + self.zoneid = None + """the list of resource tags associated with load balancer""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetwork.py new file mode 100644 index 00000000000..0e5c3a94ced --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetwork.py @@ -0,0 +1,251 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a network""" +from baseCmd import * +from baseResponse import * +class createNetworkCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the display text of the network""" + """Required""" + self.displaytext = None + """the name of the network""" + """Required""" + self.name = None + """the network offering id""" + """Required""" + self.networkofferingid = None + """the Zone ID for the network""" + """Required""" + self.zoneid = None + """account who will own the network""" + self.account = None + """Network ACL Id associated for the network""" + self.aclid = None + """Access control type; supported values are account and domain. In 3.0 all shared networks should have aclType=Domain, and all Isolated networks - Account. Account means that only the account owner can use the network, domain - all accouns in the domain can use the network""" + self.acltype = None + """an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """domain ID of the account owning a network""" + self.domainid = None + """the ending IP address in the network IP range. If not specified, will be defaulted to startIP""" + self.endip = None + """the ending IPv6 address in the IPv6 network range""" + self.endipv6 = None + """the gateway of the network. Required for Shared networks and Isolated networks when it belongs to VPC""" + self.gateway = None + """the CIDR of IPv6 network, must be at least /64""" + self.ip6cidr = None + """the gateway of the IPv6 network. Required for Shared networks and Isolated networks when it belongs to VPC""" + self.ip6gateway = None + """the isolated private vlan for this network""" + self.isolatedpvlan = None + """the netmask of the network. Required for Shared networks and Isolated networks when it belongs to VPC""" + self.netmask = None + """network domain""" + self.networkdomain = None + """the Physical Network ID the network belongs to""" + self.physicalnetworkid = None + """an optional project for the ssh key""" + self.projectid = None + """the beginning IP address in the network IP range""" + self.startip = None + """the beginning IPv6 address in the IPv6 network range""" + self.startipv6 = None + """Defines whether to allow subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified""" + self.subdomainaccess = None + """the ID or VID of the network""" + self.vlan = None + """the VPC network belongs to""" + self.vpcid = None + self.required = ["displaytext","name","networkofferingid","zoneid",] + +class createNetworkResponse (baseResponse): + def __init__(self): + """the id of the network""" + self.id = None + """the owner of the network""" + self.account = None + """ACL Id associated with the VPC network""" + self.aclid = None + """acl type - access type to the network""" + self.acltype = None + """Broadcast domain type of the network""" + self.broadcastdomaintype = None + """broadcast uri of the network. This parameter is visible to ROOT admins only""" + self.broadcasturi = None + """list networks available for vm deployment""" + self.canusefordeploy = None + """Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" + self.cidr = None + """an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """the displaytext of the network""" + self.displaytext = None + """the first DNS for the network""" + self.dns1 = None + """the second DNS for the network""" + self.dns2 = None + """the domain name of the network owner""" + self.domain = None + """the domain id of the network owner""" + self.domainid = None + """the network's gateway""" + self.gateway = None + """the cidr of IPv6 network""" + self.ip6cidr = None + """the gateway of IPv6 network""" + self.ip6gateway = None + """true if network is default, false otherwise""" + self.isdefault = None + """list networks that are persistent""" + self.ispersistent = None + """true if network is system, false otherwise""" + self.issystem = None + """the name of the network""" + self.name = None + """the network's netmask""" + self.netmask = None + """the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" + self.networkcidr = None + """the network domain""" + self.networkdomain = None + """availability of the network offering the network is created from""" + self.networkofferingavailability = None + """true if network offering is ip conserve mode enabled""" + self.networkofferingconservemode = None + """display text of the network offering the network is created from""" + self.networkofferingdisplaytext = None + """network offering id the network is created from""" + self.networkofferingid = None + """name of the network offering the network is created from""" + self.networkofferingname = None + """the physical network id""" + self.physicalnetworkid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """related to what other network configuration""" + self.related = None + """the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" + self.reservediprange = None + """true network requires restart""" + self.restartrequired = None + """true if network supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """state of the network""" + self.state = None + """true if users from subdomains can access the domain level network""" + self.subdomainaccess = None + """the traffic type of the network""" + self.traffictype = None + """the type of the network""" + self.type = None + """The vlan of the network. This parameter is visible to ROOT admins only""" + self.vlan = None + """VPC the network belongs to""" + self.vpcid = None + """zone id of the network""" + self.zoneid = None + """the name of the zone the network belongs to""" + self.zonename = None + """the list of services""" + self.service = [] + """the list of resource tags associated with network""" + self.tags = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACL.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACL.py new file mode 100644 index 00000000000..3b3f611edac --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACL.py @@ -0,0 +1,101 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a ACL rule in the given network (the network has to belong to VPC)""" +from baseCmd import * +from baseResponse import * +class createNetworkACLCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the protocol for the ACL rule. Valid values are TCP/UDP/ICMP/ALL or valid protocol number""" + """Required""" + self.protocol = None + """The network of the vm the ACL will be created for""" + self.aclid = None + """scl entry action, allow or deny""" + self.action = None + """the cidr list to allow traffic from/to""" + self.cidrlist = [] + """the ending port of ACL""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """The network of the vm the ACL will be created for""" + self.networkid = None + """The network of the vm the ACL will be created for""" + self.number = None + """the starting port of ACL""" + self.startport = None + """the traffic type for the ACL,can be Ingress or Egress, defaulted to Ingress if not specified""" + self.traffictype = None + self.required = ["protocol",] + +class createNetworkACLResponse (baseResponse): + def __init__(self): + """the ID of the ACL Item""" + self.id = None + """the ID of the ACL this item belongs to""" + self.aclid = None + """Action of ACL Item. Allow/Deny""" + self.action = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the ending port of ACL's port range""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """Number of the ACL Item""" + self.number = None + """the protocol of the ACL""" + self.protocol = None + """the starting port of ACL's port range""" + self.startport = None + """the state of the rule""" + self.state = None + """the traffic type for the ACL""" + self.traffictype = None + """the list of resource tags associated with the network ACLs""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACLList.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACLList.py new file mode 100644 index 00000000000..d13ffc163fc --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACLList.py @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a Network ACL for the given VPC""" +from baseCmd import * +from baseResponse import * +class createNetworkACLListCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Name of the network ACL List""" + """Required""" + self.name = None + """Id of the VPC associated with this network ACL List""" + """Required""" + self.vpcid = None + """Description of the network ACL List""" + self.description = None + self.required = ["name","vpcid",] + +class createNetworkACLListResponse (baseResponse): + def __init__(self): + """the ID of the ACL""" + self.id = None + """Description of the ACL""" + self.description = None + """the Name of the ACL""" + self.name = None + """Id of the VPC this ACL is associated with""" + self.vpcid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkOffering.py new file mode 100644 index 00000000000..e7b29d54891 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkOffering.py @@ -0,0 +1,167 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a network offering.""" +from baseCmd import * +from baseResponse import * +class createNetworkOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the display text of the network offering""" + """Required""" + self.displaytext = None + """guest type of the network offering: Shared or Isolated""" + """Required""" + self.guestiptype = None + """the name of the network offering""" + """Required""" + self.name = None + """services supported by the network offering""" + """Required""" + self.supportedservices = [] + """the traffic type for the network offering. Supported type in current release is GUEST only""" + """Required""" + self.traffictype = None + """the availability of network offering. Default value is Optional""" + self.availability = None + """true if the network offering is IP conserve mode enabled""" + self.conservemode = None + """Network offering details in key/value pairs. Supported keys are internallbprovider/publiclbprovider with service provider as a value""" + self.details = [] + """true if default guest network egress policy is allow; false if default egress policy is deny""" + self.egressdefaultpolicy = None + """true if network offering supports persistent networks; defaulted to false if not specified""" + self.ispersistent = None + """maximum number of concurrent connections supported by the network offering""" + self.maxconnections = None + """data transfer rate in megabits per second allowed""" + self.networkrate = None + """desired service capabilities as part of network offering""" + self.servicecapabilitylist = [] + """the service offering ID used by virtual router provider""" + self.serviceofferingid = None + """provider to service mapping. If not specified, the provider for the service will be mapped to the default provider on the physical network""" + self.serviceproviderlist = [] + """true if network offering supports specifying ip ranges; defaulted to false if not specified""" + self.specifyipranges = None + """true if network offering supports vlans""" + self.specifyvlan = None + """the tags for the network offering.""" + self.tags = None + self.required = ["displaytext","guestiptype","name","supportedservices","traffictype",] + +class createNetworkOfferingResponse (baseResponse): + def __init__(self): + """the id of the network offering""" + self.id = None + """availability of the network offering""" + self.availability = None + """true if network offering is ip conserve mode enabled""" + self.conservemode = None + """the date this network offering was created""" + self.created = None + """additional key/value details tied with network offering""" + self.details = None + """an alternate display text of the network offering.""" + self.displaytext = None + """true if network offering supports persistent networks, false otherwise""" + self.egressdefaultpolicy = None + """true if network offering can be used by VPC networks only""" + self.forvpc = None + """guest type of the network offering, can be Shared or Isolated""" + self.guestiptype = None + """true if network offering is default, false otherwise""" + self.isdefault = None + """true if network offering supports persistent networks, false otherwise""" + self.ispersistent = None + """maximum number of concurrents connections to be handled by lb""" + self.maxconnections = None + """the name of the network offering""" + self.name = None + """data transfer rate in megabits per second allowed.""" + self.networkrate = None + """the ID of the service offering used by virtual router provider""" + self.serviceofferingid = None + """true if network offering supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """true if network offering supports vlans, false otherwise""" + self.specifyvlan = None + """state of the network offering. Can be Disabled/Enabled/Inactive""" + self.state = None + """the tags for the network offering""" + self.tags = None + """the traffic type for the network offering, supported types are Public, Management, Control, Guest, Vlan or Storage.""" + self.traffictype = None + """the list of supported services""" + self.service = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPhysicalNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPhysicalNetwork.py new file mode 100644 index 00000000000..8bbb8d83084 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createPhysicalNetwork.py @@ -0,0 +1,67 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a physical network""" +from baseCmd import * +from baseResponse import * +class createPhysicalNetworkCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the name of the physical network""" + """Required""" + self.name = None + """the Zone ID for the physical network""" + """Required""" + self.zoneid = None + """the broadcast domain range for the physical network[Pod or Zone]. In Acton release it can be Zone only in Advance zone, and Pod in Basic""" + self.broadcastdomainrange = None + """domain ID of the account owning a physical network""" + self.domainid = None + """the isolation method for the physical network[VLAN/L3/GRE]""" + self.isolationmethods = [] + """the speed for the physical network[1G/10G]""" + self.networkspeed = None + """Tag the physical network""" + self.tags = [] + """the VLAN for the physical network""" + self.vlan = None + self.required = ["name","zoneid",] + +class createPhysicalNetworkResponse (baseResponse): + def __init__(self): + """the uuid of the physical network""" + self.id = None + """Broadcast domain range of the physical network""" + self.broadcastdomainrange = None + """the domain id of the physical network owner""" + self.domainid = None + """isolation methods""" + self.isolationmethods = None + """name of the physical network""" + self.name = None + """the speed of the physical network""" + self.networkspeed = None + """state of the physical network""" + self.state = None + """comma separated tag""" + self.tags = None + """the vlan of the physical network""" + self.vlan = None + """zone id of the physical network""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPod.py new file mode 100644 index 00000000000..e84e563abaf --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createPod.py @@ -0,0 +1,91 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a new Pod.""" +from baseCmd import * +from baseResponse import * +class createPodCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the gateway for the Pod""" + """Required""" + self.gateway = None + """the name of the Pod""" + """Required""" + self.name = None + """the netmask for the Pod""" + """Required""" + self.netmask = None + """the starting IP address for the Pod""" + """Required""" + self.startip = None + """the Zone ID in which the Pod will be created""" + """Required""" + self.zoneid = None + """Allocation state of this Pod for allocation of new resources""" + self.allocationstate = None + """the ending IP address for the Pod""" + self.endip = None + self.required = ["gateway","name","netmask","startip","zoneid",] + +class createPodResponse (baseResponse): + def __init__(self): + """the ID of the Pod""" + self.id = None + """the allocation state of the Pod""" + self.allocationstate = None + """the ending IP for the Pod""" + self.endip = None + """the gateway of the Pod""" + self.gateway = None + """the name of the Pod""" + self.name = None + """the netmask of the Pod""" + self.netmask = None + """the starting IP for the Pod""" + self.startip = None + """the Zone ID of the Pod""" + self.zoneid = None + """the Zone name of the Pod""" + self.zonename = None + """the capacity of the Pod""" + self.capacity = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPortForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPortForwardingRule.py new file mode 100644 index 00000000000..b7717e9e7ce --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createPortForwardingRule.py @@ -0,0 +1,109 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a port forwarding rule""" +from baseCmd import * +from baseResponse import * +class createPortForwardingRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the IP address id of the port forwarding rule""" + """Required""" + self.ipaddressid = None + """the starting port of port forwarding rule's private port range""" + """Required""" + self.privateport = None + """the protocol for the port fowarding rule. Valid values are TCP or UDP.""" + """Required""" + self.protocol = None + """the starting port of port forwarding rule's public port range""" + """Required""" + self.publicport = None + """the ID of the virtual machine for the port forwarding rule""" + """Required""" + self.virtualmachineid = None + """the cidr list to forward traffic from""" + self.cidrlist = [] + """The network of the vm the Port Forwarding rule will be created for. Required when public Ip address is not associated with any Guest network yet (VPC case)""" + self.networkid = None + """if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. If not specified 1) defaulted to false when PF rule is being created for VPC guest network 2) in all other cases defaulted to true""" + self.openfirewall = None + """the ending port of port forwarding rule's private port range""" + self.privateendport = None + """the ending port of port forwarding rule's private port range""" + self.publicendport = None + """VM guest nic Secondary ip address for the port forwarding rule""" + self.vmguestip = None + self.required = ["ipaddressid","privateport","protocol","publicport","virtualmachineid",] + +class createPortForwardingRuleResponse (baseResponse): + def __init__(self): + """the ID of the port forwarding rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the public ip address for the port forwarding rule""" + self.ipaddress = None + """the public ip address id for the port forwarding rule""" + self.ipaddressid = None + """the ending port of port forwarding rule's private port range""" + self.privateendport = None + """the starting port of port forwarding rule's private port range""" + self.privateport = None + """the protocol of the port forwarding rule""" + self.protocol = None + """the ending port of port forwarding rule's private port range""" + self.publicendport = None + """the starting port of port forwarding rule's public port range""" + self.publicport = None + """the state of the rule""" + self.state = None + """the VM display name for the port forwarding rule""" + self.virtualmachinedisplayname = None + """the VM ID for the port forwarding rule""" + self.virtualmachineid = None + """the VM name for the port forwarding rule""" + self.virtualmachinename = None + """the vm ip address for the port forwarding rule""" + self.vmguestip = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPortableIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPortableIpRange.py new file mode 100644 index 00000000000..2936ec148f2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createPortableIpRange.py @@ -0,0 +1,85 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""adds a range of portable public IP's to a region""" +from baseCmd import * +from baseResponse import * +class createPortableIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ending IP address in the portable IP range""" + """Required""" + self.endip = None + """the gateway for the portable IP range""" + """Required""" + self.gateway = None + """the netmask of the portable IP range""" + """Required""" + self.netmask = None + """Id of the Region""" + """Required""" + self.regionid = None + """the beginning IP address in the portable IP range""" + """Required""" + self.startip = None + """VLAN id, if not specified defaulted to untagged""" + self.vlan = None + self.required = ["endip","gateway","netmask","regionid","startip",] + +class createPortableIpRangeResponse (baseResponse): + def __init__(self): + """portable IP range ID""" + self.id = None + """the end ip of the portable IP range""" + self.endip = None + """the gateway of the VLAN IP range""" + self.gateway = None + """the netmask of the VLAN IP range""" + self.netmask = None + """Region Id in which portable ip range is provisioned""" + self.regionid = None + """the start ip of the portable IP range""" + self.startip = None + """the ID or VID of the VLAN.""" + self.vlan = None + """List of portable IP and association with zone/network/vpc details that are part of GSLB rule""" + self.portableipaddress = [] + +class portableipaddress: + def __init__(self): + """"the account ID the portable IP address is associated with""" + self.accountid = None + """"date the portal IP address was acquired""" + self.allocated = None + """"the domain ID the portable IP address is associated with""" + self.domainid = None + """"public IP address""" + self.ipaddress = None + """"the ID of the Network where ip belongs to""" + self.networkid = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"Region Id in which global load balancer is created""" + self.regionid = None + """"State of the ip address. Can be: Allocatin, Allocated and Releasing""" + self.state = None + """"VPC the ip belongs to""" + self.vpcid = None + """"the ID of the zone the public IP address belongs to""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPrivateGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPrivateGateway.py new file mode 100644 index 00000000000..3759a9838f2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createPrivateGateway.py @@ -0,0 +1,86 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a private gateway""" +from baseCmd import * +from baseResponse import * +class createPrivateGatewayCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the gateway of the Private gateway""" + """Required""" + self.gateway = None + """the IP address of the Private gateaway""" + """Required""" + self.ipaddress = None + """the netmask of the Private gateway""" + """Required""" + self.netmask = None + """the network implementation uri for the private gateway""" + """Required""" + self.vlan = None + """the VPC network belongs to""" + """Required""" + self.vpcid = None + """the ID of the network ACL""" + self.aclid = None + """the uuid of the network offering to use for the private gateways network connection""" + self.networkofferingid = None + """the Physical Network ID the network belongs to""" + self.physicalnetworkid = None + """source NAT supported value. Default value false. If 'true' source NAT is enabled on the private gateway 'false': sourcenat is not supported""" + self.sourcenatsupported = None + self.required = ["gateway","ipaddress","netmask","vlan","vpcid",] + +class createPrivateGatewayResponse (baseResponse): + def __init__(self): + """the id of the private gateway""" + self.id = None + """the account associated with the private gateway""" + self.account = None + """ACL Id set for private gateway""" + self.aclid = None + """the domain associated with the private gateway""" + self.domain = None + """the ID of the domain associated with the private gateway""" + self.domainid = None + """the gateway""" + self.gateway = None + """the private gateway's ip address""" + self.ipaddress = None + """the private gateway's netmask""" + self.netmask = None + """the physical network id""" + self.physicalnetworkid = None + """the project name of the private gateway""" + self.project = None + """the project id of the private gateway""" + self.projectid = None + """Souce Nat enable status""" + self.sourcenatsupported = None + """State of the gateway, can be Creating, Ready, Deleting""" + self.state = None + """the network implementation uri for the private gateway""" + self.vlan = None + """VPC the private gateaway belongs to""" + self.vpcid = None + """zone id of the private gateway""" + self.zoneid = None + """the name of the zone the private gateway belongs to""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createProject.py new file mode 100644 index 00000000000..e4afd5e05ab --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createProject.py @@ -0,0 +1,148 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a project""" +from baseCmd import * +from baseResponse import * +class createProjectCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """display text of the project""" + """Required""" + self.displaytext = None + """name of the project""" + """Required""" + self.name = None + """account who will be Admin for the project""" + self.account = None + """domain ID of the account owning a project""" + self.domainid = None + self.required = ["displaytext","name",] + +class createProjectResponse (baseResponse): + def __init__(self): + """the id of the project""" + self.id = None + """the account name of the project's owner""" + self.account = None + """the total number of cpu cores available to be created for this project""" + self.cpuavailable = None + """the total number of cpu cores the project can own""" + self.cpulimit = None + """the total number of cpu cores owned by project""" + self.cputotal = None + """the displaytext of the project""" + self.displaytext = None + """the domain name where the project belongs to""" + self.domain = None + """the domain id the project belongs to""" + self.domainid = None + """the total number of public ip addresses available for this project to acquire""" + self.ipavailable = None + """the total number of public ip addresses this project can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this project""" + self.iptotal = None + """the total memory (in MB) available to be created for this project""" + self.memoryavailable = None + """the total memory (in MB) the project can own""" + self.memorylimit = None + """the total memory (in MB) owned by project""" + self.memorytotal = None + """the name of the project""" + self.name = None + """the total number of networks available to be created for this project""" + self.networkavailable = None + """the total number of networks the project can own""" + self.networklimit = None + """the total number of networks owned by project""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this project""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the project can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by project""" + self.primarystoragetotal = None + """the total secondary storage space (in GiB) available to be used for this project""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the project can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by project""" + self.secondarystoragetotal = None + """the total number of snapshots available for this project""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this project""" + self.snapshotlimit = None + """the total number of snapshots stored by this project""" + self.snapshottotal = None + """the state of the project""" + self.state = None + """the total number of templates available to be created by this project""" + self.templateavailable = None + """the total number of templates which can be created by this project""" + self.templatelimit = None + """the total number of templates which have been created by this project""" + self.templatetotal = None + """the total number of virtual machines available for this project to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this project""" + self.vmlimit = None + """the total number of virtual machines running for this project""" + self.vmrunning = None + """the total number of virtual machines stopped for this project""" + self.vmstopped = None + """the total number of virtual machines deployed by this project""" + self.vmtotal = None + """the total volume available for this project""" + self.volumeavailable = None + """the total volume which can be used by this project""" + self.volumelimit = None + """the total volume being used by this project""" + self.volumetotal = None + """the total number of vpcs available to be created for this project""" + self.vpcavailable = None + """the total number of vpcs the project can own""" + self.vpclimit = None + """the total number of vpcs owned by project""" + self.vpctotal = None + """the list of resource tags associated with vm""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createRemoteAccessVpn.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createRemoteAccessVpn.py new file mode 100644 index 00000000000..71f2f84688d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createRemoteAccessVpn.py @@ -0,0 +1,62 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a l2tp/ipsec remote access vpn""" +from baseCmd import * +from baseResponse import * +class createRemoteAccessVpnCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """public ip address id of the vpn server""" + """Required""" + self.publicipid = None + """an optional account for the VPN. Must be used with domainId.""" + self.account = None + """an optional domainId for the VPN. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """the range of ip addresses to allocate to vpn clients. The first ip in the range will be taken by the vpn server""" + self.iprange = None + """if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. Has value true by default""" + self.openfirewall = None + self.required = ["publicipid",] + +class createRemoteAccessVpnResponse (baseResponse): + def __init__(self): + """the id of the remote access vpn""" + self.id = None + """the account of the remote access vpn""" + self.account = None + """the domain name of the account of the remote access vpn""" + self.domain = None + """the domain id of the account of the remote access vpn""" + self.domainid = None + """the range of ips to allocate to the clients""" + self.iprange = None + """the ipsec preshared key""" + self.presharedkey = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the public ip address of the vpn server""" + self.publicip = None + """the public ip address of the vpn server""" + self.publicipid = None + """the state of the rule""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSSHKeyPair.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSSHKeyPair.py new file mode 100644 index 00000000000..9415566b5c9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createSSHKeyPair.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Create a new keypair and returns the private key""" +from baseCmd import * +from baseResponse import * +class createSSHKeyPairCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Name of the keypair""" + """Required""" + self.name = None + """an optional account for the ssh key. Must be used with domainId.""" + self.account = None + """an optional domainId for the ssh key. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """an optional project for the ssh key""" + self.projectid = None + self.required = ["name",] + +class createSSHKeyPairResponse (baseResponse): + def __init__(self): + """Fingerprint of the public key""" + self.fingerprint = None + """Name of the keypair""" + self.name = None + """Private key""" + self.privatekey = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSecondaryStagingStore.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSecondaryStagingStore.py new file mode 100644 index 00000000000..74fea7fb57a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createSecondaryStagingStore.py @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""create secondary staging store.""" +from baseCmd import * +from baseResponse import * +class createSecondaryStagingStoreCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the URL for the staging store""" + """Required""" + self.url = None + """the details for the staging store""" + self.details = [] + """the staging store provider name""" + self.provider = None + """the scope of the staging store: zone only for now""" + self.scope = None + """the Zone ID for the staging store""" + self.zoneid = None + self.required = ["url",] + +class createSecondaryStagingStoreResponse (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSecurityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSecurityGroup.py new file mode 100644 index 00000000000..321431c2720 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createSecurityGroup.py @@ -0,0 +1,131 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a security group""" +from baseCmd import * +from baseResponse import * +class createSecurityGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """name of the security group""" + """Required""" + self.name = None + """an optional account for the security group. Must be used with domainId.""" + self.account = None + """the description of the security group""" + self.description = None + """an optional domainId for the security group. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """Create security group for project""" + self.projectid = None + self.required = ["name",] + +class createSecurityGroupResponse (baseResponse): + def __init__(self): + """the ID of the security group""" + self.id = None + """the account owning the security group""" + self.account = None + """the description of the security group""" + self.description = None + """the domain name of the security group""" + self.domain = None + """the domain ID of the security group""" + self.domainid = None + """the name of the security group""" + self.name = None + """the project name of the group""" + self.project = None + """the project id of the group""" + self.projectid = None + """the list of egress rules associated with the security group""" + self.egressrule = [] + """the list of ingress rules associated with the security group""" + self.ingressrule = [] + """the list of resource tags associated with the rule""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createServiceOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createServiceOffering.py new file mode 100644 index 00000000000..a9f4f739aa8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createServiceOffering.py @@ -0,0 +1,151 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a service offering.""" +from baseCmd import * +from baseResponse import * +class createServiceOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the CPU number of the service offering""" + """Required""" + self.cpunumber = None + """the CPU speed of the service offering in MHz.""" + """Required""" + self.cpuspeed = None + """the display text of the service offering""" + """Required""" + self.displaytext = None + """the total memory of the service offering in MB""" + """Required""" + self.memory = None + """the name of the service offering""" + """Required""" + self.name = None + """bytes read rate of the disk offering""" + self.bytesreadrate = None + """bytes write rate of the disk offering""" + self.byteswriterate = None + """The deployment planner heuristics used to deploy a VM of this offering. If null, value of global config vm.deployment.planner is used""" + self.deploymentplanner = None + """the ID of the containing domain, null for public offerings""" + self.domainid = None + """the host tag for this service offering.""" + self.hosttags = None + """io requests read rate of the disk offering""" + self.iopsreadrate = None + """io requests write rate of the disk offering""" + self.iopswriterate = None + """is this a system vm offering""" + self.issystem = None + """true if the virtual machine needs to be volatile so that on every reboot of VM, original root disk is dettached then destroyed and a fresh root disk is created and attached to VM""" + self.isvolatile = None + """restrict the CPU usage to committed service offering""" + self.limitcpuuse = None + """data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having "domainrouter" systemvmtype""" + self.networkrate = None + """the HA for the service offering""" + self.offerha = None + """details for planner, used to store specific parameters""" + self.serviceofferingdetails = [] + """the storage type of the service offering. Values are local and shared.""" + self.storagetype = None + """the system VM type. Possible types are "domainrouter", "consoleproxy" and "secondarystoragevm".""" + self.systemvmtype = None + """the tags for this service offering.""" + self.tags = None + self.required = ["cpunumber","cpuspeed","displaytext","memory","name",] + +class createServiceOfferingResponse (baseResponse): + def __init__(self): + """the id of the service offering""" + self.id = None + """the number of CPU""" + self.cpunumber = None + """the clock rate CPU speed in Mhz""" + self.cpuspeed = None + """the date this service offering was created""" + self.created = None + """is this a default system vm offering""" + self.defaultuse = None + """deployment strategy used to deploy VM.""" + self.deploymentplanner = None + """bytes read rate of the service offering""" + self.diskBytesReadRate = None + """bytes write rate of the service offering""" + self.diskBytesWriteRate = None + """io requests read rate of the service offering""" + self.diskIopsReadRate = None + """io requests write rate of the service offering""" + self.diskIopsWriteRate = None + """an alternate display text of the service offering.""" + self.displaytext = None + """Domain name for the offering""" + self.domain = None + """the domain id of the service offering""" + self.domainid = None + """the host tag for the service offering""" + self.hosttags = None + """is this a system vm offering""" + self.issystem = None + """true if the vm needs to be volatile, i.e., on every reboot of vm from API root disk is discarded and creates a new root disk""" + self.isvolatile = None + """restrict the CPU usage to committed service offering""" + self.limitcpuuse = None + """the memory in MB""" + self.memory = None + """the name of the service offering""" + self.name = None + """data transfer rate in megabits per second allowed.""" + self.networkrate = None + """the ha support in the service offering""" + self.offerha = None + """additional key/value details tied with this service offering""" + self.serviceofferingdetails = None + """the storage type for this service offering""" + self.storagetype = None + """is this a the systemvm type for system vm offering""" + self.systemvmtype = None + """the tags for the service offering""" + self.tags = None + """the list of resource tags associated with service offering. The resource tags are not used for Volume/VM placement on the specific host.""" + self.resourcetags = [] + +class resourcetags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshot.py new file mode 100644 index 00000000000..2ea1a0d12b8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshot.py @@ -0,0 +1,97 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates an instant snapshot of a volume.""" +from baseCmd import * +from baseResponse import * +class createSnapshotCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the disk volume""" + """Required""" + self.volumeid = None + """The account of the snapshot. The account parameter must be used with the domainId parameter.""" + self.account = None + """The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume.""" + self.domainid = None + """policy id of the snapshot, if this is null, then use MANUAL_POLICY.""" + self.policyid = None + self.required = ["volumeid",] + +class createSnapshotResponse (baseResponse): + def __init__(self): + """ID of the snapshot""" + self.id = None + """the account associated with the snapshot""" + self.account = None + """the date the snapshot was created""" + self.created = None + """the domain name of the snapshot's account""" + self.domain = None + """the domain ID of the snapshot's account""" + self.domainid = None + """valid types are hourly, daily, weekly, monthy, template, and none.""" + self.intervaltype = None + """name of the snapshot""" + self.name = None + """the project name of the snapshot""" + self.project = None + """the project id of the snapshot""" + self.projectid = None + """the type of the snapshot""" + self.snapshottype = None + """the state of the snapshot. BackedUp means that snapshot is ready to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp - the snapshot is being backed up on secondary storage""" + self.state = None + """ID of the disk volume""" + self.volumeid = None + """name of the disk volume""" + self.volumename = None + """type of the disk volume""" + self.volumetype = None + """id of the availability zone""" + self.zoneid = None + """the list of resource tags associated with snapshot""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshotPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshotPolicy.py new file mode 100644 index 00000000000..f0eb86525de --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshotPolicy.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a snapshot policy for the account.""" +from baseCmd import * +from baseResponse import * +class createSnapshotPolicyCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """valid values are HOURLY, DAILY, WEEKLY, and MONTHLY""" + """Required""" + self.intervaltype = None + """maximum number of snapshots to retain""" + """Required""" + self.maxsnaps = None + """time the snapshot is scheduled to be taken. Format is:* if HOURLY, MM* if DAILY, MM:HH* if WEEKLY, MM:HH:DD (1-7)* if MONTHLY, MM:HH:DD (1-28)""" + """Required""" + self.schedule = None + """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" + """Required""" + self.timezone = None + """the ID of the disk volume""" + """Required""" + self.volumeid = None + self.required = ["intervaltype","maxsnaps","schedule","timezone","volumeid",] + +class createSnapshotPolicyResponse (baseResponse): + def __init__(self): + """the ID of the snapshot policy""" + self.id = None + """the interval type of the snapshot policy""" + self.intervaltype = None + """maximum number of snapshots retained""" + self.maxsnaps = None + """time the snapshot is scheduled to be taken.""" + self.schedule = None + """the time zone of the snapshot policy""" + self.timezone = None + """the ID of the disk volume""" + self.volumeid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createStaticRoute.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createStaticRoute.py new file mode 100644 index 00000000000..1a58ccda510 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createStaticRoute.py @@ -0,0 +1,80 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a static route""" +from baseCmd import * +from baseResponse import * +class createStaticRouteCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """static route cidr""" + """Required""" + self.cidr = None + """the gateway id we are creating static route for""" + """Required""" + self.gatewayid = None + self.required = ["cidr","gatewayid",] + +class createStaticRouteResponse (baseResponse): + def __init__(self): + """the ID of static route""" + self.id = None + """the account associated with the static route""" + self.account = None + """static route CIDR""" + self.cidr = None + """the domain associated with the static route""" + self.domain = None + """the ID of the domain associated with the static route""" + self.domainid = None + """VPC gateway the route is created for""" + self.gatewayid = None + """the project name of the static route""" + self.project = None + """the project id of the static route""" + self.projectid = None + """the state of the static route""" + self.state = None + """VPC the static route belongs to""" + self.vpcid = None + """the list of resource tags associated with static route""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createStorageNetworkIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createStorageNetworkIpRange.py new file mode 100644 index 00000000000..8e695dae42e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createStorageNetworkIpRange.py @@ -0,0 +1,63 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a Storage network IP range.""" +from baseCmd import * +from baseResponse import * +class createStorageNetworkIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the gateway for storage network""" + """Required""" + self.gateway = None + """the netmask for storage network""" + """Required""" + self.netmask = None + """UUID of pod where the ip range belongs to""" + """Required""" + self.podid = None + """the beginning IP address""" + """Required""" + self.startip = None + """the ending IP address""" + self.endip = None + """Optional. The vlan the ip range sits on, default to Null when it is not specificed which means you network is not on any Vlan. This is mainly for Vmware as other hypervisors can directly reterive bridge from pyhsical network traffic type table""" + self.vlan = None + self.required = ["gateway","netmask","podid","startip",] + +class createStorageNetworkIpRangeResponse (baseResponse): + def __init__(self): + """the uuid of storage network IP range.""" + self.id = None + """the end ip of the storage network IP range""" + self.endip = None + """the gateway of the storage network IP range""" + self.gateway = None + """the netmask of the storage network IP range""" + self.netmask = None + """the network uuid of storage network IP range""" + self.networkid = None + """the Pod uuid for the storage network IP range""" + self.podid = None + """the start ip of the storage network IP range""" + self.startip = None + """the ID or VID of the VLAN.""" + self.vlan = None + """the Zone uuid of the storage network IP range""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createStoragePool.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createStoragePool.py new file mode 100644 index 00000000000..1186e766bb7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createStoragePool.py @@ -0,0 +1,104 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a storage pool.""" +from baseCmd import * +from baseResponse import * +class createStoragePoolCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the name for the storage pool""" + """Required""" + self.name = None + """the URL of the storage pool""" + """Required""" + self.url = None + """the Zone ID for the storage pool""" + """Required""" + self.zoneid = None + """bytes CloudStack can provision from this storage pool""" + self.capacitybytes = None + """IOPS CloudStack can provision from this storage pool""" + self.capacityiops = None + """the cluster ID for the storage pool""" + self.clusterid = None + """the details for the storage pool""" + self.details = [] + """hypervisor type of the hosts in zone that will be attached to this storage pool. KVM, VMware supported as of now.""" + self.hypervisor = None + """whether the storage should be managed by CloudStack""" + self.managed = None + """the Pod ID for the storage pool""" + self.podid = None + """the storage provider name""" + self.provider = None + """the scope of the storage: cluster or zone""" + self.scope = None + """the tags for the storage pool""" + self.tags = None + self.required = ["name","url","zoneid",] + +class createStoragePoolResponse (baseResponse): + def __init__(self): + """the ID of the storage pool""" + self.id = None + """IOPS CloudStack can provision from this storage pool""" + self.capacityiops = None + """the ID of the cluster for the storage pool""" + self.clusterid = None + """the name of the cluster for the storage pool""" + self.clustername = None + """the date and time the storage pool was created""" + self.created = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the storage pool""" + self.disksizetotal = None + """the host's currently used disk size""" + self.disksizeused = None + """the hypervisor type of the storage pool""" + self.hypervisor = None + """the IP address of the storage pool""" + self.ipaddress = None + """the name of the storage pool""" + self.name = None + """the storage pool path""" + self.path = None + """the Pod ID of the storage pool""" + self.podid = None + """the Pod name of the storage pool""" + self.podname = None + """the scope of the storage pool""" + self.scope = None + """the state of the storage pool""" + self.state = None + """true if this pool is suitable to migrate a volume, false otherwise""" + self.suitableformigration = None + """the tags for the storage pool""" + self.tags = None + """the storage pool type""" + self.type = None + """the Zone ID of the storage pool""" + self.zoneid = None + """the Zone name of the storage pool""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createTags.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createTags.py new file mode 100644 index 00000000000..f380b527b62 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createTags.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates resource tag(s)""" +from baseCmd import * +from baseResponse import * +class createTagsCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """list of resources to create the tags for""" + """Required""" + self.resourceids = [] + """type of the resource""" + """Required""" + self.resourcetype = None + """Map of tags (key/value pairs)""" + """Required""" + self.tags = [] + """identifies client specific tag. When the value is not null, the tag can't be used by cloudStack code internally""" + self.customer = None + self.required = ["resourceids","resourcetype","tags",] + +class createTagsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createTemplate.py new file mode 100644 index 00000000000..cfb848cab49 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createTemplate.py @@ -0,0 +1,161 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a template of a virtual machine. The virtual machine must be in a STOPPED state. A template created from this command is automatically designated as a private template visible to the account that created it.""" +from baseCmd import * +from baseResponse import * +class createTemplateCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the display text of the template. This is usually used for display purposes.""" + """Required""" + self.displaytext = None + """the name of the template""" + """Required""" + self.name = None + """the ID of the OS Type that best represents the OS of this template.""" + """Required""" + self.ostypeid = None + """32 or 64 bit""" + self.bits = None + """Template details in key/value pairs.""" + self.details = [] + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template supports the password reset feature; default is false""" + self.passwordenabled = None + """true if the template requres HVM, false otherwise""" + self.requireshvm = None + """the ID of the snapshot the template is being created from. Either this parameter, or volumeId has to be passed in""" + self.snapshotid = None + """the tag for this template.""" + self.templatetag = None + """Optional, only for baremetal hypervisor. The directory name where template stored on CIFS server""" + self.url = None + """Optional, VM ID. If this presents, it is going to create a baremetal template for VM this ID refers to. This is only for VM whose hypervisor type is BareMetal""" + self.virtualmachineid = None + """the ID of the disk volume the template is being created from. Either this parameter, or snapshotId has to be passed in""" + self.volumeid = None + self.required = ["displaytext","name","ostypeid",] + +class createTemplateResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createUser.py new file mode 100644 index 00000000000..0914db87542 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createUser.py @@ -0,0 +1,87 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a user for an account that already exists""" +from baseCmd import * +from baseResponse import * +class createUserCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Creates the user under the specified account. If no account is specified, the username will be used as the account name.""" + """Required""" + self.account = None + """email""" + """Required""" + self.email = None + """firstname""" + """Required""" + self.firstname = None + """lastname""" + """Required""" + self.lastname = None + """Clear text password (Default hashed to SHA256SALT). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.""" + """Required""" + self.password = None + """Unique username.""" + """Required""" + self.username = None + """Creates the user under the specified domain. Has to be accompanied with the account parameter""" + self.domainid = None + """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" + self.timezone = None + """User UUID, required for adding account from external provisioning system""" + self.userid = None + self.required = ["account","email","firstname","lastname","password","username",] + +class createUserResponse (baseResponse): + def __init__(self): + """the user ID""" + self.id = None + """the account name of the user""" + self.account = None + """the account ID of the user""" + self.accountid = None + """the account type of the user""" + self.accounttype = None + """the api key of the user""" + self.apikey = None + """the date and time the user account was created""" + self.created = None + """the domain name of the user""" + self.domain = None + """the domain ID of the user""" + self.domainid = None + """the user email address""" + self.email = None + """the user firstname""" + self.firstname = None + """the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """true if user is default, false otherwise""" + self.isdefault = None + """the user lastname""" + self.lastname = None + """the secret key of the user""" + self.secretkey = None + """the user state""" + self.state = None + """the timezone user was created in""" + self.timezone = None + """the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVMSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVMSnapshot.py new file mode 100644 index 00000000000..36366748f04 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVMSnapshot.py @@ -0,0 +1,72 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates snapshot for a vm.""" +from baseCmd import * +from baseResponse import * +class createVMSnapshotCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the vm""" + """Required""" + self.virtualmachineid = None + """The discription of the snapshot""" + self.description = None + """The display name of the snapshot""" + self.name = None + """snapshot memory if true""" + self.snapshotmemory = None + self.required = ["virtualmachineid",] + +class createVMSnapshotResponse (baseResponse): + def __init__(self): + """the ID of the vm snapshot""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the create date of the vm snapshot""" + self.created = None + """indiates if this is current snapshot""" + self.current = None + """the description of the vm snapshot""" + self.description = None + """the display name of the vm snapshot""" + self.displayname = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """the name of the vm snapshot""" + self.name = None + """the parent ID of the vm snapshot""" + self.parent = None + """the parent displayName of the vm snapshot""" + self.parentName = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the state of the vm snapshot""" + self.state = None + """VM Snapshot type""" + self.type = None + """the vm ID of the vm snapshot""" + self.virtualmachineid = None + """the Zone ID of the vm snapshot""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVPC.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVPC.py new file mode 100644 index 00000000000..5307f8a619a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVPC.py @@ -0,0 +1,413 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a VPC""" +from baseCmd import * +from baseResponse import * +class createVPCCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the cidr of the VPC. All VPC guest networks' cidrs should be within this CIDR""" + """Required""" + self.cidr = None + """the display text of the VPC""" + """Required""" + self.displaytext = None + """the name of the VPC""" + """Required""" + self.name = None + """the ID of the VPC offering""" + """Required""" + self.vpcofferingid = None + """the ID of the availability zone""" + """Required""" + self.zoneid = None + """the account associated with the VPC. Must be used with the domainId parameter.""" + self.account = None + """the domain ID associated with the VPC. If used with the account parameter returns the VPC associated with the account for the specified domain.""" + self.domainid = None + """VPC network domain. All networks inside the VPC will belong to this domain""" + self.networkdomain = None + """create VPC for the project""" + self.projectid = None + self.required = ["cidr","displaytext","name","vpcofferingid","zoneid",] + +class createVPCResponse (baseResponse): + def __init__(self): + """the id of the VPC""" + self.id = None + """the owner of the VPC""" + self.account = None + """the cidr the VPC""" + self.cidr = None + """the date this VPC was created""" + self.created = None + """an alternate display text of the VPC.""" + self.displaytext = None + """the domain name of the owner""" + self.domain = None + """the domain id of the VPC owner""" + self.domainid = None + """the name of the VPC""" + self.name = None + """the network domain of the VPC""" + self.networkdomain = None + """the project name of the VPC""" + self.project = None + """the project id of the VPC""" + self.projectid = None + """true VPC requires restart""" + self.restartrequired = None + """state of the VPC. Can be Inactive/Enabled""" + self.state = None + """vpc offering id the VPC is created from""" + self.vpcofferingid = None + """zone id of the vpc""" + self.zoneid = None + """the name of the zone the VPC belongs to""" + self.zonename = None + """the list of networks belongign to the VPC""" + self.network = [] + """the list of supported services""" + self.service = [] + """the list of resource tags associated with the project""" + self.tags = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class network: + def __init__(self): + """"the id of the network""" + self.id = None + """"the owner of the network""" + self.account = None + """"ACL Id associated with the VPC network""" + self.aclid = None + """"acl type - access type to the network""" + self.acltype = None + """"Broadcast domain type of the network""" + self.broadcastdomaintype = None + """"broadcast uri of the network. This parameter is visible to ROOT admins only""" + self.broadcasturi = None + """"list networks available for vm deployment""" + self.canusefordeploy = None + """"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" + self.cidr = None + """"an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """"the displaytext of the network""" + self.displaytext = None + """"the first DNS for the network""" + self.dns1 = None + """"the second DNS for the network""" + self.dns2 = None + """"the domain name of the network owner""" + self.domain = None + """"the domain id of the network owner""" + self.domainid = None + """"the network's gateway""" + self.gateway = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"true if network is default, false otherwise""" + self.isdefault = None + """"list networks that are persistent""" + self.ispersistent = None + """"true if network is system, false otherwise""" + self.issystem = None + """"the name of the network""" + self.name = None + """"the network's netmask""" + self.netmask = None + """"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" + self.networkcidr = None + """"the network domain""" + self.networkdomain = None + """"availability of the network offering the network is created from""" + self.networkofferingavailability = None + """"true if network offering is ip conserve mode enabled""" + self.networkofferingconservemode = None + """"display text of the network offering the network is created from""" + self.networkofferingdisplaytext = None + """"network offering id the network is created from""" + self.networkofferingid = None + """"name of the network offering the network is created from""" + self.networkofferingname = None + """"the physical network id""" + self.physicalnetworkid = None + """"the project name of the address""" + self.project = None + """"the project id of the ipaddress""" + self.projectid = None + """"related to what other network configuration""" + self.related = None + """"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" + self.reservediprange = None + """"true network requires restart""" + self.restartrequired = None + """"true if network supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """"state of the network""" + self.state = None + """"true if users from subdomains can access the domain level network""" + self.subdomainaccess = None + """"the traffic type of the network""" + self.traffictype = None + """"the type of the network""" + self.type = None + """"The vlan of the network. This parameter is visible to ROOT admins only""" + self.vlan = None + """"VPC the network belongs to""" + self.vpcid = None + """"zone id of the network""" + self.zoneid = None + """"the name of the zone the network belongs to""" + self.zonename = None + """"the list of services""" + self.service = [] + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + """"the list of resource tags associated with network""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVPCOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVPCOffering.py new file mode 100644 index 00000000000..e36234e048f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVPCOffering.py @@ -0,0 +1,109 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates VPC offering""" +from baseCmd import * +from baseResponse import * +class createVPCOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the display text of the vpc offering""" + """Required""" + self.displaytext = None + """the name of the vpc offering""" + """Required""" + self.name = None + """services supported by the vpc offering""" + """Required""" + self.supportedservices = [] + """provider to service mapping. If not specified, the provider for the service will be mapped to the default provider on the physical network""" + self.serviceproviderlist = [] + self.required = ["displaytext","name","supportedservices",] + +class createVPCOfferingResponse (baseResponse): + def __init__(self): + """the id of the vpc offering""" + self.id = None + """the date this vpc offering was created""" + self.created = None + """an alternate display text of the vpc offering.""" + self.displaytext = None + """true if vpc offering is default, false otherwise""" + self.isdefault = None + """the name of the vpc offering""" + self.name = None + """state of the vpc offering. Can be Disabled/Enabled""" + self.state = None + """the list of supported services""" + self.service = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVirtualRouterElement.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVirtualRouterElement.py new file mode 100644 index 00000000000..9c1d48b9523 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVirtualRouterElement.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Create a virtual router element.""" +from baseCmd import * +from baseResponse import * +class createVirtualRouterElementCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the network service provider ID of the virtual router element""" + """Required""" + self.nspid = None + """The provider type. Supported types are VirtualRouter (default) and VPCVirtualRouter""" + self.providertype = None + self.required = ["nspid",] + +class createVirtualRouterElementResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the provider""" + self.account = None + """the domain associated with the provider""" + self.domain = None + """the domain ID associated with the provider""" + self.domainid = None + """Enabled/Disabled the service provider""" + self.enabled = None + """the physical network service provider id of the provider""" + self.nspid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVlanIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVlanIpRange.py new file mode 100644 index 00000000000..0a16e334ef9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVlanIpRange.py @@ -0,0 +1,107 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a VLAN IP range.""" +from baseCmd import * +from baseResponse import * +class createVlanIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """account who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited""" + self.account = None + """domain ID of the account owning a VLAN""" + self.domainid = None + """the ending IP address in the VLAN IP range""" + self.endip = None + """the ending IPv6 address in the IPv6 network range""" + self.endipv6 = None + """true if VLAN is of Virtual type, false if Direct""" + self.forvirtualnetwork = None + """the gateway of the VLAN IP range""" + self.gateway = None + """the CIDR of IPv6 network, must be at least /64""" + self.ip6cidr = None + """the gateway of the IPv6 network. Required for Shared networks and Isolated networks when it belongs to VPC""" + self.ip6gateway = None + """the netmask of the VLAN IP range""" + self.netmask = None + """the network id""" + self.networkid = None + """the physical network id""" + self.physicalnetworkid = None + """optional parameter. Have to be specified for Direct Untagged vlan only.""" + self.podid = None + """project who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited""" + self.projectid = None + """the beginning IP address in the VLAN IP range""" + self.startip = None + """the beginning IPv6 address in the IPv6 network range""" + self.startipv6 = None + """the ID or VID of the VLAN. If not specified, will be defaulted to the vlan of the network or if vlan of the network is null - to Untagged""" + self.vlan = None + """the Zone ID of the VLAN IP range""" + self.zoneid = None + self.required = [] + +class createVlanIpRangeResponse (baseResponse): + def __init__(self): + """the ID of the VLAN IP range""" + self.id = None + """the account of the VLAN IP range""" + self.account = None + """the description of the VLAN IP range""" + self.description = None + """the domain name of the VLAN IP range""" + self.domain = None + """the domain ID of the VLAN IP range""" + self.domainid = None + """the end ip of the VLAN IP range""" + self.endip = None + """the end ipv6 of the VLAN IP range""" + self.endipv6 = None + """the virtual network for the VLAN IP range""" + self.forvirtualnetwork = None + """the gateway of the VLAN IP range""" + self.gateway = None + """the cidr of IPv6 network""" + self.ip6cidr = None + """the gateway of IPv6 network""" + self.ip6gateway = None + """the netmask of the VLAN IP range""" + self.netmask = None + """the network id of vlan range""" + self.networkid = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """the Pod ID for the VLAN IP range""" + self.podid = None + """the Pod name for the VLAN IP range""" + self.podname = None + """the project name of the vlan range""" + self.project = None + """the project id of the vlan range""" + self.projectid = None + """the start ip of the VLAN IP range""" + self.startip = None + """the start ipv6 of the VLAN IP range""" + self.startipv6 = None + """the ID or VID of the VLAN.""" + self.vlan = None + """the Zone ID of the VLAN IP range""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVolume.py new file mode 100644 index 00000000000..4b6f91a20d7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVolume.py @@ -0,0 +1,163 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.""" +from baseCmd import * +from baseResponse import * +class createVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the name of the disk volume""" + """Required""" + self.name = None + """the account associated with the disk volume. Must be used with the domainId parameter.""" + self.account = None + """the ID of the disk offering. Either diskOfferingId or snapshotId must be passed in.""" + self.diskofferingid = None + """an optional field, whether to display the volume to the end user or not.""" + self.displayvolume = None + """the domain ID associated with the disk offering. If used with the account parameter returns the disk volume associated with the account for the specified domain.""" + self.domainid = None + """max iops""" + self.maxiops = None + """min iops""" + self.miniops = None + """the project associated with the volume. Mutually exclusive with account parameter""" + self.projectid = None + """Arbitrary volume size""" + self.size = None + """the snapshot ID for the disk volume. Either diskOfferingId or snapshotId must be passed in.""" + self.snapshotid = None + """the ID of the availability zone""" + self.zoneid = None + self.required = ["name",] + +class createVolumeResponse (baseResponse): + def __init__(self): + """ID of the disk volume""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the date the volume was attached to a VM instance""" + self.attached = None + """the date the disk volume was created""" + self.created = None + """the boolean state of whether the volume is destroyed or not""" + self.destroyed = None + """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" + self.deviceid = None + """bytes read rate of the disk volume""" + self.diskBytesReadRate = None + """bytes write rate of the disk volume""" + self.diskBytesWriteRate = None + """io requests read rate of the disk volume""" + self.diskIopsReadRate = None + """io requests write rate of the disk volume""" + self.diskIopsWriteRate = None + """the display text of the disk offering""" + self.diskofferingdisplaytext = None + """ID of the disk offering""" + self.diskofferingid = None + """name of the disk offering""" + self.diskofferingname = None + """an optional field whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """Hypervisor the volume belongs to""" + self.hypervisor = None + """true if the volume is extractable, false otherwise""" + self.isextractable = None + """max iops of the disk volume""" + self.maxiops = None + """min iops of the disk volume""" + self.miniops = None + """name of the disk volume""" + self.name = None + """The path of the volume""" + self.path = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the display text of the service offering for root disk""" + self.serviceofferingdisplaytext = None + """ID of the service offering for root disk""" + self.serviceofferingid = None + """name of the service offering for root disk""" + self.serviceofferingname = None + """size of the disk volume""" + self.size = None + """ID of the snapshot from which this volume was created""" + self.snapshotid = None + """the state of the disk volume""" + self.state = None + """the status of the volume""" + self.status = None + """name of the primary storage hosting the disk volume""" + self.storage = None + """id of the primary storage hosting the disk volume; returned to admin user only""" + self.storageid = None + """shared or local storage""" + self.storagetype = None + """type of the disk volume (ROOT or DATADISK)""" + self.type = None + """id of the virtual machine""" + self.virtualmachineid = None + """display name of the virtual machine""" + self.vmdisplayname = None + """name of the virtual machine""" + self.vmname = None + """state of the virtual machine""" + self.vmstate = None + """ID of the availability zone""" + self.zoneid = None + """name of the availability zone""" + self.zonename = None + """the list of resource tags associated with volume""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnConnection.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnConnection.py new file mode 100644 index 00000000000..7e8cf7b1af4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnConnection.py @@ -0,0 +1,75 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Create site to site vpn connection""" +from baseCmd import * +from baseResponse import * +class createVpnConnectionCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of the customer gateway""" + """Required""" + self.s2scustomergatewayid = None + """id of the vpn gateway""" + """Required""" + self.s2svpngatewayid = None + self.required = ["s2scustomergatewayid","s2svpngatewayid",] + +class createVpnConnectionResponse (baseResponse): + def __init__(self): + """the vpn gateway ID""" + self.id = None + """the owner""" + self.account = None + """guest cidr list of the customer gateway""" + self.cidrlist = None + """the date and time the host was created""" + self.created = None + """the domain name of the owner""" + self.domain = None + """the domain id of the owner""" + self.domainid = None + """if DPD is enabled for customer gateway""" + self.dpd = None + """Lifetime of ESP SA of customer gateway""" + self.esplifetime = None + """ESP policy of the customer gateway""" + self.esppolicy = None + """public ip address id of the customer gateway""" + self.gateway = None + """Lifetime of IKE SA of customer gateway""" + self.ikelifetime = None + """IKE policy of the customer gateway""" + self.ikepolicy = None + """IPsec Preshared-Key of the customer gateway""" + self.ipsecpsk = None + """the project name""" + self.project = None + """the project id""" + self.projectid = None + """the public IP address""" + self.publicip = None + """the date and time the host was removed""" + self.removed = None + """the customer gateway ID""" + self.s2scustomergatewayid = None + """the vpn gateway ID""" + self.s2svpngatewayid = None + """State of vpn connection""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnCustomerGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnCustomerGateway.py new file mode 100644 index 00000000000..14d94bc744a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnCustomerGateway.py @@ -0,0 +1,90 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates site to site vpn customer gateway""" +from baseCmd import * +from baseResponse import * +class createVpnCustomerGatewayCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """guest cidr list of the customer gateway""" + """Required""" + self.cidrlist = None + """ESP policy of the customer gateway""" + """Required""" + self.esppolicy = None + """public ip address id of the customer gateway""" + """Required""" + self.gateway = None + """IKE policy of the customer gateway""" + """Required""" + self.ikepolicy = None + """IPsec Preshared-Key of the customer gateway""" + """Required""" + self.ipsecpsk = None + """the account associated with the gateway. Must be used with the domainId parameter.""" + self.account = None + """the domain ID associated with the gateway. If used with the account parameter returns the gateway associated with the account for the specified domain.""" + self.domainid = None + """If DPD is enabled for VPN connection""" + self.dpd = None + """Lifetime of phase 2 VPN connection to the customer gateway, in seconds""" + self.esplifetime = None + """Lifetime of phase 1 VPN connection to the customer gateway, in seconds""" + self.ikelifetime = None + """name of this customer gateway""" + self.name = None + self.required = ["cidrlist","esppolicy","gateway","ikepolicy","ipsecpsk",] + +class createVpnCustomerGatewayResponse (baseResponse): + def __init__(self): + """the vpn gateway ID""" + self.id = None + """the owner""" + self.account = None + """guest cidr list of the customer gateway""" + self.cidrlist = None + """the domain name of the owner""" + self.domain = None + """the domain id of the owner""" + self.domainid = None + """if DPD is enabled for customer gateway""" + self.dpd = None + """Lifetime of ESP SA of customer gateway""" + self.esplifetime = None + """IPsec policy of customer gateway""" + self.esppolicy = None + """public ip address id of the customer gateway""" + self.gateway = None + """Lifetime of IKE SA of customer gateway""" + self.ikelifetime = None + """IKE policy of customer gateway""" + self.ikepolicy = None + """guest ip of the customer gateway""" + self.ipaddress = None + """IPsec preshared-key of customer gateway""" + self.ipsecpsk = None + """name of the customer gateway""" + self.name = None + """the project name""" + self.project = None + """the project id""" + self.projectid = None + """the date and time the host was removed""" + self.removed = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnGateway.py new file mode 100644 index 00000000000..918c55f5d51 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnGateway.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates site to site vpn local gateway""" +from baseCmd import * +from baseResponse import * +class createVpnGatewayCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """public ip address id of the vpn gateway""" + """Required""" + self.vpcid = None + self.required = ["vpcid",] + +class createVpnGatewayResponse (baseResponse): + def __init__(self): + """the vpn gateway ID""" + self.id = None + """the owner""" + self.account = None + """the domain name of the owner""" + self.domain = None + """the domain id of the owner""" + self.domainid = None + """the project name""" + self.project = None + """the project id""" + self.projectid = None + """the public IP address""" + self.publicip = None + """the date and time the host was removed""" + self.removed = None + """the vpc id of this gateway""" + self.vpcid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createZone.py new file mode 100644 index 00000000000..364eeba6b77 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/createZone.py @@ -0,0 +1,153 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a Zone.""" +from baseCmd import * +from baseResponse import * +class createZoneCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the first DNS for the Zone""" + """Required""" + self.dns1 = None + """the first internal DNS for the Zone""" + """Required""" + self.internaldns1 = None + """the name of the Zone""" + """Required""" + self.name = None + """network type of the zone, can be Basic or Advanced""" + """Required""" + self.networktype = None + """Allocation state of this Zone for allocation of new resources""" + self.allocationstate = None + """the second DNS for the Zone""" + self.dns2 = None + """Network domain name for the networks in the zone""" + self.domain = None + """the ID of the containing domain, null for public zones""" + self.domainid = None + """the guest CIDR address for the Zone""" + self.guestcidraddress = None + """the second internal DNS for the Zone""" + self.internaldns2 = None + """the first DNS for IPv6 network in the Zone""" + self.ip6dns1 = None + """the second DNS for IPv6 network in the Zone""" + self.ip6dns2 = None + """true if local storage offering enabled, false otherwise""" + self.localstorageenabled = None + """true if network is security group enabled, false otherwise""" + self.securitygroupenabled = None + self.required = ["dns1","internaldns1","name","networktype",] + +class createZoneResponse (baseResponse): + def __init__(self): + """Zone id""" + self.id = None + """the allocation state of the cluster""" + self.allocationstate = None + """Zone description""" + self.description = None + """the dhcp Provider for the Zone""" + self.dhcpprovider = None + """the display text of the zone""" + self.displaytext = None + """the first DNS for the Zone""" + self.dns1 = None + """the second DNS for the Zone""" + self.dns2 = None + """Network domain name for the networks in the zone""" + self.domain = None + """the UUID of the containing domain, null for public zones""" + self.domainid = None + """the name of the containing domain, null for public zones""" + self.domainname = None + """the guest CIDR address for the Zone""" + self.guestcidraddress = None + """the first internal DNS for the Zone""" + self.internaldns1 = None + """the second internal DNS for the Zone""" + self.internaldns2 = None + """the first IPv6 DNS for the Zone""" + self.ip6dns1 = None + """the second IPv6 DNS for the Zone""" + self.ip6dns2 = None + """true if local storage offering enabled, false otherwise""" + self.localstorageenabled = None + """Zone name""" + self.name = None + """the network type of the zone; can be Basic or Advanced""" + self.networktype = None + """true if security groups support is enabled, false otherwise""" + self.securitygroupsenabled = None + """the vlan range of the zone""" + self.vlan = None + """Zone Token""" + self.zonetoken = None + """the capacity of the Zone""" + self.capacity = [] + """the list of resource tags associated with zone.""" + self.tags = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateCluster.py new file mode 100644 index 00000000000..e52e2330e97 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateCluster.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Dedicate an existing cluster""" +from baseCmd import * +from baseResponse import * +class dedicateClusterCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the Cluster""" + """Required""" + self.clusterid = None + """the ID of the containing domain""" + """Required""" + self.domainid = None + """the name of the account which needs dedication. Must be used with domainId.""" + self.account = None + self.required = ["clusterid","domainid",] + +class dedicateClusterResponse (baseResponse): + def __init__(self): + """the ID of the dedicated resource""" + self.id = None + """the Account ID of the cluster""" + self.accountid = None + """the Dedication Affinity Group ID of the cluster""" + self.affinitygroupid = None + """the ID of the cluster""" + self.clusterid = None + """the name of the cluster""" + self.clustername = None + """the domain ID of the cluster""" + self.domainid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateGuestVlanRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateGuestVlanRange.py new file mode 100644 index 00000000000..3c779a6bfea --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateGuestVlanRange.py @@ -0,0 +1,61 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Dedicates a guest vlan range to an account""" +from baseCmd import * +from baseResponse import * +class dedicateGuestVlanRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """account who will own the VLAN""" + """Required""" + self.account = None + """domain ID of the account owning a VLAN""" + """Required""" + self.domainid = None + """physical network ID of the vlan""" + """Required""" + self.physicalnetworkid = None + """guest vlan range to be dedicated""" + """Required""" + self.vlanrange = None + """project who will own the VLAN""" + self.projectid = None + self.required = ["account","domainid","physicalnetworkid","vlanrange",] + +class dedicateGuestVlanRangeResponse (baseResponse): + def __init__(self): + """the ID of the guest VLAN range""" + self.id = None + """the account of the guest VLAN range""" + self.account = None + """the domain name of the guest VLAN range""" + self.domain = None + """the domain ID of the guest VLAN range""" + self.domainid = None + """the guest VLAN range""" + self.guestvlanrange = None + """the physical network of the guest vlan range""" + self.physicalnetworkid = None + """the project name of the guest vlan range""" + self.project = None + """the project id of the guest vlan range""" + self.projectid = None + """the zone of the guest vlan range""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateHost.py new file mode 100644 index 00000000000..122d3e2e47f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateHost.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Dedicates a host.""" +from baseCmd import * +from baseResponse import * +class dedicateHostCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the containing domain""" + """Required""" + self.domainid = None + """the ID of the host to update""" + """Required""" + self.hostid = None + """the name of the account which needs dedication. Must be used with domainId.""" + self.account = None + self.required = ["domainid","hostid",] + +class dedicateHostResponse (baseResponse): + def __init__(self): + """the ID of the dedicated resource""" + self.id = None + """the Account ID of the host""" + self.accountid = None + """the Dedication Affinity Group ID of the host""" + self.affinitygroupid = None + """the domain ID of the host""" + self.domainid = None + """the ID of the host""" + self.hostid = None + """the name of the host""" + self.hostname = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePod.py new file mode 100644 index 00000000000..494d846cc8b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePod.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Dedicates a Pod.""" +from baseCmd import * +from baseResponse import * +class dedicatePodCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the containing domain""" + """Required""" + self.domainid = None + """the ID of the Pod""" + """Required""" + self.podid = None + """the name of the account which needs dedication. Must be used with domainId.""" + self.account = None + self.required = ["domainid","podid",] + +class dedicatePodResponse (baseResponse): + def __init__(self): + """the ID of the dedicated resource""" + self.id = None + """the Account Id to which the Pod is dedicated""" + self.accountid = None + """the Dedication Affinity Group ID of the pod""" + self.affinitygroupid = None + """the domain ID to which the Pod is dedicated""" + self.domainid = None + """the ID of the Pod""" + self.podid = None + """the Name of the Pod""" + self.podname = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePublicIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePublicIpRange.py new file mode 100644 index 00000000000..ce4f768dee9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePublicIpRange.py @@ -0,0 +1,84 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Dedicates a Public IP range to an account""" +from baseCmd import * +from baseResponse import * +class dedicatePublicIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the id of the VLAN IP range""" + """Required""" + self.id = None + """account who will own the VLAN""" + """Required""" + self.account = None + """domain ID of the account owning a VLAN""" + """Required""" + self.domainid = None + """project who will own the VLAN""" + self.projectid = None + self.required = ["id","account","domainid",] + +class dedicatePublicIpRangeResponse (baseResponse): + def __init__(self): + """the ID of the VLAN IP range""" + self.id = None + """the account of the VLAN IP range""" + self.account = None + """the description of the VLAN IP range""" + self.description = None + """the domain name of the VLAN IP range""" + self.domain = None + """the domain ID of the VLAN IP range""" + self.domainid = None + """the end ip of the VLAN IP range""" + self.endip = None + """the end ipv6 of the VLAN IP range""" + self.endipv6 = None + """the virtual network for the VLAN IP range""" + self.forvirtualnetwork = None + """the gateway of the VLAN IP range""" + self.gateway = None + """the cidr of IPv6 network""" + self.ip6cidr = None + """the gateway of IPv6 network""" + self.ip6gateway = None + """the netmask of the VLAN IP range""" + self.netmask = None + """the network id of vlan range""" + self.networkid = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """the Pod ID for the VLAN IP range""" + self.podid = None + """the Pod name for the VLAN IP range""" + self.podname = None + """the project name of the vlan range""" + self.project = None + """the project id of the vlan range""" + self.projectid = None + """the start ip of the VLAN IP range""" + self.startip = None + """the start ipv6 of the VLAN IP range""" + self.startipv6 = None + """the ID or VID of the VLAN.""" + self.vlan = None + """the Zone ID of the VLAN IP range""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateZone.py new file mode 100644 index 00000000000..caf901eb76b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateZone.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Dedicates a zones.""" +from baseCmd import * +from baseResponse import * +class dedicateZoneCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the containing domain""" + """Required""" + self.domainid = None + """the ID of the zone""" + """Required""" + self.zoneid = None + """the name of the account which needs dedication. Must be used with domainId.""" + self.account = None + self.required = ["domainid","zoneid",] + +class dedicateZoneResponse (baseResponse): + def __init__(self): + """the ID of the dedicated resource""" + self.id = None + """the Account Id to which the Zone is dedicated""" + self.accountid = None + """the Dedication Affinity Group ID of the zone""" + self.affinitygroupid = None + """the domain ID to which the Zone is dedicated""" + self.domainid = None + """the ID of the Zone""" + self.zoneid = None + """the Name of the Zone""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccount.py new file mode 100644 index 00000000000..84810c83108 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccount.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a account, and all users associated with this account""" +from baseCmd import * +from baseResponse import * +class deleteAccountCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Account id""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteAccountResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccountFromProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccountFromProject.py new file mode 100644 index 00000000000..e7e32fc88e7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccountFromProject.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes account from the project""" +from baseCmd import * +from baseResponse import * +class deleteAccountFromProjectCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """name of the account to be removed from the project""" + """Required""" + self.account = None + """id of the project to remove the account from""" + """Required""" + self.projectid = None + self.required = ["account","projectid",] + +class deleteAccountFromProjectResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAffinityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAffinityGroup.py new file mode 100644 index 00000000000..059dd8ad56b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAffinityGroup.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes affinity group""" +from baseCmd import * +from baseResponse import * +class deleteAffinityGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the account of the affinity group. Must be specified with domain ID""" + self.account = None + """the domain ID of account owning the affinity group""" + self.domainid = None + """The ID of the affinity group. Mutually exclusive with name parameter""" + self.id = None + """The name of the affinity group. Mutually exclusive with id parameter""" + self.name = None + self.required = [] + +class deleteAffinityGroupResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAlerts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAlerts.py new file mode 100644 index 00000000000..7bebd41debc --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAlerts.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Delete one or more alerts.""" +from baseCmd import * +from baseResponse import * +class deleteAlertsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """end date range to delete alerts (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" + self.enddate = None + """the IDs of the alerts""" + self.ids = [] + """start date range to delete alerts (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" + self.startdate = None + """delete by alert type""" + self.type = None + self.required = [] + +class deleteAlertsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScalePolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScalePolicy.py new file mode 100644 index 00000000000..5ce5b2a6767 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScalePolicy.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a autoscale policy.""" +from baseCmd import * +from baseResponse import * +class deleteAutoScalePolicyCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the autoscale policy""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteAutoScalePolicyResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmGroup.py new file mode 100644 index 00000000000..060d5f071d0 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmGroup.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a autoscale vm group.""" +from baseCmd import * +from baseResponse import * +class deleteAutoScaleVmGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the autoscale group""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteAutoScaleVmGroupResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmProfile.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmProfile.py new file mode 100644 index 00000000000..9279a564ed4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmProfile.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a autoscale vm profile.""" +from baseCmd import * +from baseResponse import * +class deleteAutoScaleVmProfileCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the autoscale profile""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteAutoScaleVmProfileResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteBigSwitchVnsDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteBigSwitchVnsDevice.py new file mode 100644 index 00000000000..c3c41503fb8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteBigSwitchVnsDevice.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""delete a bigswitch vns device""" +from baseCmd import * +from baseResponse import * +class deleteBigSwitchVnsDeviceCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """BigSwitch device ID""" + """Required""" + self.vnsdeviceid = None + self.required = ["vnsdeviceid",] + +class deleteBigSwitchVnsDeviceResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCluster.py new file mode 100644 index 00000000000..7ad27c28558 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCluster.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a cluster.""" +from baseCmd import * +from baseResponse import * +class deleteClusterCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the cluster ID""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteClusterResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCondition.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCondition.py new file mode 100644 index 00000000000..e87ec957033 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCondition.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Removes a condition""" +from baseCmd import * +from baseResponse import * +class deleteConditionCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the condition.""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteConditionResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCounter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCounter.py new file mode 100644 index 00000000000..78c2b71b3af --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCounter.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a counter""" +from baseCmd import * +from baseResponse import * +class deleteCounterCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the counter""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteCounterResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDiskOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDiskOffering.py new file mode 100644 index 00000000000..535d992c358 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDiskOffering.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a disk offering.""" +from baseCmd import * +from baseResponse import * +class deleteDiskOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """ID of the disk offering""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteDiskOfferingResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDomain.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDomain.py new file mode 100644 index 00000000000..7289850244f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDomain.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a specified domain""" +from baseCmd import * +from baseResponse import * +class deleteDomainCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """ID of domain to delete""" + """Required""" + self.id = None + """true if all domain resources (child domains, accounts) have to be cleaned up, false otherwise""" + self.cleanup = None + self.required = ["id",] + +class deleteDomainResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEgressFirewallRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEgressFirewallRule.py new file mode 100644 index 00000000000..3baecade3db --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEgressFirewallRule.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes an ggress firewall rule""" +from baseCmd import * +from baseResponse import * +class deleteEgressFirewallRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the firewall rule""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteEgressFirewallRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEvents.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEvents.py new file mode 100644 index 00000000000..3b4cbdf46ae --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEvents.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Delete one or more events.""" +from baseCmd import * +from baseResponse import * +class deleteEventsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """end date range to delete events (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" + self.enddate = None + """the IDs of the events""" + self.ids = [] + """start date range to delete events (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" + self.startdate = None + """delete by event type""" + self.type = None + self.required = [] + +class deleteEventsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteFirewallRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteFirewallRule.py new file mode 100644 index 00000000000..de9344a033c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteFirewallRule.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a firewall rule""" +from baseCmd import * +from baseResponse import * +class deleteFirewallRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the firewall rule""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteFirewallRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py new file mode 100644 index 00000000000..26ef6fe82b3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a global load balancer rule.""" +from baseCmd import * +from baseResponse import * +class deleteGlobalLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the global load balancer rule""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteGlobalLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteHost.py new file mode 100644 index 00000000000..1ffd8de7d05 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteHost.py @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a host.""" +from baseCmd import * +from baseResponse import * +class deleteHostCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the host ID""" + """Required""" + self.id = None + """Force delete the host. All HA enabled vms running on the host will be put to HA; HA disabled ones will be stopped""" + self.forced = None + """Force destroy local storage on this host. All VMs created on this local storage will be destroyed""" + self.forcedestroylocalstorage = None + self.required = ["id",] + +class deleteHostResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteImageStore.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteImageStore.py new file mode 100644 index 00000000000..447eab35960 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteImageStore.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes an image store .""" +from baseCmd import * +from baseResponse import * +class deleteImageStoreCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the image store ID""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteImageStoreResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteInstanceGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteInstanceGroup.py new file mode 100644 index 00000000000..ccfef7fae2e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteInstanceGroup.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a vm group""" +from baseCmd import * +from baseResponse import * +class deleteInstanceGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the instance group""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteInstanceGroupResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIpForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIpForwardingRule.py new file mode 100644 index 00000000000..3cf496fe096 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIpForwardingRule.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes an ip forwarding rule""" +from baseCmd import * +from baseResponse import * +class deleteIpForwardingRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the id of the forwarding rule""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteIpForwardingRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIso.py new file mode 100644 index 00000000000..748b6be2956 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIso.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes an ISO file.""" +from baseCmd import * +from baseResponse import * +class deleteIsoCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the ISO file""" + """Required""" + self.id = None + """the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones""" + self.zoneid = None + self.required = ["id",] + +class deleteIsoResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBHealthCheckPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBHealthCheckPolicy.py new file mode 100644 index 00000000000..50086168d41 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBHealthCheckPolicy.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a load balancer HealthCheck policy.""" +from baseCmd import * +from baseResponse import * +class deleteLBHealthCheckPolicyCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the load balancer HealthCheck policy""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteLBHealthCheckPolicyResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBStickinessPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBStickinessPolicy.py new file mode 100644 index 00000000000..d90b4d8755d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBStickinessPolicy.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a LB stickiness policy.""" +from baseCmd import * +from baseResponse import * +class deleteLBStickinessPolicyCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the LB stickiness policy""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteLBStickinessPolicyResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLdapConfiguration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLdapConfiguration.py new file mode 100644 index 00000000000..3ac530dfa26 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLdapConfiguration.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Remove an Ldap Configuration""" +from baseCmd import * +from baseResponse import * +class deleteLdapConfigurationCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Hostname""" + """Required""" + self.hostname = None + self.required = ["hostname",] + +class deleteLdapConfigurationResponse (baseResponse): + def __init__(self): + """hostname""" + self.hostname = None + """port""" + self.port = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancer.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancer.py new file mode 100644 index 00000000000..753c370735f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancer.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a load balancer""" +from baseCmd import * +from baseResponse import * +class deleteLoadBalancerCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the Load Balancer""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteLoadBalancerResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancerRule.py new file mode 100644 index 00000000000..660825018e1 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancerRule.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a load balancer rule.""" +from baseCmd import * +from baseResponse import * +class deleteLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the load balancer rule""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetwork.py new file mode 100644 index 00000000000..adbb792ba40 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetwork.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a network""" +from baseCmd import * +from baseResponse import * +class deleteNetworkCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the network""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteNetworkResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACL.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACL.py new file mode 100644 index 00000000000..cf2288d087a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACL.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a Network ACL""" +from baseCmd import * +from baseResponse import * +class deleteNetworkACLCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the network ACL""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteNetworkACLResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACLList.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACLList.py new file mode 100644 index 00000000000..e9b854bb270 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACLList.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a Network ACL""" +from baseCmd import * +from baseResponse import * +class deleteNetworkACLListCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the network ACL""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteNetworkACLListResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkDevice.py new file mode 100644 index 00000000000..11014f42132 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkDevice.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes network device.""" +from baseCmd import * +from baseResponse import * +class deleteNetworkDeviceCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Id of network device to delete""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteNetworkDeviceResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkOffering.py new file mode 100644 index 00000000000..76747211993 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkOffering.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a network offering.""" +from baseCmd import * +from baseResponse import * +class deleteNetworkOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the network offering""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteNetworkOfferingResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkServiceProvider.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkServiceProvider.py new file mode 100644 index 00000000000..0bdc3e4211f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkServiceProvider.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a Network Service Provider.""" +from baseCmd import * +from baseResponse import * +class deleteNetworkServiceProviderCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the network service provider""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteNetworkServiceProviderResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNiciraNvpDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNiciraNvpDevice.py new file mode 100644 index 00000000000..067ea8ba6a5 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNiciraNvpDevice.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""delete a nicira nvp device""" +from baseCmd import * +from baseResponse import * +class deleteNiciraNvpDeviceCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Nicira device ID""" + """Required""" + self.nvpdeviceid = None + self.required = ["nvpdeviceid",] + +class deleteNiciraNvpDeviceResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePhysicalNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePhysicalNetwork.py new file mode 100644 index 00000000000..36381302fc7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePhysicalNetwork.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a Physical Network.""" +from baseCmd import * +from baseResponse import * +class deletePhysicalNetworkCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the Physical network""" + """Required""" + self.id = None + self.required = ["id",] + +class deletePhysicalNetworkResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePod.py new file mode 100644 index 00000000000..73e636ee5e3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePod.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a Pod.""" +from baseCmd import * +from baseResponse import * +class deletePodCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the Pod""" + """Required""" + self.id = None + self.required = ["id",] + +class deletePodResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortForwardingRule.py new file mode 100644 index 00000000000..4669d0e0ef8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortForwardingRule.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a port forwarding rule""" +from baseCmd import * +from baseResponse import * +class deletePortForwardingRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the port forwarding rule""" + """Required""" + self.id = None + self.required = ["id",] + +class deletePortForwardingRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortableIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortableIpRange.py new file mode 100644 index 00000000000..9fe23468999 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortableIpRange.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""deletes a range of portable public IP's associated with a region""" +from baseCmd import * +from baseResponse import * +class deletePortableIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Id of the portable ip range""" + """Required""" + self.id = None + self.required = ["id",] + +class deletePortableIpRangeResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePrivateGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePrivateGateway.py new file mode 100644 index 00000000000..8f30a0f3360 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePrivateGateway.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a Private gateway""" +from baseCmd import * +from baseResponse import * +class deletePrivateGatewayCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the private gateway""" + """Required""" + self.id = None + self.required = ["id",] + +class deletePrivateGatewayResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProject.py new file mode 100644 index 00000000000..e0f6e69bb3e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProject.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a project""" +from baseCmd import * +from baseResponse import * +class deleteProjectCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of the project to be deleted""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteProjectResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProjectInvitation.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProjectInvitation.py new file mode 100644 index 00000000000..beef9b87991 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProjectInvitation.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Accepts or declines project invitation""" +from baseCmd import * +from baseResponse import * +class deleteProjectInvitationCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of the invitation""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteProjectInvitationResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteRemoteAccessVpn.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteRemoteAccessVpn.py new file mode 100644 index 00000000000..2188299c018 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteRemoteAccessVpn.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Destroys a l2tp/ipsec remote access vpn""" +from baseCmd import * +from baseResponse import * +class deleteRemoteAccessVpnCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """public ip address id of the vpn server""" + """Required""" + self.publicipid = None + self.required = ["publicipid",] + +class deleteRemoteAccessVpnResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSSHKeyPair.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSSHKeyPair.py new file mode 100644 index 00000000000..6236cf55693 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSSHKeyPair.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a keypair by name""" +from baseCmd import * +from baseResponse import * +class deleteSSHKeyPairCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Name of the keypair""" + """Required""" + self.name = None + """the account associated with the keypair. Must be used with the domainId parameter.""" + self.account = None + """the domain ID associated with the keypair""" + self.domainid = None + """the project associated with keypair""" + self.projectid = None + self.required = ["name",] + +class deleteSSHKeyPairResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecondaryStagingStore.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecondaryStagingStore.py new file mode 100644 index 00000000000..79363bce141 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecondaryStagingStore.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a secondary staging store .""" +from baseCmd import * +from baseResponse import * +class deleteSecondaryStagingStoreCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the staging store ID""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteSecondaryStagingStoreResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecurityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecurityGroup.py new file mode 100644 index 00000000000..3278396f171 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecurityGroup.py @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes security group""" +from baseCmd import * +from baseResponse import * +class deleteSecurityGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the account of the security group. Must be specified with domain ID""" + self.account = None + """the domain ID of account owning the security group""" + self.domainid = None + """The ID of the security group. Mutually exclusive with name parameter""" + self.id = None + """The ID of the security group. Mutually exclusive with id parameter""" + self.name = None + """the project of the security group""" + self.projectid = None + self.required = [] + +class deleteSecurityGroupResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteServiceOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteServiceOffering.py new file mode 100644 index 00000000000..44e3df6264e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteServiceOffering.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a service offering.""" +from baseCmd import * +from baseResponse import * +class deleteServiceOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the service offering""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteServiceOfferingResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshot.py new file mode 100644 index 00000000000..f98b15cd859 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshot.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a snapshot of a disk volume.""" +from baseCmd import * +from baseResponse import * +class deleteSnapshotCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the snapshot""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteSnapshotResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshotPolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshotPolicies.py new file mode 100644 index 00000000000..1ed481d6f9e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshotPolicies.py @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes snapshot policies for the account.""" +from baseCmd import * +from baseResponse import * +class deleteSnapshotPoliciesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the Id of the snapshot policy""" + self.id = None + """list of snapshots policy IDs separated by comma""" + self.ids = [] + self.required = [] + +class deleteSnapshotPoliciesResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStaticRoute.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStaticRoute.py new file mode 100644 index 00000000000..030f3e60fd7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStaticRoute.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a static route""" +from baseCmd import * +from baseResponse import * +class deleteStaticRouteCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the static route""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteStaticRouteResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStorageNetworkIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStorageNetworkIpRange.py new file mode 100644 index 00000000000..ad61954557f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStorageNetworkIpRange.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a storage network IP Range.""" +from baseCmd import * +from baseResponse import * +class deleteStorageNetworkIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the uuid of the storage network ip range""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteStorageNetworkIpRangeResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStoragePool.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStoragePool.py new file mode 100644 index 00000000000..6ea4ee3a7c4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStoragePool.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a storage pool.""" +from baseCmd import * +from baseResponse import * +class deleteStoragePoolCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Storage pool id""" + """Required""" + self.id = None + """Force destroy storage pool (force expunge volumes in Destroyed state as a part of pool removal)""" + self.forced = None + self.required = ["id",] + +class deleteStoragePoolResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTags.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTags.py new file mode 100644 index 00000000000..7891ff66690 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTags.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deleting resource tag(s)""" +from baseCmd import * +from baseResponse import * +class deleteTagsCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Delete tags for resource id(s)""" + """Required""" + self.resourceids = [] + """Delete tag by resource type""" + """Required""" + self.resourcetype = None + """Delete tags matching key/value pairs""" + self.tags = [] + self.required = ["resourceids","resourcetype",] + +class deleteTagsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTemplate.py new file mode 100644 index 00000000000..83eb45f8a29 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTemplate.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a template from the system. All virtual machines using the deleted template will not be affected.""" +from baseCmd import * +from baseResponse import * +class deleteTemplateCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the template""" + """Required""" + self.id = None + """the ID of zone of the template""" + self.zoneid = None + self.required = ["id",] + +class deleteTemplateResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficMonitor.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficMonitor.py new file mode 100644 index 00000000000..c03a2f3b475 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficMonitor.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes an traffic monitor host.""" +from baseCmd import * +from baseResponse import * +class deleteTrafficMonitorCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Id of the Traffic Monitor Host.""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteTrafficMonitorResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficType.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficType.py new file mode 100644 index 00000000000..6cf0f47015d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficType.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes traffic type of a physical network""" +from baseCmd import * +from baseResponse import * +class deleteTrafficTypeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """traffic type id""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteTrafficTypeResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteUser.py new file mode 100644 index 00000000000..2d9790974c8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteUser.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a user for an account""" +from baseCmd import * +from baseResponse import * +class deleteUserCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """id of the user to be deleted""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteUserResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVMSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVMSnapshot.py new file mode 100644 index 00000000000..91dfab62928 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVMSnapshot.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a vmsnapshot.""" +from baseCmd import * +from baseResponse import * +class deleteVMSnapshotCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the VM snapshot""" + """Required""" + self.vmsnapshotid = None + self.required = ["vmsnapshotid",] + +class deleteVMSnapshotResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPC.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPC.py new file mode 100644 index 00000000000..073e03867c3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPC.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a VPC""" +from baseCmd import * +from baseResponse import * +class deleteVPCCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the VPC""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteVPCResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPCOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPCOffering.py new file mode 100644 index 00000000000..0e222f1797f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPCOffering.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes VPC offering""" +from baseCmd import * +from baseResponse import * +class deleteVPCOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the VPC offering""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteVPCOfferingResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVlanIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVlanIpRange.py new file mode 100644 index 00000000000..94f54d17fa1 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVlanIpRange.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates a VLAN IP range.""" +from baseCmd import * +from baseResponse import * +class deleteVlanIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the id of the VLAN IP range""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteVlanIpRangeResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVolume.py new file mode 100644 index 00000000000..ad0cd628ff2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVolume.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a detached disk volume.""" +from baseCmd import * +from baseResponse import * +class deleteVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """The ID of the disk volume""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteVolumeResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnConnection.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnConnection.py new file mode 100644 index 00000000000..b1349802459 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnConnection.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Delete site to site vpn connection""" +from baseCmd import * +from baseResponse import * +class deleteVpnConnectionCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of vpn connection""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteVpnConnectionResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnCustomerGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnCustomerGateway.py new file mode 100644 index 00000000000..559282e45be --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnCustomerGateway.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Delete site to site vpn customer gateway""" +from baseCmd import * +from baseResponse import * +class deleteVpnCustomerGatewayCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of customer gateway""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteVpnCustomerGatewayResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnGateway.py new file mode 100644 index 00000000000..06de8a32339 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnGateway.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Delete site to site vpn gateway""" +from baseCmd import * +from baseResponse import * +class deleteVpnGatewayCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of customer gateway""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteVpnGatewayResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteZone.py new file mode 100644 index 00000000000..32818b1bcb6 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteZone.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a Zone.""" +from baseCmd import * +from baseResponse import * +class deleteZoneCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the Zone""" + """Required""" + self.id = None + self.required = ["id",] + +class deleteZoneResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deployVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deployVirtualMachine.py new file mode 100644 index 00000000000..ba45f1da2d3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/deployVirtualMachine.py @@ -0,0 +1,421 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.""" +from baseCmd import * +from baseResponse import * +class deployVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the service offering for the virtual machine""" + """Required""" + self.serviceofferingid = None + """the ID of the template for the virtual machine""" + """Required""" + self.templateid = None + """availability zone for the virtual machine""" + """Required""" + self.zoneid = None + """an optional account for the virtual machine. Must be used with domainId.""" + self.account = None + """comma separated list of affinity groups id that are going to be applied to the virtual machine. Mutually exclusive with affinitygroupnames parameter""" + self.affinitygroupids = [] + """comma separated list of affinity groups names that are going to be applied to the virtual machine.Mutually exclusive with affinitygroupids parameter""" + self.affinitygroupnames = [] + """the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.""" + self.diskofferingid = None + """an optional user generated name for the virtual machine""" + self.displayname = None + """an optional field, whether to the display the vm to the end user or not.""" + self.displayvm = None + """an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """an optional group for the virtual machine""" + self.group = None + """destination Host ID to deploy the VM to - parameter available for root admin only""" + self.hostid = None + """the hypervisor on which to deploy the virtual machine""" + self.hypervisor = None + """the ipv6 address for default vm's network""" + self.ip6address = None + """the ip address for default vm's network""" + self.ipaddress = None + """ip to network mapping. Can't be specified with networkIds parameter. Example: iptonetworklist[0].ip=10.10.10.11&iptonetworklist[0].ipv6=fc00:1234:5678::abcd&iptonetworklist[0].networkid=uuid - requests to use ip 10.10.10.11 in network id=uuid""" + self.iptonetworklist = [] + """an optional keyboard device type for the virtual machine. valid value can be one of de,de-ch,es,fi,fr,fr-be,fr-ch,is,it,jp,nl-be,no,pt,uk,us""" + self.keyboard = None + """name of the ssh key pair used to login to the virtual machine""" + self.keypair = None + """host name for the virtual machine""" + self.name = None + """list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter""" + self.networkids = [] + """Deploy vm for the project""" + self.projectid = None + """comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter""" + self.securitygroupids = [] + """comma separated list of security groups names that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupids parameter""" + self.securitygroupnames = [] + """the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId""" + self.size = None + """true if network offering supports specifying ip ranges; defaulted to true if not specified""" + self.startvm = None + """an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding. Using HTTP POST(via POST body), you can send up to 32K of data after base64 encoding.""" + self.userdata = None + self.required = ["serviceofferingid","templateid","zoneid",] + +class deployVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/destroyRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/destroyRouter.py new file mode 100644 index 00000000000..4e63dba7a84 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/destroyRouter.py @@ -0,0 +1,151 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Destroys a router.""" +from baseCmd import * +from baseResponse import * +class destroyRouterCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the router""" + """Required""" + self.id = None + self.required = ["id",] + +class destroyRouterResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/destroySystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/destroySystemVm.py new file mode 100644 index 00000000000..c7c20784436 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/destroySystemVm.py @@ -0,0 +1,86 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Destroyes a system virtual machine.""" +from baseCmd import * +from baseResponse import * +class destroySystemVmCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the system virtual machine""" + """Required""" + self.id = None + self.required = ["id",] + +class destroySystemVmResponse (baseResponse): + def __init__(self): + """the ID of the system VM""" + self.id = None + """the number of active console sessions for the console proxy system vm""" + self.activeviewersessions = None + """the date and time the system VM was created""" + self.created = None + """the first DNS for the system VM""" + self.dns1 = None + """the second DNS for the system VM""" + self.dns2 = None + """the gateway for the system VM""" + self.gateway = None + """the host ID for the system VM""" + self.hostid = None + """the hostname for the system VM""" + self.hostname = None + """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobid = None + """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobstatus = None + """the link local IP address for the system vm""" + self.linklocalip = None + """the link local MAC address for the system vm""" + self.linklocalmacaddress = None + """the link local netmask for the system vm""" + self.linklocalnetmask = None + """the name of the system VM""" + self.name = None + """the network domain for the system VM""" + self.networkdomain = None + """the Pod ID for the system VM""" + self.podid = None + """the private IP address for the system VM""" + self.privateip = None + """the private MAC address for the system VM""" + self.privatemacaddress = None + """the private netmask for the system VM""" + self.privatenetmask = None + """the public IP address for the system VM""" + self.publicip = None + """the public MAC address for the system VM""" + self.publicmacaddress = None + """the public netmask for the system VM""" + self.publicnetmask = None + """the state of the system VM""" + self.state = None + """the system VM type""" + self.systemvmtype = None + """the template ID for the system VM""" + self.templateid = None + """the Zone ID for the system VM""" + self.zoneid = None + """the Zone name for the system VM""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/destroyVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/destroyVirtualMachine.py new file mode 100644 index 00000000000..6a33ce0df0d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/destroyVirtualMachine.py @@ -0,0 +1,369 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Destroys a virtual machine. Once destroyed, only the administrator can recover it.""" +from baseCmd import * +from baseResponse import * +class destroyVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.id = None + self.required = ["id",] + +class destroyVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/detachIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/detachIso.py new file mode 100644 index 00000000000..d445d51f5e2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/detachIso.py @@ -0,0 +1,369 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Detaches any ISO file (if any) currently attached to a virtual machine.""" +from baseCmd import * +from baseResponse import * +class detachIsoCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.virtualmachineid = None + self.required = ["virtualmachineid",] + +class detachIsoResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/detachVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/detachVolume.py new file mode 100644 index 00000000000..31e1c9a5c75 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/detachVolume.py @@ -0,0 +1,146 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Detaches a disk volume from a virtual machine.""" +from baseCmd import * +from baseResponse import * +class detachVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the device ID on the virtual machine where volume is detached from""" + self.deviceid = None + """the ID of the disk volume""" + self.id = None + """the ID of the virtual machine where the volume is detached from""" + self.virtualmachineid = None + self.required = [] + +class detachVolumeResponse (baseResponse): + def __init__(self): + """ID of the disk volume""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the date the volume was attached to a VM instance""" + self.attached = None + """the date the disk volume was created""" + self.created = None + """the boolean state of whether the volume is destroyed or not""" + self.destroyed = None + """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" + self.deviceid = None + """bytes read rate of the disk volume""" + self.diskBytesReadRate = None + """bytes write rate of the disk volume""" + self.diskBytesWriteRate = None + """io requests read rate of the disk volume""" + self.diskIopsReadRate = None + """io requests write rate of the disk volume""" + self.diskIopsWriteRate = None + """the display text of the disk offering""" + self.diskofferingdisplaytext = None + """ID of the disk offering""" + self.diskofferingid = None + """name of the disk offering""" + self.diskofferingname = None + """an optional field whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """Hypervisor the volume belongs to""" + self.hypervisor = None + """true if the volume is extractable, false otherwise""" + self.isextractable = None + """max iops of the disk volume""" + self.maxiops = None + """min iops of the disk volume""" + self.miniops = None + """name of the disk volume""" + self.name = None + """The path of the volume""" + self.path = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the display text of the service offering for root disk""" + self.serviceofferingdisplaytext = None + """ID of the service offering for root disk""" + self.serviceofferingid = None + """name of the service offering for root disk""" + self.serviceofferingname = None + """size of the disk volume""" + self.size = None + """ID of the snapshot from which this volume was created""" + self.snapshotid = None + """the state of the disk volume""" + self.state = None + """the status of the volume""" + self.status = None + """name of the primary storage hosting the disk volume""" + self.storage = None + """id of the primary storage hosting the disk volume; returned to admin user only""" + self.storageid = None + """shared or local storage""" + self.storagetype = None + """type of the disk volume (ROOT or DATADISK)""" + self.type = None + """id of the virtual machine""" + self.virtualmachineid = None + """display name of the virtual machine""" + self.vmdisplayname = None + """name of the virtual machine""" + self.vmname = None + """state of the virtual machine""" + self.vmstate = None + """ID of the availability zone""" + self.zoneid = None + """name of the availability zone""" + self.zonename = None + """the list of resource tags associated with volume""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disableAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disableAccount.py new file mode 100644 index 00000000000..b8d513adcd7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/disableAccount.py @@ -0,0 +1,179 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Disables an account""" +from baseCmd import * +from baseResponse import * +class disableAccountCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """If true, only lock the account; else disable the account""" + """Required""" + self.lock = None + """Disables specified account.""" + self.account = None + """Disables specified account in this domain.""" + self.domainid = None + """Account id""" + self.id = None + self.required = ["lock",] + +class disableAccountResponse (baseResponse): + def __init__(self): + """the id of the account""" + self.id = None + """details for the account""" + self.accountdetails = None + """account type (admin, domain-admin, user)""" + self.accounttype = None + """the total number of cpu cores available to be created for this account""" + self.cpuavailable = None + """the total number of cpu cores the account can own""" + self.cpulimit = None + """the total number of cpu cores owned by account""" + self.cputotal = None + """the default zone of the account""" + self.defaultzoneid = None + """name of the Domain the account belongs too""" + self.domain = None + """id of the Domain the account belongs too""" + self.domainid = None + """the total number of public ip addresses available for this account to acquire""" + self.ipavailable = None + """the total number of public ip addresses this account can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this account""" + self.iptotal = None + """true if the account requires cleanup""" + self.iscleanuprequired = None + """true if account is default, false otherwise""" + self.isdefault = None + """the total memory (in MB) available to be created for this account""" + self.memoryavailable = None + """the total memory (in MB) the account can own""" + self.memorylimit = None + """the total memory (in MB) owned by account""" + self.memorytotal = None + """the name of the account""" + self.name = None + """the total number of networks available to be created for this account""" + self.networkavailable = None + """the network domain""" + self.networkdomain = None + """the total number of networks the account can own""" + self.networklimit = None + """the total number of networks owned by account""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this account""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the account can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by account""" + self.primarystoragetotal = None + """the total number of projects available for administration by this account""" + self.projectavailable = None + """the total number of projects the account can own""" + self.projectlimit = None + """the total number of projects being administrated by this account""" + self.projecttotal = None + """the total number of network traffic bytes received""" + self.receivedbytes = None + """the total secondary storage space (in GiB) available to be used for this account""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the account can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by account""" + self.secondarystoragetotal = None + """the total number of network traffic bytes sent""" + self.sentbytes = None + """the total number of snapshots available for this account""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this account""" + self.snapshotlimit = None + """the total number of snapshots stored by this account""" + self.snapshottotal = None + """the state of the account""" + self.state = None + """the total number of templates available to be created by this account""" + self.templateavailable = None + """the total number of templates which can be created by this account""" + self.templatelimit = None + """the total number of templates which have been created by this account""" + self.templatetotal = None + """the total number of virtual machines available for this account to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this account""" + self.vmlimit = None + """the total number of virtual machines running for this account""" + self.vmrunning = None + """the total number of virtual machines stopped for this account""" + self.vmstopped = None + """the total number of virtual machines deployed by this account""" + self.vmtotal = None + """the total volume available for this account""" + self.volumeavailable = None + """the total volume which can be used by this account""" + self.volumelimit = None + """the total volume being used by this account""" + self.volumetotal = None + """the total number of vpcs available to be created for this account""" + self.vpcavailable = None + """the total number of vpcs the account can own""" + self.vpclimit = None + """the total number of vpcs owned by account""" + self.vpctotal = None + """the list of users associated with account""" + self.user = [] + +class user: + def __init__(self): + """"the user ID""" + self.id = None + """"the account name of the user""" + self.account = None + """"the account ID of the user""" + self.accountid = None + """"the account type of the user""" + self.accounttype = None + """"the api key of the user""" + self.apikey = None + """"the date and time the user account was created""" + self.created = None + """"the domain name of the user""" + self.domain = None + """"the domain ID of the user""" + self.domainid = None + """"the user email address""" + self.email = None + """"the user firstname""" + self.firstname = None + """"the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """"true if user is default, false otherwise""" + self.isdefault = None + """"the user lastname""" + self.lastname = None + """"the secret key of the user""" + self.secretkey = None + """"the user state""" + self.state = None + """"the timezone user was created in""" + self.timezone = None + """"the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disableAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disableAutoScaleVmGroup.py new file mode 100644 index 00000000000..5b455a36ada --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/disableAutoScaleVmGroup.py @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Disables an AutoScale Vm Group""" +from baseCmd import * +from baseResponse import * +class disableAutoScaleVmGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the autoscale group""" + """Required""" + self.id = None + self.required = ["id",] + +class disableAutoScaleVmGroupResponse (baseResponse): + def __init__(self): + """the autoscale vm group ID""" + self.id = None + """the account owning the instance group""" + self.account = None + """the domain name of the vm profile""" + self.domain = None + """the domain ID of the vm profile""" + self.domainid = None + """the frequency at which the conditions have to be evaluated""" + self.interval = None + """the load balancer rule ID""" + self.lbruleid = None + """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" + self.maxmembers = None + """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" + self.minmembers = None + """the project name of the vm profile""" + self.project = None + """the project id vm profile""" + self.projectid = None + """list of scaledown autoscale policies""" + self.scaledownpolicies = None + """list of scaleup autoscale policies""" + self.scaleuppolicies = None + """the current state of the AutoScale Vm Group""" + self.state = None + """the autoscale profile that contains information about the vms in the vm group.""" + self.vmprofileid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disableStaticNat.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disableStaticNat.py new file mode 100644 index 00000000000..611dc3f195e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/disableStaticNat.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Disables static rule for given ip address""" +from baseCmd import * +from baseResponse import * +class disableStaticNatCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the public IP address id for which static nat feature is being disableed""" + """Required""" + self.ipaddressid = None + self.required = ["ipaddressid",] + +class disableStaticNatResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disableUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disableUser.py new file mode 100644 index 00000000000..4d217607516 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/disableUser.py @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Disables a user account""" +from baseCmd import * +from baseResponse import * +class disableUserCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Disables user by user ID.""" + """Required""" + self.id = None + self.required = ["id",] + +class disableUserResponse (baseResponse): + def __init__(self): + """the user ID""" + self.id = None + """the account name of the user""" + self.account = None + """the account ID of the user""" + self.accountid = None + """the account type of the user""" + self.accounttype = None + """the api key of the user""" + self.apikey = None + """the date and time the user account was created""" + self.created = None + """the domain name of the user""" + self.domain = None + """the domain ID of the user""" + self.domainid = None + """the user email address""" + self.email = None + """the user firstname""" + self.firstname = None + """the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """true if user is default, false otherwise""" + self.isdefault = None + """the user lastname""" + self.lastname = None + """the secret key of the user""" + self.secretkey = None + """the user state""" + self.state = None + """the timezone user was created in""" + self.timezone = None + """the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disassociateIpAddress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disassociateIpAddress.py new file mode 100644 index 00000000000..099401a8815 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/disassociateIpAddress.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Disassociates an ip address from the account.""" +from baseCmd import * +from baseResponse import * +class disassociateIpAddressCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the id of the public ip address to disassociate""" + """Required""" + self.id = None + self.required = ["id",] + +class disassociateIpAddressResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableAccount.py new file mode 100644 index 00000000000..b9099d6fe8e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/enableAccount.py @@ -0,0 +1,176 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Enables an account""" +from baseCmd import * +from baseResponse import * +class enableAccountCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Enables specified account.""" + self.account = None + """Enables specified account in this domain.""" + self.domainid = None + """Account id""" + self.id = None + self.required = [] + +class enableAccountResponse (baseResponse): + def __init__(self): + """the id of the account""" + self.id = None + """details for the account""" + self.accountdetails = None + """account type (admin, domain-admin, user)""" + self.accounttype = None + """the total number of cpu cores available to be created for this account""" + self.cpuavailable = None + """the total number of cpu cores the account can own""" + self.cpulimit = None + """the total number of cpu cores owned by account""" + self.cputotal = None + """the default zone of the account""" + self.defaultzoneid = None + """name of the Domain the account belongs too""" + self.domain = None + """id of the Domain the account belongs too""" + self.domainid = None + """the total number of public ip addresses available for this account to acquire""" + self.ipavailable = None + """the total number of public ip addresses this account can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this account""" + self.iptotal = None + """true if the account requires cleanup""" + self.iscleanuprequired = None + """true if account is default, false otherwise""" + self.isdefault = None + """the total memory (in MB) available to be created for this account""" + self.memoryavailable = None + """the total memory (in MB) the account can own""" + self.memorylimit = None + """the total memory (in MB) owned by account""" + self.memorytotal = None + """the name of the account""" + self.name = None + """the total number of networks available to be created for this account""" + self.networkavailable = None + """the network domain""" + self.networkdomain = None + """the total number of networks the account can own""" + self.networklimit = None + """the total number of networks owned by account""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this account""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the account can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by account""" + self.primarystoragetotal = None + """the total number of projects available for administration by this account""" + self.projectavailable = None + """the total number of projects the account can own""" + self.projectlimit = None + """the total number of projects being administrated by this account""" + self.projecttotal = None + """the total number of network traffic bytes received""" + self.receivedbytes = None + """the total secondary storage space (in GiB) available to be used for this account""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the account can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by account""" + self.secondarystoragetotal = None + """the total number of network traffic bytes sent""" + self.sentbytes = None + """the total number of snapshots available for this account""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this account""" + self.snapshotlimit = None + """the total number of snapshots stored by this account""" + self.snapshottotal = None + """the state of the account""" + self.state = None + """the total number of templates available to be created by this account""" + self.templateavailable = None + """the total number of templates which can be created by this account""" + self.templatelimit = None + """the total number of templates which have been created by this account""" + self.templatetotal = None + """the total number of virtual machines available for this account to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this account""" + self.vmlimit = None + """the total number of virtual machines running for this account""" + self.vmrunning = None + """the total number of virtual machines stopped for this account""" + self.vmstopped = None + """the total number of virtual machines deployed by this account""" + self.vmtotal = None + """the total volume available for this account""" + self.volumeavailable = None + """the total volume which can be used by this account""" + self.volumelimit = None + """the total volume being used by this account""" + self.volumetotal = None + """the total number of vpcs available to be created for this account""" + self.vpcavailable = None + """the total number of vpcs the account can own""" + self.vpclimit = None + """the total number of vpcs owned by account""" + self.vpctotal = None + """the list of users associated with account""" + self.user = [] + +class user: + def __init__(self): + """"the user ID""" + self.id = None + """"the account name of the user""" + self.account = None + """"the account ID of the user""" + self.accountid = None + """"the account type of the user""" + self.accounttype = None + """"the api key of the user""" + self.apikey = None + """"the date and time the user account was created""" + self.created = None + """"the domain name of the user""" + self.domain = None + """"the domain ID of the user""" + self.domainid = None + """"the user email address""" + self.email = None + """"the user firstname""" + self.firstname = None + """"the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """"true if user is default, false otherwise""" + self.isdefault = None + """"the user lastname""" + self.lastname = None + """"the secret key of the user""" + self.secretkey = None + """"the user state""" + self.state = None + """"the timezone user was created in""" + self.timezone = None + """"the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableAutoScaleVmGroup.py new file mode 100644 index 00000000000..cb4e6bda2f0 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/enableAutoScaleVmGroup.py @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Enables an AutoScale Vm Group""" +from baseCmd import * +from baseResponse import * +class enableAutoScaleVmGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the autoscale group""" + """Required""" + self.id = None + self.required = ["id",] + +class enableAutoScaleVmGroupResponse (baseResponse): + def __init__(self): + """the autoscale vm group ID""" + self.id = None + """the account owning the instance group""" + self.account = None + """the domain name of the vm profile""" + self.domain = None + """the domain ID of the vm profile""" + self.domainid = None + """the frequency at which the conditions have to be evaluated""" + self.interval = None + """the load balancer rule ID""" + self.lbruleid = None + """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" + self.maxmembers = None + """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" + self.minmembers = None + """the project name of the vm profile""" + self.project = None + """the project id vm profile""" + self.projectid = None + """list of scaledown autoscale policies""" + self.scaledownpolicies = None + """list of scaleup autoscale policies""" + self.scaleuppolicies = None + """the current state of the AutoScale Vm Group""" + self.state = None + """the autoscale profile that contains information about the vms in the vm group.""" + self.vmprofileid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableStaticNat.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableStaticNat.py new file mode 100644 index 00000000000..be859fca691 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/enableStaticNat.py @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Enables static nat for given ip address""" +from baseCmd import * +from baseResponse import * +class enableStaticNatCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the public IP address id for which static nat feature is being enabled""" + """Required""" + self.ipaddressid = None + """the ID of the virtual machine for enabling static nat feature""" + """Required""" + self.virtualmachineid = None + """The network of the vm the static nat will be enabled for. Required when public Ip address is not associated with any Guest network yet (VPC case)""" + self.networkid = None + """VM guest nic Secondary ip address for the port forwarding rule""" + self.vmguestip = None + self.required = ["ipaddressid","virtualmachineid",] + +class enableStaticNatResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableStorageMaintenance.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableStorageMaintenance.py new file mode 100644 index 00000000000..6eba6d9310f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/enableStorageMaintenance.py @@ -0,0 +1,78 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Puts storage pool into maintenance state""" +from baseCmd import * +from baseResponse import * +class enableStorageMaintenanceCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Primary storage ID""" + """Required""" + self.id = None + self.required = ["id",] + +class enableStorageMaintenanceResponse (baseResponse): + def __init__(self): + """the ID of the storage pool""" + self.id = None + """IOPS CloudStack can provision from this storage pool""" + self.capacityiops = None + """the ID of the cluster for the storage pool""" + self.clusterid = None + """the name of the cluster for the storage pool""" + self.clustername = None + """the date and time the storage pool was created""" + self.created = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the storage pool""" + self.disksizetotal = None + """the host's currently used disk size""" + self.disksizeused = None + """the hypervisor type of the storage pool""" + self.hypervisor = None + """the IP address of the storage pool""" + self.ipaddress = None + """the name of the storage pool""" + self.name = None + """the storage pool path""" + self.path = None + """the Pod ID of the storage pool""" + self.podid = None + """the Pod name of the storage pool""" + self.podname = None + """the scope of the storage pool""" + self.scope = None + """the state of the storage pool""" + self.state = None + """true if this pool is suitable to migrate a volume, false otherwise""" + self.suitableformigration = None + """the tags for the storage pool""" + self.tags = None + """the storage pool type""" + self.type = None + """the Zone ID of the storage pool""" + self.zoneid = None + """the Zone name of the storage pool""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableUser.py new file mode 100644 index 00000000000..7aaa5036444 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/enableUser.py @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Enables a user account""" +from baseCmd import * +from baseResponse import * +class enableUserCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Enables user by user ID.""" + """Required""" + self.id = None + self.required = ["id",] + +class enableUserResponse (baseResponse): + def __init__(self): + """the user ID""" + self.id = None + """the account name of the user""" + self.account = None + """the account ID of the user""" + self.accountid = None + """the account type of the user""" + self.accounttype = None + """the api key of the user""" + self.apikey = None + """the date and time the user account was created""" + self.created = None + """the domain name of the user""" + self.domain = None + """the domain ID of the user""" + self.domainid = None + """the user email address""" + self.email = None + """the user firstname""" + self.firstname = None + """the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """true if user is default, false otherwise""" + self.isdefault = None + """the user lastname""" + self.lastname = None + """the secret key of the user""" + self.secretkey = None + """the user state""" + self.state = None + """the timezone user was created in""" + self.timezone = None + """the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/extractIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/extractIso.py new file mode 100644 index 00000000000..56f9665e8f2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/extractIso.py @@ -0,0 +1,65 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Extracts an ISO""" +from baseCmd import * +from baseResponse import * +class extractIsoCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the ISO file""" + """Required""" + self.id = None + """the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD""" + """Required""" + self.mode = None + """the url to which the ISO would be extracted""" + self.url = None + """the ID of the zone where the ISO is originally located""" + self.zoneid = None + self.required = ["id","mode",] + +class extractIsoResponse (baseResponse): + def __init__(self): + """the id of extracted object""" + self.id = None + """the account id to which the extracted object belongs""" + self.accountid = None + """the time and date the object was created""" + self.created = None + """the upload id of extracted object""" + self.extractId = None + """the mode of extraction - upload or download""" + self.extractMode = None + """the name of the extracted object""" + self.name = None + """the state of the extracted object""" + self.state = None + """the status of the extraction""" + self.status = None + """type of the storage""" + self.storagetype = None + """the percentage of the entity uploaded to the specified location""" + self.uploadpercentage = None + """if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded""" + self.url = None + """zone ID the object was extracted from""" + self.zoneid = None + """zone name the object was extracted from""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/extractTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/extractTemplate.py new file mode 100644 index 00000000000..f27c09ead9f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/extractTemplate.py @@ -0,0 +1,65 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Extracts a template""" +from baseCmd import * +from baseResponse import * +class extractTemplateCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the template""" + """Required""" + self.id = None + """the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD""" + """Required""" + self.mode = None + """the url to which the ISO would be extracted""" + self.url = None + """the ID of the zone where the ISO is originally located""" + self.zoneid = None + self.required = ["id","mode",] + +class extractTemplateResponse (baseResponse): + def __init__(self): + """the id of extracted object""" + self.id = None + """the account id to which the extracted object belongs""" + self.accountid = None + """the time and date the object was created""" + self.created = None + """the upload id of extracted object""" + self.extractId = None + """the mode of extraction - upload or download""" + self.extractMode = None + """the name of the extracted object""" + self.name = None + """the state of the extracted object""" + self.state = None + """the status of the extraction""" + self.status = None + """type of the storage""" + self.storagetype = None + """the percentage of the entity uploaded to the specified location""" + self.uploadpercentage = None + """if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded""" + self.url = None + """zone ID the object was extracted from""" + self.zoneid = None + """zone name the object was extracted from""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/extractVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/extractVolume.py new file mode 100644 index 00000000000..9596a81f568 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/extractVolume.py @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Extracts volume""" +from baseCmd import * +from baseResponse import * +class extractVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the volume""" + """Required""" + self.id = None + """the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD""" + """Required""" + self.mode = None + """the ID of the zone where the volume is located""" + """Required""" + self.zoneid = None + """the url to which the volume would be extracted""" + self.url = None + self.required = ["id","mode","zoneid",] + +class extractVolumeResponse (baseResponse): + def __init__(self): + """the id of extracted object""" + self.id = None + """the account id to which the extracted object belongs""" + self.accountid = None + """the time and date the object was created""" + self.created = None + """the upload id of extracted object""" + self.extractId = None + """the mode of extraction - upload or download""" + self.extractMode = None + """the name of the extracted object""" + self.name = None + """the state of the extracted object""" + self.state = None + """the status of the extraction""" + self.status = None + """type of the storage""" + self.storagetype = None + """the percentage of the entity uploaded to the specified location""" + self.uploadpercentage = None + """if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded""" + self.url = None + """zone ID the object was extracted from""" + self.zoneid = None + """zone name the object was extracted from""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/findHostsForMigration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/findHostsForMigration.py new file mode 100644 index 00000000000..cd6d34cef0f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/findHostsForMigration.py @@ -0,0 +1,126 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Find hosts suitable for migrating a virtual machine.""" +from baseCmd import * +from baseResponse import * +class findHostsForMigrationCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """find hosts to which this VM can be migrated and flag the hosts with enough CPU/RAM to host the VM""" + """Required""" + self.virtualmachineid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["virtualmachineid",] + +class findHostsForMigrationResponse (baseResponse): + def __init__(self): + """the ID of the host""" + self.id = None + """the cpu average load on the host""" + self.averageload = None + """capabilities of the host""" + self.capabilities = None + """the cluster ID of the host""" + self.clusterid = None + """the cluster name of the host""" + self.clustername = None + """the cluster type of the cluster that host belongs to""" + self.clustertype = None + """the amount of the host's CPU currently allocated""" + self.cpuallocated = None + """the CPU number of the host""" + self.cpunumber = None + """the CPU speed of the host""" + self.cpuspeed = None + """the amount of the host's CPU currently used""" + self.cpuused = None + """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" + self.cpuwithoverprovisioning = None + """the date and time the host was created""" + self.created = None + """true if the host is disconnected. False otherwise.""" + self.disconnected = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the host""" + self.disksizetotal = None + """events available for the host""" + self.events = None + """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" + self.hahost = None + """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" + self.hasenoughcapacity = None + """comma-separated list of tags for the host""" + self.hosttags = None + """the host hypervisor""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the IP address of the host""" + self.ipaddress = None + """true if local storage is active, false otherwise""" + self.islocalstorageactive = None + """the date and time the host was last pinged""" + self.lastpinged = None + """the management server ID of the host""" + self.managementserverid = None + """the amount of the host's memory currently allocated""" + self.memoryallocated = None + """the memory total of the host""" + self.memorytotal = None + """the amount of the host's memory currently used""" + self.memoryused = None + """the name of the host""" + self.name = None + """the incoming network traffic on the host""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the OS category ID of the host""" + self.oscategoryid = None + """the OS category name of the host""" + self.oscategoryname = None + """the Pod ID of the host""" + self.podid = None + """the Pod name of the host""" + self.podname = None + """the date and time the host was removed""" + self.removed = None + """true if migrating a vm to this host requires storage motion, false otherwise""" + self.requiresStorageMotion = None + """the resource state of the host""" + self.resourcestate = None + """the state of the host""" + self.state = None + """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" + self.suitableformigration = None + """the host type""" + self.type = None + """the host version""" + self.version = None + """the Zone ID of the host""" + self.zoneid = None + """the Zone name of the host""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/findStoragePoolsForMigration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/findStoragePoolsForMigration.py new file mode 100644 index 00000000000..71fda446ba7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/findStoragePoolsForMigration.py @@ -0,0 +1,84 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists storage pools available for migration of a volume.""" +from baseCmd import * +from baseResponse import * +class findStoragePoolsForMigrationCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the volume""" + """Required""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["id",] + +class findStoragePoolsForMigrationResponse (baseResponse): + def __init__(self): + """the ID of the storage pool""" + self.id = None + """IOPS CloudStack can provision from this storage pool""" + self.capacityiops = None + """the ID of the cluster for the storage pool""" + self.clusterid = None + """the name of the cluster for the storage pool""" + self.clustername = None + """the date and time the storage pool was created""" + self.created = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the storage pool""" + self.disksizetotal = None + """the host's currently used disk size""" + self.disksizeused = None + """the hypervisor type of the storage pool""" + self.hypervisor = None + """the IP address of the storage pool""" + self.ipaddress = None + """the name of the storage pool""" + self.name = None + """the storage pool path""" + self.path = None + """the Pod ID of the storage pool""" + self.podid = None + """the Pod name of the storage pool""" + self.podname = None + """the scope of the storage pool""" + self.scope = None + """the state of the storage pool""" + self.state = None + """true if this pool is suitable to migrate a volume, false otherwise""" + self.suitableformigration = None + """the tags for the storage pool""" + self.tags = None + """the storage pool type""" + self.type = None + """the Zone ID of the storage pool""" + self.zoneid = None + """the Zone name of the storage pool""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/generateUsageRecords.py b/tools/marvin/build/lib/marvin/cloudstackAPI/generateUsageRecords.py new file mode 100644 index 00000000000..26dbdbc93d7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/generateUsageRecords.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Generates usage records. This will generate records only if there any records to be generated, i.e if the scheduled usage job was not run or failed""" +from baseCmd import * +from baseResponse import * +class generateUsageRecordsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """End date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-03.""" + """Required""" + self.enddate = None + """Start date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-01.""" + """Required""" + self.startdate = None + """List events for the specified domain.""" + self.domainid = None + self.required = ["enddate","startdate",] + +class generateUsageRecordsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/getApiLimit.py b/tools/marvin/build/lib/marvin/cloudstackAPI/getApiLimit.py new file mode 100644 index 00000000000..7b500fa1825 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/getApiLimit.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Get API limit count for the caller""" +from baseCmd import * +from baseResponse import * +class getApiLimitCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + self.required = [] + +class getApiLimitResponse (baseResponse): + def __init__(self): + """the account name of the api remaining count""" + self.account = None + """the account uuid of the api remaining count""" + self.accountid = None + """currently allowed number of apis""" + self.apiAllowed = None + """number of api already issued""" + self.apiIssued = None + """seconds left to reset counters""" + self.expireAfter = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/getCloudIdentifier.py b/tools/marvin/build/lib/marvin/cloudstackAPI/getCloudIdentifier.py new file mode 100644 index 00000000000..42823a5e771 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/getCloudIdentifier.py @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Retrieves a cloud identifier.""" +from baseCmd import * +from baseResponse import * +class getCloudIdentifierCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the user ID for the cloud identifier""" + """Required""" + self.userid = None + self.required = ["userid",] + +class getCloudIdentifierResponse (baseResponse): + def __init__(self): + """the cloud identifier""" + self.cloudidentifier = None + """the signed response for the cloud identifier""" + self.signature = None + """the user ID for the cloud identifier""" + self.userid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/getUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/getUser.py new file mode 100644 index 00000000000..88a5c3317cb --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/getUser.py @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Find user account by API key""" +from baseCmd import * +from baseResponse import * +class getUserCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """API key of the user""" + """Required""" + self.userapikey = None + self.required = ["userapikey",] + +class getUserResponse (baseResponse): + def __init__(self): + """the user ID""" + self.id = None + """the account name of the user""" + self.account = None + """the account ID of the user""" + self.accountid = None + """the account type of the user""" + self.accounttype = None + """the api key of the user""" + self.apikey = None + """the date and time the user account was created""" + self.created = None + """the domain name of the user""" + self.domain = None + """the domain ID of the user""" + self.domainid = None + """the user email address""" + self.email = None + """the user firstname""" + self.firstname = None + """the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """true if user is default, false otherwise""" + self.isdefault = None + """the user lastname""" + self.lastname = None + """the secret key of the user""" + self.secretkey = None + """the user state""" + self.state = None + """the timezone user was created in""" + self.timezone = None + """the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/getVMPassword.py b/tools/marvin/build/lib/marvin/cloudstackAPI/getVMPassword.py new file mode 100644 index 00000000000..e4c519b5dbc --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/getVMPassword.py @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Returns an encrypted password for the VM""" +from baseCmd import * +from baseResponse import * +class getVMPasswordCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """The ID of the virtual machine""" + """Required""" + self.id = None + self.required = ["id",] + +class getVMPasswordResponse (baseResponse): + def __init__(self): + """The encrypted password of the VM""" + self.encryptedpassword = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/ldapCreateAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/ldapCreateAccount.py new file mode 100644 index 00000000000..d7c12861785 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/ldapCreateAccount.py @@ -0,0 +1,190 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Creates an account from an LDAP user""" +from baseCmd import * +from baseResponse import * +class ldapCreateAccountCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Type of the account. Specify 0 for user, 1 for root admin, and 2 for domain admin""" + """Required""" + self.accounttype = None + """Unique username.""" + """Required""" + self.username = None + """Creates the user under the specified account. If no account is specified, the username will be used as the account name.""" + self.account = None + """details for account used to store specific parameters""" + self.accountdetails = [] + """Account UUID, required for adding account from external provisioning system""" + self.accountid = None + """Creates the user under the specified domain.""" + self.domainid = None + """Network domain for the account's networks""" + self.networkdomain = None + """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" + self.timezone = None + """User UUID, required for adding account from external provisioning system""" + self.userid = None + self.required = ["accounttype","username",] + +class ldapCreateAccountResponse (baseResponse): + def __init__(self): + """the id of the account""" + self.id = None + """details for the account""" + self.accountdetails = None + """account type (admin, domain-admin, user)""" + self.accounttype = None + """the total number of cpu cores available to be created for this account""" + self.cpuavailable = None + """the total number of cpu cores the account can own""" + self.cpulimit = None + """the total number of cpu cores owned by account""" + self.cputotal = None + """the default zone of the account""" + self.defaultzoneid = None + """name of the Domain the account belongs too""" + self.domain = None + """id of the Domain the account belongs too""" + self.domainid = None + """the total number of public ip addresses available for this account to acquire""" + self.ipavailable = None + """the total number of public ip addresses this account can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this account""" + self.iptotal = None + """true if the account requires cleanup""" + self.iscleanuprequired = None + """true if account is default, false otherwise""" + self.isdefault = None + """the total memory (in MB) available to be created for this account""" + self.memoryavailable = None + """the total memory (in MB) the account can own""" + self.memorylimit = None + """the total memory (in MB) owned by account""" + self.memorytotal = None + """the name of the account""" + self.name = None + """the total number of networks available to be created for this account""" + self.networkavailable = None + """the network domain""" + self.networkdomain = None + """the total number of networks the account can own""" + self.networklimit = None + """the total number of networks owned by account""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this account""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the account can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by account""" + self.primarystoragetotal = None + """the total number of projects available for administration by this account""" + self.projectavailable = None + """the total number of projects the account can own""" + self.projectlimit = None + """the total number of projects being administrated by this account""" + self.projecttotal = None + """the total number of network traffic bytes received""" + self.receivedbytes = None + """the total secondary storage space (in GiB) available to be used for this account""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the account can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by account""" + self.secondarystoragetotal = None + """the total number of network traffic bytes sent""" + self.sentbytes = None + """the total number of snapshots available for this account""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this account""" + self.snapshotlimit = None + """the total number of snapshots stored by this account""" + self.snapshottotal = None + """the state of the account""" + self.state = None + """the total number of templates available to be created by this account""" + self.templateavailable = None + """the total number of templates which can be created by this account""" + self.templatelimit = None + """the total number of templates which have been created by this account""" + self.templatetotal = None + """the total number of virtual machines available for this account to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this account""" + self.vmlimit = None + """the total number of virtual machines running for this account""" + self.vmrunning = None + """the total number of virtual machines stopped for this account""" + self.vmstopped = None + """the total number of virtual machines deployed by this account""" + self.vmtotal = None + """the total volume available for this account""" + self.volumeavailable = None + """the total volume which can be used by this account""" + self.volumelimit = None + """the total volume being used by this account""" + self.volumetotal = None + """the total number of vpcs available to be created for this account""" + self.vpcavailable = None + """the total number of vpcs the account can own""" + self.vpclimit = None + """the total number of vpcs owned by account""" + self.vpctotal = None + """the list of users associated with account""" + self.user = [] + +class user: + def __init__(self): + """"the user ID""" + self.id = None + """"the account name of the user""" + self.account = None + """"the account ID of the user""" + self.accountid = None + """"the account type of the user""" + self.accounttype = None + """"the api key of the user""" + self.apikey = None + """"the date and time the user account was created""" + self.created = None + """"the domain name of the user""" + self.domain = None + """"the domain ID of the user""" + self.domainid = None + """"the user email address""" + self.email = None + """"the user firstname""" + self.firstname = None + """"the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """"true if user is default, false otherwise""" + self.isdefault = None + """"the user lastname""" + self.lastname = None + """"the secret key of the user""" + self.secretkey = None + """"the user state""" + self.state = None + """"the timezone user was created in""" + self.timezone = None + """"the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAccounts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAccounts.py new file mode 100644 index 00000000000..85a75a625cf --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listAccounts.py @@ -0,0 +1,192 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists accounts and provides detailed account information for listed accounts""" +from baseCmd import * +from baseResponse import * +class listAccountsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).""" + self.accounttype = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list account by account ID""" + self.id = None + """list accounts by cleanuprequred attribute (values are true or false)""" + self.iscleanuprequired = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """list account by account name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list accounts by state. Valid states are enabled, disabled, and locked.""" + self.state = None + self.required = [] + +class listAccountsResponse (baseResponse): + def __init__(self): + """the id of the account""" + self.id = None + """details for the account""" + self.accountdetails = None + """account type (admin, domain-admin, user)""" + self.accounttype = None + """the total number of cpu cores available to be created for this account""" + self.cpuavailable = None + """the total number of cpu cores the account can own""" + self.cpulimit = None + """the total number of cpu cores owned by account""" + self.cputotal = None + """the default zone of the account""" + self.defaultzoneid = None + """name of the Domain the account belongs too""" + self.domain = None + """id of the Domain the account belongs too""" + self.domainid = None + """the total number of public ip addresses available for this account to acquire""" + self.ipavailable = None + """the total number of public ip addresses this account can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this account""" + self.iptotal = None + """true if the account requires cleanup""" + self.iscleanuprequired = None + """true if account is default, false otherwise""" + self.isdefault = None + """the total memory (in MB) available to be created for this account""" + self.memoryavailable = None + """the total memory (in MB) the account can own""" + self.memorylimit = None + """the total memory (in MB) owned by account""" + self.memorytotal = None + """the name of the account""" + self.name = None + """the total number of networks available to be created for this account""" + self.networkavailable = None + """the network domain""" + self.networkdomain = None + """the total number of networks the account can own""" + self.networklimit = None + """the total number of networks owned by account""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this account""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the account can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by account""" + self.primarystoragetotal = None + """the total number of projects available for administration by this account""" + self.projectavailable = None + """the total number of projects the account can own""" + self.projectlimit = None + """the total number of projects being administrated by this account""" + self.projecttotal = None + """the total number of network traffic bytes received""" + self.receivedbytes = None + """the total secondary storage space (in GiB) available to be used for this account""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the account can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by account""" + self.secondarystoragetotal = None + """the total number of network traffic bytes sent""" + self.sentbytes = None + """the total number of snapshots available for this account""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this account""" + self.snapshotlimit = None + """the total number of snapshots stored by this account""" + self.snapshottotal = None + """the state of the account""" + self.state = None + """the total number of templates available to be created by this account""" + self.templateavailable = None + """the total number of templates which can be created by this account""" + self.templatelimit = None + """the total number of templates which have been created by this account""" + self.templatetotal = None + """the total number of virtual machines available for this account to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this account""" + self.vmlimit = None + """the total number of virtual machines running for this account""" + self.vmrunning = None + """the total number of virtual machines stopped for this account""" + self.vmstopped = None + """the total number of virtual machines deployed by this account""" + self.vmtotal = None + """the total volume available for this account""" + self.volumeavailable = None + """the total volume which can be used by this account""" + self.volumelimit = None + """the total volume being used by this account""" + self.volumetotal = None + """the total number of vpcs available to be created for this account""" + self.vpcavailable = None + """the total number of vpcs the account can own""" + self.vpclimit = None + """the total number of vpcs owned by account""" + self.vpctotal = None + """the list of users associated with account""" + self.user = [] + +class user: + def __init__(self): + """"the user ID""" + self.id = None + """"the account name of the user""" + self.account = None + """"the account ID of the user""" + self.accountid = None + """"the account type of the user""" + self.accounttype = None + """"the api key of the user""" + self.apikey = None + """"the date and time the user account was created""" + self.created = None + """"the domain name of the user""" + self.domain = None + """"the domain ID of the user""" + self.domainid = None + """"the user email address""" + self.email = None + """"the user firstname""" + self.firstname = None + """"the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """"true if user is default, false otherwise""" + self.isdefault = None + """"the user lastname""" + self.lastname = None + """"the secret key of the user""" + self.secretkey = None + """"the user state""" + self.state = None + """"the timezone user was created in""" + self.timezone = None + """"the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroupTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroupTypes.py new file mode 100644 index 00000000000..091d39126c2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroupTypes.py @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists affinity group types available""" +from baseCmd import * +from baseResponse import * +class listAffinityGroupTypesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listAffinityGroupTypesResponse (baseResponse): + def __init__(self): + """the type of the affinity group""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroups.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroups.py new file mode 100644 index 00000000000..b74791ea738 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroups.py @@ -0,0 +1,67 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists affinity groups""" +from baseCmd import * +from baseResponse import * +class listAffinityGroupsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list the affinity group by the id provided""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """lists affinity groups by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """lists affinity groups by type""" + self.type = None + """lists affinity groups by virtual machine id""" + self.virtualmachineid = None + self.required = [] + +class listAffinityGroupsResponse (baseResponse): + def __init__(self): + """the ID of the affinity group""" + self.id = None + """the account owning the affinity group""" + self.account = None + """the description of the affinity group""" + self.description = None + """the domain name of the affinity group""" + self.domain = None + """the domain ID of the affinity group""" + self.domainid = None + """the name of the affinity group""" + self.name = None + """the type of the affinity group""" + self.type = None + """virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAlerts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAlerts.py new file mode 100644 index 00000000000..bcbd1cfc6e4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listAlerts.py @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all alerts.""" +from baseCmd import * +from baseResponse import * +class listAlertsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the alert""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """list by alert type""" + self.type = None + self.required = [] + +class listAlertsResponse (baseResponse): + def __init__(self): + """the id of the alert""" + self.id = None + """description of the alert""" + self.description = None + """the date and time the alert was sent""" + self.sent = None + """One of the following alert types: MEMORY = 0, CPU = 1, STORAGE = 2, STORAGE_ALLOCATED = 3, PUBLIC_IP = 4, PRIVATE_IP = 5, HOST = 6, USERVM = 7, DOMAIN_ROUTER = 8, CONSOLE_PROXY = 9, ROUTING = 10: lost connection to default route (to the gateway), STORAGE_MISC = 11: lost connection to default route (to the gateway), USAGE_SERVER = 12: lost connection to default route (to the gateway), MANAGMENT_NODE = 13: lost connection to default route (to the gateway), DOMAIN_ROUTER_MIGRATE = 14, CONSOLE_PROXY_MIGRATE = 15, USERVM_MIGRATE = 16, VLAN = 17, SSVM = 18, USAGE_SERVER_RESULT = 19""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listApis.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listApis.py new file mode 100644 index 00000000000..99269698d08 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listApis.py @@ -0,0 +1,75 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""lists all available apis on the server, provided by the Api Discovery plugin""" +from baseCmd import * +from baseResponse import * +class listApisCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """API name""" + self.name = None + self.required = [] + +class listApisResponse (baseResponse): + def __init__(self): + """description of the api""" + self.description = None + """true if api is asynchronous""" + self.isasync = None + """the name of the api command""" + self.name = None + """comma separated related apis""" + self.related = None + """version of CloudStack the api was introduced in""" + self.since = None + """response field type""" + self.type = None + """the list params the api accepts""" + self.params = [] + """api response fields""" + self.response = [] + +class params: + def __init__(self): + """"description of the api parameter""" + self.description = None + """"length of the parameter""" + self.length = None + """"the name of the api parameter""" + self.name = None + """"comma separated related apis to get the parameter""" + self.related = None + """"true if this parameter is required for the api request""" + self.required = None + """"version of CloudStack the api was introduced in""" + self.since = None + """"parameter type""" + self.type = None + +class response: + def __init__(self): + """"description of the api response field""" + self.description = None + """"the name of the api response field""" + self.name = None + """"api response fields""" + self.response = None + """"response field type""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAsyncJobs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAsyncJobs.py new file mode 100644 index 00000000000..7670845ea50 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listAsyncJobs.py @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all pending asynchronous jobs for the account.""" +from baseCmd import * +from baseResponse import * +class listAsyncJobsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """the start date of the async job""" + self.startdate = None + self.required = [] + +class listAsyncJobsResponse (baseResponse): + def __init__(self): + """the account that executed the async command""" + self.accountid = None + """the async command executed""" + self.cmd = None + """the created date of the job""" + self.created = None + """the unique ID of the instance/entity object related to the job""" + self.jobinstanceid = None + """the instance/entity object related to the job""" + self.jobinstancetype = None + """the progress information of the PENDING job""" + self.jobprocstatus = None + """the result reason""" + self.jobresult = None + """the result code for the job""" + self.jobresultcode = None + """the result type""" + self.jobresulttype = None + """the current job status-should be 0 for PENDING""" + self.jobstatus = None + """the user that executed the async command""" + self.userid = None + """the ID of the async job""" + self.jobid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScalePolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScalePolicies.py new file mode 100644 index 00000000000..a579b5cf0cd --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScalePolicies.py @@ -0,0 +1,71 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists autoscale policies.""" +from baseCmd import * +from baseResponse import * +class listAutoScalePoliciesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """the action to be executed if all the conditions evaluate to true for the specified duration.""" + self.action = None + """the ID of the condition of the policy""" + self.conditionid = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the ID of the autoscale policy""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """the ID of the autoscale vm group""" + self.vmgroupid = None + self.required = [] + +class listAutoScalePoliciesResponse (baseResponse): + def __init__(self): + """the autoscale policy ID""" + self.id = None + """the account owning the autoscale policy""" + self.account = None + """the action to be executed if all the conditions evaluate to true for the specified duration.""" + self.action = None + """the list of IDs of the conditions that are being evaluated on every interval""" + self.conditions = None + """the domain name of the autoscale policy""" + self.domain = None + """the domain ID of the autoscale policy""" + self.domainid = None + """the duration for which the conditions have to be true before action is taken""" + self.duration = None + """the project name of the autoscale policy""" + self.project = None + """the project id autoscale policy""" + self.projectid = None + """the cool down period for which the policy should not be evaluated after the action has been taken""" + self.quiettime = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmGroups.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmGroups.py new file mode 100644 index 00000000000..04e79e44357 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmGroups.py @@ -0,0 +1,83 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists autoscale vm groups.""" +from baseCmd import * +from baseResponse import * +class listAutoScaleVmGroupsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the ID of the autoscale vm group""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """the ID of the loadbalancer""" + self.lbruleid = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """the ID of the policy""" + self.policyid = None + """list objects by project""" + self.projectid = None + """the ID of the profile""" + self.vmprofileid = None + """the availability zone ID""" + self.zoneid = None + self.required = [] + +class listAutoScaleVmGroupsResponse (baseResponse): + def __init__(self): + """the autoscale vm group ID""" + self.id = None + """the account owning the instance group""" + self.account = None + """the domain name of the vm profile""" + self.domain = None + """the domain ID of the vm profile""" + self.domainid = None + """the frequency at which the conditions have to be evaluated""" + self.interval = None + """the load balancer rule ID""" + self.lbruleid = None + """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" + self.maxmembers = None + """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" + self.minmembers = None + """the project name of the vm profile""" + self.project = None + """the project id vm profile""" + self.projectid = None + """list of scaledown autoscale policies""" + self.scaledownpolicies = None + """list of scaleup autoscale policies""" + self.scaleuppolicies = None + """the current state of the AutoScale Vm Group""" + self.state = None + """the autoscale profile that contains information about the vms in the vm group.""" + self.vmprofileid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmProfiles.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmProfiles.py new file mode 100644 index 00000000000..6e3244d0671 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmProfiles.py @@ -0,0 +1,75 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists autoscale vm profiles.""" +from baseCmd import * +from baseResponse import * +class listAutoScaleVmProfilesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the ID of the autoscale vm profile""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """the otherdeployparameters of the autoscale vm profile""" + self.otherdeployparams = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """the templateid of the autoscale vm profile""" + self.templateid = None + self.required = [] + +class listAutoScaleVmProfilesResponse (baseResponse): + def __init__(self): + """the autoscale vm profile ID""" + self.id = None + """the account owning the instance group""" + self.account = None + """the ID of the user used to launch and destroy the VMs""" + self.autoscaleuserid = None + """the time allowed for existing connections to get closed before a vm is destroyed""" + self.destroyvmgraceperiod = None + """the domain name of the vm profile""" + self.domain = None + """the domain ID of the vm profile""" + self.domainid = None + """parameters other than zoneId/serviceOfferringId/templateId to be used while deploying a virtual machine""" + self.otherdeployparams = None + """the project name of the vm profile""" + self.project = None + """the project id vm profile""" + self.projectid = None + """the service offering to be used while deploying a virtual machine""" + self.serviceofferingid = None + """the template to be used while deploying a virtual machine""" + self.templateid = None + """the availability zone to be used while deploying a virtual machine""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalDhcp.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalDhcp.py new file mode 100644 index 00000000000..073706dc2df --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalDhcp.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""list baremetal dhcp servers""" +from baseCmd import * +from baseResponse import * +class listBaremetalDhcpCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Type of DHCP device""" + self.dhcpservertype = None + """DHCP server device ID""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listBaremetalDhcpResponse (baseResponse): + def __init__(self): + """device id of""" + self.id = None + """name of the provider""" + self.dhcpservertype = None + """the physical network to which this external dhcp device belongs to""" + self.physicalnetworkid = None + """name of the provider""" + self.provider = None + """url""" + self.url = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalPxeServers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalPxeServers.py new file mode 100644 index 00000000000..5b9bb22257d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalPxeServers.py @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""list baremetal pxe server""" +from baseCmd import * +from baseResponse import * +class listBaremetalPxeServersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Pxe server device ID""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listBaremetalPxeServersResponse (baseResponse): + def __init__(self): + """device id of""" + self.id = None + """the physical network to which this external dhcp device belongs to""" + self.physicalnetworkid = None + """name of the provider""" + self.provider = None + """url""" + self.url = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listBigSwitchVnsDevices.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listBigSwitchVnsDevices.py new file mode 100644 index 00000000000..6f7bc8177d3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listBigSwitchVnsDevices.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists BigSwitch Vns devices""" +from baseCmd import * +from baseResponse import * +class listBigSwitchVnsDevicesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """the Physical Network ID""" + self.physicalnetworkid = None + """bigswitch vns device ID""" + self.vnsdeviceid = None + self.required = [] + +class listBigSwitchVnsDevicesResponse (baseResponse): + def __init__(self): + """device name""" + self.bigswitchdevicename = None + """the controller Ip address""" + self.hostname = None + """the physical network to which this BigSwitch Vns belongs to""" + self.physicalnetworkid = None + """name of the provider""" + self.provider = None + """device id of the BigSwitch Vns""" + self.vnsdeviceid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listCapabilities.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listCapabilities.py new file mode 100644 index 00000000000..317ff24a128 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listCapabilities.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists capabilities""" +from baseCmd import * +from baseResponse import * +class listCapabilitiesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + self.required = [] + +class listCapabilitiesResponse (baseResponse): + def __init__(self): + """true if regular user is allowed to create projects""" + self.allowusercreateprojects = None + """time interval (in seconds) to reset api count""" + self.apilimitinterval = None + """Max allowed number of api requests within the specified interval""" + self.apilimitmax = None + """version of the cloud stack""" + self.cloudstackversion = None + """maximum size that can be specified when create disk from disk offering with custom size""" + self.customdiskofferingmaxsize = None + """If invitation confirmation is required when add account to project""" + self.projectinviterequired = None + """true if region wide secondary is enabled, false otherwise""" + self.regionsecondaryenabled = None + """true if security groups support is enabled, false otherwise""" + self.securitygroupsenabled = None + """true if region supports elastic load balancer on basic zones""" + self.supportELB = None + """true if user and domain admins can set templates to be shared, false otherwise""" + self.userpublictemplateenabled = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listCapacity.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listCapacity.py new file mode 100644 index 00000000000..adf6452dc6c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listCapacity.py @@ -0,0 +1,67 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all the system wide capacities.""" +from baseCmd import * +from baseResponse import * +class listCapacityCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """lists capacity by the Cluster ID""" + self.clusterid = None + """recalculate capacities and fetch the latest""" + self.fetchlatest = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """lists capacity by the Pod ID""" + self.podid = None + """Sort the results. Available values: Usage""" + self.sortby = None + """lists capacity by type* CAPACITY_TYPE_MEMORY = 0* CAPACITY_TYPE_CPU = 1* CAPACITY_TYPE_STORAGE = 2* CAPACITY_TYPE_STORAGE_ALLOCATED = 3* CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = 4* CAPACITY_TYPE_PRIVATE_IP = 5* CAPACITY_TYPE_SECONDARY_STORAGE = 6* CAPACITY_TYPE_VLAN = 7* CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8* CAPACITY_TYPE_LOCAL_STORAGE = 9.""" + self.type = None + """lists capacity by the Zone ID""" + self.zoneid = None + self.required = [] + +class listCapacityResponse (baseResponse): + def __init__(self): + """the total capacity available""" + self.capacitytotal = None + """the capacity currently in use""" + self.capacityused = None + """the Cluster ID""" + self.clusterid = None + """the Cluster name""" + self.clustername = None + """the percentage of capacity currently in use""" + self.percentused = None + """the Pod ID""" + self.podid = None + """the Pod name""" + self.podname = None + """the capacity type""" + self.type = None + """the Zone ID""" + self.zoneid = None + """the Zone name""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listClusters.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listClusters.py new file mode 100644 index 00000000000..c0cc067cde6 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listClusters.py @@ -0,0 +1,102 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists clusters.""" +from baseCmd import * +from baseResponse import * +class listClustersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """lists clusters by allocation state""" + self.allocationstate = None + """lists clusters by cluster type""" + self.clustertype = None + """lists clusters by hypervisor type""" + self.hypervisor = None + """lists clusters by the cluster ID""" + self.id = None + """List by keyword""" + self.keyword = None + """whether this cluster is managed by cloudstack""" + self.managedstate = None + """lists clusters by the cluster name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """lists clusters by Pod ID""" + self.podid = None + """flag to display the capacity of the clusters""" + self.showcapacities = None + """lists clusters by Zone ID""" + self.zoneid = None + self.required = [] + +class listClustersResponse (baseResponse): + def __init__(self): + """the cluster ID""" + self.id = None + """the allocation state of the cluster""" + self.allocationstate = None + """the type of the cluster""" + self.clustertype = None + """The cpu overcommit ratio of the cluster""" + self.cpuovercommitratio = None + """the hypervisor type of the cluster""" + self.hypervisortype = None + """whether this cluster is managed by cloudstack""" + self.managedstate = None + """The memory overcommit ratio of the cluster""" + self.memoryovercommitratio = None + """the cluster name""" + self.name = None + """the Pod ID of the cluster""" + self.podid = None + """the Pod name of the cluster""" + self.podname = None + """the Zone ID of the cluster""" + self.zoneid = None + """the Zone name of the cluster""" + self.zonename = None + """the capacity of the Cluster""" + self.capacity = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listConditions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listConditions.py new file mode 100644 index 00000000000..f19c205cdd8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listConditions.py @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List Conditions for the specific user""" +from baseCmd import * +from baseResponse import * +class listConditionsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """Counter-id of the condition.""" + self.counterid = None + """list only resources belonging to the domain specified""" + self.domainid = None + """ID of the Condition.""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """the ID of the policy""" + self.policyid = None + self.required = [] + +class listConditionsResponse (baseResponse): + def __init__(self): + """the id of the Condition""" + self.id = None + """the owner of the Condition.""" + self.account = None + """Details of the Counter.""" + self.counter = None + """the domain name of the owner.""" + self.domain = None + """the domain id of the Condition owner""" + self.domainid = None + """the project name of the Condition""" + self.project = None + """the project id of the Condition.""" + self.projectid = None + """Relational Operator to be used with threshold.""" + self.relationaloperator = None + """Threshold Value for the counter.""" + self.threshold = None + """zone id of counter""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listConfigurations.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listConfigurations.py new file mode 100644 index 00000000000..538232370bf --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listConfigurations.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all configurations.""" +from baseCmd import * +from baseResponse import * +class listConfigurationsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the Account to update the parameter value for corresponding account""" + self.accountid = None + """lists configurations by category""" + self.category = None + """the ID of the Cluster to update the parameter value for corresponding cluster""" + self.clusterid = None + """List by keyword""" + self.keyword = None + """lists configuration by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the ID of the Storage pool to update the parameter value for corresponding storage pool""" + self.storageid = None + """the ID of the Zone to update the parameter value for corresponding zone""" + self.zoneid = None + self.required = [] + +class listConfigurationsResponse (baseResponse): + def __init__(self): + """the value of the configuration""" + self.id = None + """the category of the configuration""" + self.category = None + """the description of the configuration""" + self.description = None + """the name of the configuration""" + self.name = None + """scope(zone/cluster/pool/account) of the parameter that needs to be updated""" + self.scope = None + """the value of the configuration""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listCounters.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listCounters.py new file mode 100644 index 00000000000..105b2feb197 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listCounters.py @@ -0,0 +1,51 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List the counters""" +from baseCmd import * +from baseResponse import * +class listCountersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """ID of the Counter.""" + self.id = None + """List by keyword""" + self.keyword = None + """Name of the counter.""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """Source of the counter.""" + self.source = None + self.required = [] + +class listCountersResponse (baseResponse): + def __init__(self): + """the id of the Counter""" + self.id = None + """Name of the counter.""" + self.name = None + """Source of the counter.""" + self.source = None + """Value in case of snmp or other specific counters.""" + self.value = None + """zone id of counter""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedClusters.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedClusters.py new file mode 100644 index 00000000000..6afffa4a440 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedClusters.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists dedicated clusters.""" +from baseCmd import * +from baseResponse import * +class listDedicatedClustersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the name of the account associated with the cluster. Must be used with domainId.""" + self.account = None + """list dedicated clusters by affinity group""" + self.affinitygroupid = None + """the ID of the cluster""" + self.clusterid = None + """the ID of the domain associated with the cluster""" + self.domainid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listDedicatedClustersResponse (baseResponse): + def __init__(self): + """the ID of the dedicated resource""" + self.id = None + """the Account ID of the cluster""" + self.accountid = None + """the Dedication Affinity Group ID of the cluster""" + self.affinitygroupid = None + """the ID of the cluster""" + self.clusterid = None + """the name of the cluster""" + self.clustername = None + """the domain ID of the cluster""" + self.domainid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedGuestVlanRanges.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedGuestVlanRanges.py new file mode 100644 index 00000000000..9cb0d570da5 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedGuestVlanRanges.py @@ -0,0 +1,67 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists dedicated guest vlan ranges""" +from baseCmd import * +from baseResponse import * +class listDedicatedGuestVlanRangesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the account with which the guest VLAN range is associated. Must be used with the domainId parameter.""" + self.account = None + """the domain ID with which the guest VLAN range is associated. If used with the account parameter, returns all guest VLAN ranges for that account in the specified domain.""" + self.domainid = None + """the dedicated guest vlan range""" + self.guestvlanrange = None + """list dedicated guest vlan ranges by id""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """physical network id of the guest VLAN range""" + self.physicalnetworkid = None + """project who will own the guest VLAN range""" + self.projectid = None + """zone of the guest VLAN range""" + self.zoneid = None + self.required = [] + +class listDedicatedGuestVlanRangesResponse (baseResponse): + def __init__(self): + """the ID of the guest VLAN range""" + self.id = None + """the account of the guest VLAN range""" + self.account = None + """the domain name of the guest VLAN range""" + self.domain = None + """the domain ID of the guest VLAN range""" + self.domainid = None + """the guest VLAN range""" + self.guestvlanrange = None + """the physical network of the guest vlan range""" + self.physicalnetworkid = None + """the project name of the guest vlan range""" + self.project = None + """the project id of the guest vlan range""" + self.projectid = None + """the zone of the guest vlan range""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedHosts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedHosts.py new file mode 100644 index 00000000000..d2f8aaf5e87 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedHosts.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists dedicated hosts.""" +from baseCmd import * +from baseResponse import * +class listDedicatedHostsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the name of the account associated with the host. Must be used with domainId.""" + self.account = None + """list dedicated hosts by affinity group""" + self.affinitygroupid = None + """the ID of the domain associated with the host""" + self.domainid = None + """the ID of the host""" + self.hostid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listDedicatedHostsResponse (baseResponse): + def __init__(self): + """the ID of the dedicated resource""" + self.id = None + """the Account ID of the host""" + self.accountid = None + """the Dedication Affinity Group ID of the host""" + self.affinitygroupid = None + """the domain ID of the host""" + self.domainid = None + """the ID of the host""" + self.hostid = None + """the name of the host""" + self.hostname = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedPods.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedPods.py new file mode 100644 index 00000000000..245f0e36eff --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedPods.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists dedicated pods.""" +from baseCmd import * +from baseResponse import * +class listDedicatedPodsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the name of the account associated with the pod. Must be used with domainId.""" + self.account = None + """list dedicated pods by affinity group""" + self.affinitygroupid = None + """the ID of the domain associated with the pod""" + self.domainid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """the ID of the pod""" + self.podid = None + self.required = [] + +class listDedicatedPodsResponse (baseResponse): + def __init__(self): + """the ID of the dedicated resource""" + self.id = None + """the Account Id to which the Pod is dedicated""" + self.accountid = None + """the Dedication Affinity Group ID of the pod""" + self.affinitygroupid = None + """the domain ID to which the Pod is dedicated""" + self.domainid = None + """the ID of the Pod""" + self.podid = None + """the Name of the Pod""" + self.podname = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedZones.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedZones.py new file mode 100644 index 00000000000..d287010ae72 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedZones.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List dedicated zones.""" +from baseCmd import * +from baseResponse import * +class listDedicatedZonesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the name of the account associated with the zone. Must be used with domainId.""" + self.account = None + """list dedicated zones by affinity group""" + self.affinitygroupid = None + """the ID of the domain associated with the zone""" + self.domainid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """the ID of the Zone""" + self.zoneid = None + self.required = [] + +class listDedicatedZonesResponse (baseResponse): + def __init__(self): + """the ID of the dedicated resource""" + self.id = None + """the Account Id to which the Zone is dedicated""" + self.accountid = None + """the Dedication Affinity Group ID of the zone""" + self.affinitygroupid = None + """the domain ID to which the Zone is dedicated""" + self.domainid = None + """the ID of the Zone""" + self.zoneid = None + """the Name of the Zone""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDeploymentPlanners.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDeploymentPlanners.py new file mode 100644 index 00000000000..6adefdc4d33 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDeploymentPlanners.py @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all DeploymentPlanners available.""" +from baseCmd import * +from baseResponse import * +class listDeploymentPlannersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listDeploymentPlannersResponse (baseResponse): + def __init__(self): + """Deployment Planner name""" + self.name = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDiskOfferings.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDiskOfferings.py new file mode 100644 index 00000000000..c49758d2750 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDiskOfferings.py @@ -0,0 +1,77 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all available disk offerings.""" +from baseCmd import * +from baseResponse import * +class listDiskOfferingsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the domain of the disk offering.""" + self.domainid = None + """ID of the disk offering""" + self.id = None + """List by keyword""" + self.keyword = None + """name of the disk offering""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listDiskOfferingsResponse (baseResponse): + def __init__(self): + """unique ID of the disk offering""" + self.id = None + """the date this disk offering was created""" + self.created = None + """bytes read rate of the disk offering""" + self.diskBytesReadRate = None + """bytes write rate of the disk offering""" + self.diskBytesWriteRate = None + """io requests read rate of the disk offering""" + self.diskIopsReadRate = None + """io requests write rate of the disk offering""" + self.diskIopsWriteRate = None + """the size of the disk offering in GB""" + self.disksize = None + """whether to display the offering to the end user or not.""" + self.displayoffering = None + """an alternate display text of the disk offering.""" + self.displaytext = None + """the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.""" + self.domain = None + """the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.""" + self.domainid = None + """true if disk offering uses custom size, false otherwise""" + self.iscustomized = None + """true if disk offering uses custom iops, false otherwise""" + self.iscustomizediops = None + """the max iops of the disk offering""" + self.maxiops = None + """the min iops of the disk offering""" + self.miniops = None + """the name of the disk offering""" + self.name = None + """the storage type for this disk offering""" + self.storagetype = None + """the tags for the disk offering""" + self.tags = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDomainChildren.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDomainChildren.py new file mode 100644 index 00000000000..83c1fb9abbf --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDomainChildren.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all children domains belonging to a specified domain""" +from baseCmd import * +from baseResponse import * +class listDomainChildrenCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list children domain by parent domain ID.""" + self.id = None + """to return the entire tree, use the value "true". To return the first level children, use the value "false".""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """list children domains by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listDomainChildrenResponse (baseResponse): + def __init__(self): + """the ID of the domain""" + self.id = None + """whether the domain has one or more sub-domains""" + self.haschild = None + """the level of the domain""" + self.level = None + """the name of the domain""" + self.name = None + """the network domain""" + self.networkdomain = None + """the domain ID of the parent domain""" + self.parentdomainid = None + """the domain name of the parent domain""" + self.parentdomainname = None + """the path of the domain""" + self.path = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDomains.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDomains.py new file mode 100644 index 00000000000..1f8c929b317 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listDomains.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists domains and provides detailed information for listed domains""" +from baseCmd import * +from baseResponse import * +class listDomainsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List domain by domain ID.""" + self.id = None + """List by keyword""" + self.keyword = None + """List domains by domain level.""" + self.level = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """List domain by domain name.""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listDomainsResponse (baseResponse): + def __init__(self): + """the ID of the domain""" + self.id = None + """whether the domain has one or more sub-domains""" + self.haschild = None + """the level of the domain""" + self.level = None + """the name of the domain""" + self.name = None + """the network domain""" + self.networkdomain = None + """the domain ID of the parent domain""" + self.parentdomainid = None + """the domain name of the parent domain""" + self.parentdomainname = None + """the path of the domain""" + self.path = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listEgressFirewallRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listEgressFirewallRules.py new file mode 100644 index 00000000000..38f169c54f7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listEgressFirewallRules.py @@ -0,0 +1,102 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all egress firewall rules for network id.""" +from baseCmd import * +from baseResponse import * +class listEgressFirewallRulesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """Lists rule with the specified ID.""" + self.id = None + """Lists rule with the specified ID.""" + self.id = None + """the id of IP address of the firwall services""" + self.ipaddressid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """the id network network for the egress firwall services""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + self.required = [] + +class listEgressFirewallRulesResponse (baseResponse): + def __init__(self): + """the ID of the firewall rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the ending port of firewall rule's port range""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """the public ip address for the firewall rule""" + self.ipaddress = None + """the public ip address id for the firewall rule""" + self.ipaddressid = None + """the network id of the firewall rule""" + self.networkid = None + """the protocol of the firewall rule""" + self.protocol = None + """the starting port of firewall rule's port range""" + self.startport = None + """the state of the rule""" + self.state = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listEventTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listEventTypes.py new file mode 100644 index 00000000000..46a1341df19 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listEventTypes.py @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List Event Types""" +from baseCmd import * +from baseResponse import * +class listEventTypesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + self.required = [] + +class listEventTypesResponse (baseResponse): + def __init__(self): + """Event Type""" + self.name = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listEvents.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listEvents.py new file mode 100644 index 00000000000..5e4646f29d1 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listEvents.py @@ -0,0 +1,85 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""A command to list events.""" +from baseCmd import * +from baseResponse import * +class listEventsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the duration of the event""" + self.duration = None + """the end date range of the list you want to retrieve (use format "yyyy-MM-dd" or the new format "yyyy-MM-dd HH:mm:ss")""" + self.enddate = None + """the time the event was entered""" + self.entrytime = None + """the ID of the event""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """the event level (INFO, WARN, ERROR)""" + self.level = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """the start date range of the list you want to retrieve (use format "yyyy-MM-dd" or the new format "yyyy-MM-dd HH:mm:ss")""" + self.startdate = None + """the event type (see event types)""" + self.type = None + self.required = [] + +class listEventsResponse (baseResponse): + def __init__(self): + """the ID of the event""" + self.id = None + """the account name for the account that owns the object being acted on in the event (e.g. the owner of the virtual machine, ip address, or security group)""" + self.account = None + """the date the event was created""" + self.created = None + """a brief description of the event""" + self.description = None + """the name of the account's domain""" + self.domain = None + """the id of the account's domain""" + self.domainid = None + """the event level (INFO, WARN, ERROR)""" + self.level = None + """whether the event is parented""" + self.parentid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the state of the event""" + self.state = None + """the type of the event (see event types)""" + self.type = None + """the name of the user who performed the action (can be different from the account if an admin is performing an action for a user, e.g. starting/stopping a user's virtual machine)""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listFirewallRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listFirewallRules.py new file mode 100644 index 00000000000..bb19ca1ec15 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listFirewallRules.py @@ -0,0 +1,98 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all firewall rules for an IP address.""" +from baseCmd import * +from baseResponse import * +class listFirewallRulesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """Lists rule with the specified ID.""" + self.id = None + """the id of IP address of the firwall services""" + self.ipaddressid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + self.required = [] + +class listFirewallRulesResponse (baseResponse): + def __init__(self): + """the ID of the firewall rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the ending port of firewall rule's port range""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """the public ip address for the firewall rule""" + self.ipaddress = None + """the public ip address id for the firewall rule""" + self.ipaddressid = None + """the network id of the firewall rule""" + self.networkid = None + """the protocol of the firewall rule""" + self.protocol = None + """the starting port of firewall rule's port range""" + self.startport = None + """the state of the rule""" + self.state = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listGlobalLoadBalancerRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listGlobalLoadBalancerRules.py new file mode 100644 index 00000000000..ac55b10901b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listGlobalLoadBalancerRules.py @@ -0,0 +1,161 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists load balancer rules.""" +from baseCmd import * +from baseResponse import * +class listGlobalLoadBalancerRulesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the ID of the global load balancer rule""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """region ID""" + self.regionid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + self.required = [] + +class listGlobalLoadBalancerRulesResponse (baseResponse): + def __init__(self): + """global load balancer rule ID""" + self.id = None + """the account of the load balancer rule""" + self.account = None + """the description of the global load balancer rule""" + self.description = None + """the domain of the load balancer rule""" + self.domain = None + """the domain ID of the load balancer rule""" + self.domainid = None + """DNS domain name given for the global load balancer""" + self.gslbdomainname = None + """Load balancing method used for the global load balancer""" + self.gslblbmethod = None + """GSLB service type""" + self.gslbservicetype = None + """session persistence method used for the global load balancer""" + self.gslbstickysessionmethodname = None + """name of the global load balancer rule""" + self.name = None + """the project name of the load balancer""" + self.project = None + """the project id of the load balancer""" + self.projectid = None + """Region Id in which global load balancer is created""" + self.regionid = None + """List of load balancer rules that are part of GSLB rule""" + self.loadbalancerrule = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class loadbalancerrule: + def __init__(self): + """"the load balancer rule ID""" + self.id = None + """"the account of the load balancer rule""" + self.account = None + """"the load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """"the cidr list to forward traffic from""" + self.cidrlist = None + """"the description of the load balancer""" + self.description = None + """"the domain of the load balancer rule""" + self.domain = None + """"the domain ID of the load balancer rule""" + self.domainid = None + """"the name of the load balancer""" + self.name = None + """"the id of the guest network the lb rule belongs to""" + self.networkid = None + """"the private port""" + self.privateport = None + """"the project name of the load balancer""" + self.project = None + """"the project id of the load balancer""" + self.projectid = None + """"the public ip address""" + self.publicip = None + """"the public ip address id""" + self.publicipid = None + """"the public port""" + self.publicport = None + """"the state of the rule""" + self.state = None + """"the id of the zone the rule belongs to""" + self.zoneid = None + """"the list of resource tags associated with load balancer""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listHosts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listHosts.py new file mode 100644 index 00000000000..5b74a59db01 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listHosts.py @@ -0,0 +1,147 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists hosts.""" +from baseCmd import * +from baseResponse import * +class listHostsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """lists hosts existing in particular cluster""" + self.clusterid = None + """comma separated list of host details requested, value can be a list of [ min, all, capacity, events, stats]""" + self.details = [] + """if true, list only hosts dedicated to HA""" + self.hahost = None + """the id of the host""" + self.id = None + """List by keyword""" + self.keyword = None + """the name of the host""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the Pod ID for the host""" + self.podid = None + """list hosts by resource state. Resource state represents current state determined by admin of host, valule can be one of [Enabled, Disabled, Unmanaged, PrepareForMaintenance, ErrorInMaintenance, Maintenance, Error]""" + self.resourcestate = None + """the state of the host""" + self.state = None + """the host type""" + self.type = None + """lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM""" + self.virtualmachineid = None + """the Zone ID for the host""" + self.zoneid = None + self.required = [] + +class listHostsResponse (baseResponse): + def __init__(self): + """the ID of the host""" + self.id = None + """the cpu average load on the host""" + self.averageload = None + """capabilities of the host""" + self.capabilities = None + """the cluster ID of the host""" + self.clusterid = None + """the cluster name of the host""" + self.clustername = None + """the cluster type of the cluster that host belongs to""" + self.clustertype = None + """the amount of the host's CPU currently allocated""" + self.cpuallocated = None + """the CPU number of the host""" + self.cpunumber = None + """the CPU speed of the host""" + self.cpuspeed = None + """the amount of the host's CPU currently used""" + self.cpuused = None + """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" + self.cpuwithoverprovisioning = None + """the date and time the host was created""" + self.created = None + """true if the host is disconnected. False otherwise.""" + self.disconnected = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the host""" + self.disksizetotal = None + """events available for the host""" + self.events = None + """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" + self.hahost = None + """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" + self.hasenoughcapacity = None + """comma-separated list of tags for the host""" + self.hosttags = None + """the host hypervisor""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the IP address of the host""" + self.ipaddress = None + """true if local storage is active, false otherwise""" + self.islocalstorageactive = None + """the date and time the host was last pinged""" + self.lastpinged = None + """the management server ID of the host""" + self.managementserverid = None + """the amount of the host's memory currently allocated""" + self.memoryallocated = None + """the memory total of the host""" + self.memorytotal = None + """the amount of the host's memory currently used""" + self.memoryused = None + """the name of the host""" + self.name = None + """the incoming network traffic on the host""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the OS category ID of the host""" + self.oscategoryid = None + """the OS category name of the host""" + self.oscategoryname = None + """the Pod ID of the host""" + self.podid = None + """the Pod name of the host""" + self.podname = None + """the date and time the host was removed""" + self.removed = None + """the resource state of the host""" + self.resourcestate = None + """the state of the host""" + self.state = None + """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" + self.suitableformigration = None + """the host type""" + self.type = None + """the host version""" + self.version = None + """the Zone ID of the host""" + self.zoneid = None + """the Zone name of the host""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisorCapabilities.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisorCapabilities.py new file mode 100644 index 00000000000..3547f276ffe --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisorCapabilities.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all hypervisor capabilities.""" +from baseCmd import * +from baseResponse import * +class listHypervisorCapabilitiesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the hypervisor for which to restrict the search""" + self.hypervisor = None + """ID of the hypervisor capability""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listHypervisorCapabilitiesResponse (baseResponse): + def __init__(self): + """the ID of the hypervisor capabilities row""" + self.id = None + """the hypervisor type""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the maximum number of Data Volumes that can be attached for this hypervisor""" + self.maxdatavolumeslimit = None + """the maximum number of guest vms recommended for this hypervisor""" + self.maxguestslimit = None + """the maximum number of Hosts per cluster for this hypervisor""" + self.maxhostspercluster = None + """true if security group is supported""" + self.securitygroupenabled = None + """true if storage motion is supported""" + self.storagemotionenabled = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisors.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisors.py new file mode 100644 index 00000000000..a49dc5018f9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisors.py @@ -0,0 +1,33 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List hypervisors""" +from baseCmd import * +from baseResponse import * +class listHypervisorsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the zone id for listing hypervisors.""" + self.zoneid = None + self.required = [] + +class listHypervisorsResponse (baseResponse): + def __init__(self): + """Hypervisor name""" + self.name = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listImageStores.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listImageStores.py new file mode 100644 index 00000000000..21c649b7712 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listImageStores.py @@ -0,0 +1,63 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists image stores.""" +from baseCmd import * +from baseResponse import * +class listImageStoresCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the storage pool""" + self.id = None + """List by keyword""" + self.keyword = None + """the name of the image store""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the image store protocol""" + self.protocol = None + """the image store provider""" + self.provider = None + """the Zone ID for the image store""" + self.zoneid = None + self.required = [] + +class listImageStoresResponse (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listInstanceGroups.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listInstanceGroups.py new file mode 100644 index 00000000000..6a0bbaebf29 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listInstanceGroups.py @@ -0,0 +1,65 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists vm groups""" +from baseCmd import * +from baseResponse import * +class listInstanceGroupsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list instance groups by ID""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """list instance groups by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + self.required = [] + +class listInstanceGroupsResponse (baseResponse): + def __init__(self): + """the id of the instance group""" + self.id = None + """the account owning the instance group""" + self.account = None + """time and date the instance group was created""" + self.created = None + """the domain name of the instance group""" + self.domain = None + """the domain ID of the instance group""" + self.domainid = None + """the name of the instance group""" + self.name = None + """the project name of the group""" + self.project = None + """the project id of the group""" + self.projectid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerElements.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerElements.py new file mode 100644 index 00000000000..794edada374 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerElements.py @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all available Internal Load Balancer elements.""" +from baseCmd import * +from baseResponse import * +class listInternalLoadBalancerElementsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list internal load balancer elements by enabled state""" + self.enabled = None + """list internal load balancer elements by id""" + self.id = None + """List by keyword""" + self.keyword = None + """list internal load balancer elements by network service provider id""" + self.nspid = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listInternalLoadBalancerElementsResponse (baseResponse): + def __init__(self): + """the id of the internal load balancer element""" + self.id = None + """Enabled/Disabled the element""" + self.enabled = None + """the physical network service provider id of the element""" + self.nspid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerVMs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerVMs.py new file mode 100644 index 00000000000..eee1d66f533 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerVMs.py @@ -0,0 +1,182 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List internal LB VMs.""" +from baseCmd import * +from baseResponse import * +class listInternalLoadBalancerVMsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """if true is passed for this parameter, list only VPC Internal LB VMs""" + self.forvpc = None + """the host ID of the Internal LB VM""" + self.hostid = None + """the ID of the Internal LB VM""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """the name of the Internal LB VM""" + self.name = None + """list by network id""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """the Pod ID of the Internal LB VM""" + self.podid = None + """list objects by project""" + self.projectid = None + """the state of the Internal LB VM""" + self.state = None + """List Internal LB VMs by VPC""" + self.vpcid = None + """the Zone ID of the Internal LB VM""" + self.zoneid = None + self.required = [] + +class listInternalLoadBalancerVMsResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listIpForwardingRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listIpForwardingRules.py new file mode 100644 index 00000000000..73838a2313d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listIpForwardingRules.py @@ -0,0 +1,104 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List the ip forwarding rules""" +from baseCmd import * +from baseResponse import * +class listIpForwardingRulesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """Lists rule with the specified ID.""" + self.id = None + """list the rule belonging to this public ip address""" + self.ipaddressid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """Lists all rules applied to the specified Vm.""" + self.virtualmachineid = None + self.required = [] + +class listIpForwardingRulesResponse (baseResponse): + def __init__(self): + """the ID of the port forwarding rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the public ip address for the port forwarding rule""" + self.ipaddress = None + """the public ip address id for the port forwarding rule""" + self.ipaddressid = None + """the ending port of port forwarding rule's private port range""" + self.privateendport = None + """the starting port of port forwarding rule's private port range""" + self.privateport = None + """the protocol of the port forwarding rule""" + self.protocol = None + """the ending port of port forwarding rule's private port range""" + self.publicendport = None + """the starting port of port forwarding rule's public port range""" + self.publicport = None + """the state of the rule""" + self.state = None + """the VM display name for the port forwarding rule""" + self.virtualmachinedisplayname = None + """the VM ID for the port forwarding rule""" + self.virtualmachineid = None + """the VM name for the port forwarding rule""" + self.virtualmachinename = None + """the vm ip address for the port forwarding rule""" + self.vmguestip = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listIsoPermissions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listIsoPermissions.py new file mode 100644 index 00000000000..0ad16c0eba4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listIsoPermissions.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List iso visibility and all accounts that have permissions to view this iso.""" +from baseCmd import * +from baseResponse import * +class listIsoPermissionsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the template ID""" + """Required""" + self.id = None + self.required = ["id",] + +class listIsoPermissionsResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the list of accounts the template is available for""" + self.account = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """the list of projects the template is available for""" + self.projectids = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listIsos.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listIsos.py new file mode 100644 index 00000000000..9394c0556f7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listIsos.py @@ -0,0 +1,162 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all available ISO files.""" +from baseCmd import * +from baseResponse import * +class listIsosCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the hypervisor for which to restrict the search""" + self.hypervisor = None + """list ISO by id""" + self.id = None + """possible values are "featured", "self", "selfexecutable","sharedexecutable","executable", and "community". * featured : templates that have been marked as featured and public. * self : templates that have been registered or created by the calling user. * selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. * sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. * executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. * community : templates that have been marked as public but not featured. * all : all templates (only usable by admins).""" + self.isofilter = None + """true if the ISO is publicly available to all users, false otherwise.""" + self.ispublic = None + """true if this ISO is ready to be deployed""" + self.isready = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """list all isos by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """the ID of the zone""" + self.zoneid = None + self.required = [] + +class listIsosResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLBHealthCheckPolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLBHealthCheckPolicies.py new file mode 100644 index 00000000000..03c312d8352 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listLBHealthCheckPolicies.py @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists load balancer HealthCheck policies.""" +from baseCmd import * +from baseResponse import * +class listLBHealthCheckPoliciesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the load balancer rule""" + """Required""" + self.lbruleid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["lbruleid",] + +class listLBHealthCheckPoliciesResponse (baseResponse): + def __init__(self): + """the account of the HealthCheck policy""" + self.account = None + """the domain of the HealthCheck policy""" + self.domain = None + """the domain ID of the HealthCheck policy""" + self.domainid = None + """the LB rule ID""" + self.lbruleid = None + """the id of the zone the HealthCheck policy belongs to""" + self.zoneid = None + """the list of healthcheckpolicies""" + self.healthcheckpolicy = [] + +class healthcheckpolicy: + def __init__(self): + """"the LB HealthCheck policy ID""" + self.id = None + """"the description of the healthcheck policy""" + self.description = None + """"Amount of time between health checks""" + self.healthcheckinterval = None + """"Number of consecutive health check success before declaring an instance healthy""" + self.healthcheckthresshold = None + """"the pingpath of the healthcheck policy""" + self.pingpath = None + """"Time to wait when receiving a response from the health check""" + self.responsetime = None + """"the state of the policy""" + self.state = None + """"Number of consecutive health check failures before declaring an instance unhealthy.""" + self.unhealthcheckthresshold = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLBStickinessPolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLBStickinessPolicies.py new file mode 100644 index 00000000000..1d3c7cbe551 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listLBStickinessPolicies.py @@ -0,0 +1,71 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists LBStickiness policies.""" +from baseCmd import * +from baseResponse import * +class listLBStickinessPoliciesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the load balancer rule""" + """Required""" + self.lbruleid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["lbruleid",] + +class listLBStickinessPoliciesResponse (baseResponse): + def __init__(self): + """the account of the Stickiness policy""" + self.account = None + """the description of the Stickiness policy""" + self.description = None + """the domain of the Stickiness policy""" + self.domain = None + """the domain ID of the Stickiness policy""" + self.domainid = None + """the LB rule ID""" + self.lbruleid = None + """the name of the Stickiness policy""" + self.name = None + """the state of the policy""" + self.state = None + """the id of the zone the Stickiness policy belongs to""" + self.zoneid = None + """the list of stickinesspolicies""" + self.stickinesspolicy = [] + +class stickinesspolicy: + def __init__(self): + """"the LB Stickiness policy ID""" + self.id = None + """"the description of the Stickiness policy""" + self.description = None + """"the method name of the Stickiness policy""" + self.methodname = None + """"the name of the Stickiness policy""" + self.name = None + """"the params of the policy""" + self.params = None + """"the state of the policy""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapConfigurations.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapConfigurations.py new file mode 100644 index 00000000000..3203a05f33c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapConfigurations.py @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all LDAP configurations""" +from baseCmd import * +from baseResponse import * +class listLdapConfigurationsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Hostname""" + self.hostname = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """Port""" + self.port = None + self.required = [] + +class listLdapConfigurationsResponse (baseResponse): + def __init__(self): + """hostname""" + self.hostname = None + """port""" + self.port = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapUsers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapUsers.py new file mode 100644 index 00000000000..0dec30e103b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapUsers.py @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all LDAP Users""" +from baseCmd import * +from baseResponse import * +class listLdapUsersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """Determines whether all ldap users are returned or just non-cloudstack users""" + self.listtype = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listLdapUsersResponse (baseResponse): + def __init__(self): + """The user's email""" + self.email = None + """The user's firstname""" + self.firstname = None + """The user's lastname""" + self.lastname = None + """The user's principle""" + self.principal = None + """The user's username""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRuleInstances.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRuleInstances.py new file mode 100644 index 00000000000..908ff440146 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRuleInstances.py @@ -0,0 +1,377 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List all virtual machine instances that are assigned to a load balancer rule.""" +from baseCmd import * +from baseResponse import * +class listLoadBalancerRuleInstancesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the load balancer rule""" + """Required""" + self.id = None + """true if listing all virtual machines currently applied to the load balancer rule; default is true""" + self.applied = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["id",] + +class listLoadBalancerRuleInstancesResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRules.py new file mode 100644 index 00000000000..770f3b3a88b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRules.py @@ -0,0 +1,118 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists load balancer rules.""" +from baseCmd import * +from baseResponse import * +class listLoadBalancerRulesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the ID of the load balancer rule""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """the name of the load balancer rule""" + self.name = None + """list by network id the rule belongs to""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """the public IP address id of the load balancer rule""" + self.publicipid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """the ID of the virtual machine of the load balancer rule""" + self.virtualmachineid = None + """the availability zone ID""" + self.zoneid = None + self.required = [] + +class listLoadBalancerRulesResponse (baseResponse): + def __init__(self): + """the load balancer rule ID""" + self.id = None + """the account of the load balancer rule""" + self.account = None + """the load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the description of the load balancer""" + self.description = None + """the domain of the load balancer rule""" + self.domain = None + """the domain ID of the load balancer rule""" + self.domainid = None + """the name of the load balancer""" + self.name = None + """the id of the guest network the lb rule belongs to""" + self.networkid = None + """the private port""" + self.privateport = None + """the project name of the load balancer""" + self.project = None + """the project id of the load balancer""" + self.projectid = None + """the public ip address""" + self.publicip = None + """the public ip address id""" + self.publicipid = None + """the public port""" + self.publicport = None + """the state of the rule""" + self.state = None + """the id of the zone the rule belongs to""" + self.zoneid = None + """the list of resource tags associated with load balancer""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancers.py new file mode 100644 index 00000000000..5cde328286e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancers.py @@ -0,0 +1,132 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists Load Balancers""" +from baseCmd import * +from baseResponse import * +class listLoadBalancersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the ID of the Load Balancer""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """the name of the Load Balancer""" + self.name = None + """the network id of the Load Balancer""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """the scheme of the Load Balancer. Supported value is Internal in the current release""" + self.scheme = None + """the source ip address of the Load Balancer""" + self.sourceipaddress = None + """the network id of the source ip address""" + self.sourceipaddressnetworkid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + self.required = [] + +class listLoadBalancersResponse (baseResponse): + def __init__(self): + """the Load Balancer ID""" + self.id = None + """the account of the Load Balancer""" + self.account = None + """the load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """the description of the Load Balancer""" + self.description = None + """the domain of the Load Balancer""" + self.domain = None + """the domain ID of the Load Balancer""" + self.domainid = None + """the name of the Load Balancer""" + self.name = None + """Load Balancer network id""" + self.networkid = None + """the project name of the Load Balancer""" + self.project = None + """the project id of the Load Balancer""" + self.projectid = None + """Load Balancer source ip""" + self.sourceipaddress = None + """Load Balancer source ip network id""" + self.sourceipaddressnetworkid = None + """the list of instances associated with the Load Balancer""" + self.loadbalancerinstance = [] + """the list of rules associated with the Load Balancer""" + self.loadbalancerrule = [] + """the list of resource tags associated with the Load Balancer""" + self.tags = [] + +class loadbalancerinstance: + def __init__(self): + """"the instance ID""" + self.id = None + """"the ip address of the instance""" + self.ipaddress = None + """"the name of the instance""" + self.name = None + """"the state of the instance""" + self.state = None + +class loadbalancerrule: + def __init__(self): + """"instance port of the load balancer rule""" + self.instanceport = None + """"source port of the load balancer rule""" + self.sourceport = None + """"the state of the load balancer rule""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLLists.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLLists.py new file mode 100644 index 00000000000..a7bc92bf0d1 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLLists.py @@ -0,0 +1,51 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all network ACLs""" +from baseCmd import * +from baseResponse import * +class listNetworkACLListsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Lists network ACL with the specified ID.""" + self.id = None + """List by keyword""" + self.keyword = None + """list network ACLs by specified name""" + self.name = None + """list network ACLs by network Id""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """list network ACLs by Vpc Id""" + self.vpcid = None + self.required = [] + +class listNetworkACLListsResponse (baseResponse): + def __init__(self): + """the ID of the ACL""" + self.id = None + """Description of the ACL""" + self.description = None + """the Name of the ACL""" + self.name = None + """Id of the VPC this ACL is associated with""" + self.vpcid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLs.py new file mode 100644 index 00000000000..10dd3163772 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLs.py @@ -0,0 +1,108 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all network ACL items""" +from baseCmd import * +from baseResponse import * +class listNetworkACLsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list network ACL Items by ACL Id""" + self.aclid = None + """list network ACL Items by Action""" + self.action = None + """list only resources belonging to the domain specified""" + self.domainid = None + """Lists network ACL Item with the specified ID""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """list network ACL Items by network Id""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """list network ACL Items by Protocol""" + self.protocol = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """list network ACL Items by traffic type - Ingress or Egress""" + self.traffictype = None + self.required = [] + +class listNetworkACLsResponse (baseResponse): + def __init__(self): + """the ID of the ACL Item""" + self.id = None + """the ID of the ACL this item belongs to""" + self.aclid = None + """Action of ACL Item. Allow/Deny""" + self.action = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the ending port of ACL's port range""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """Number of the ACL Item""" + self.number = None + """the protocol of the ACL""" + self.protocol = None + """the starting port of ACL's port range""" + self.startport = None + """the state of the rule""" + self.state = None + """the traffic type for the ACL""" + self.traffictype = None + """the list of resource tags associated with the network ACLs""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkDevice.py new file mode 100644 index 00000000000..a1199c6c42e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkDevice.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List network devices""" +from baseCmd import * +from baseResponse import * +class listNetworkDeviceCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """parameters for network device""" + self.networkdeviceparameterlist = [] + """Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall""" + self.networkdevicetype = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listNetworkDeviceResponse (baseResponse): + def __init__(self): + """the ID of the network device""" + self.id = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkIsolationMethods.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkIsolationMethods.py new file mode 100644 index 00000000000..67ed7fdd4ce --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkIsolationMethods.py @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists supported methods of network isolation""" +from baseCmd import * +from baseResponse import * +class listNetworkIsolationMethodsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listNetworkIsolationMethodsResponse (baseResponse): + def __init__(self): + """Network isolation method name""" + self.name = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkOfferings.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkOfferings.py new file mode 100644 index 00000000000..a36f46dd825 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkOfferings.py @@ -0,0 +1,166 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all available network offerings.""" +from baseCmd import * +from baseResponse import * +class listNetworkOfferingsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the availability of network offering. Default value is Required""" + self.availability = None + """list network offerings by display text""" + self.displaytext = None + """the network offering can be used only for network creation inside the VPC""" + self.forvpc = None + """list network offerings by guest type: Shared or Isolated""" + self.guestiptype = None + """list network offerings by id""" + self.id = None + """true if need to list only default network offerings. Default value is false""" + self.isdefault = None + """true if offering has tags specified""" + self.istagged = None + """List by keyword""" + self.keyword = None + """list network offerings by name""" + self.name = None + """the ID of the network. Pass this in if you want to see the available network offering that a network can be changed to.""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """true if need to list only netwok offerings where source nat is supported, false otherwise""" + self.sourcenatsupported = None + """true if need to list only network offerings which support specifying ip ranges""" + self.specifyipranges = None + """the tags for the network offering.""" + self.specifyvlan = None + """list network offerings by state""" + self.state = None + """list network offerings supporting certain services""" + self.supportedservices = [] + """list network offerings by tags""" + self.tags = None + """list by traffic type""" + self.traffictype = None + """list netowrk offerings available for network creation in specific zone""" + self.zoneid = None + self.required = [] + +class listNetworkOfferingsResponse (baseResponse): + def __init__(self): + """the id of the network offering""" + self.id = None + """availability of the network offering""" + self.availability = None + """true if network offering is ip conserve mode enabled""" + self.conservemode = None + """the date this network offering was created""" + self.created = None + """additional key/value details tied with network offering""" + self.details = None + """an alternate display text of the network offering.""" + self.displaytext = None + """true if network offering supports persistent networks, false otherwise""" + self.egressdefaultpolicy = None + """true if network offering can be used by VPC networks only""" + self.forvpc = None + """guest type of the network offering, can be Shared or Isolated""" + self.guestiptype = None + """true if network offering is default, false otherwise""" + self.isdefault = None + """true if network offering supports persistent networks, false otherwise""" + self.ispersistent = None + """maximum number of concurrents connections to be handled by lb""" + self.maxconnections = None + """the name of the network offering""" + self.name = None + """data transfer rate in megabits per second allowed.""" + self.networkrate = None + """the ID of the service offering used by virtual router provider""" + self.serviceofferingid = None + """true if network offering supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """true if network offering supports vlans, false otherwise""" + self.specifyvlan = None + """state of the network offering. Can be Disabled/Enabled/Inactive""" + self.state = None + """the tags for the network offering""" + self.tags = None + """the traffic type for the network offering, supported types are Public, Management, Control, Guest, Vlan or Storage.""" + self.traffictype = None + """the list of supported services""" + self.service = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkServiceProviders.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkServiceProviders.py new file mode 100644 index 00000000000..287401e689a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkServiceProviders.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists network serviceproviders for a given physical network.""" +from baseCmd import * +from baseResponse import * +class listNetworkServiceProvidersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """list providers by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the Physical Network ID""" + self.physicalnetworkid = None + """list providers by state""" + self.state = None + self.required = [] + +class listNetworkServiceProvidersResponse (baseResponse): + def __init__(self): + """uuid of the network provider""" + self.id = None + """true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """the destination physical network""" + self.destinationphysicalnetworkid = None + """the provider name""" + self.name = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """services for this provider""" + self.servicelist = None + """state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworks.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworks.py new file mode 100644 index 00000000000..60e451699b4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworks.py @@ -0,0 +1,243 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all available networks.""" +from baseCmd import * +from baseResponse import * +class listNetworksCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list networks by ACL (access control list) type. Supported values are Account and Domain""" + self.acltype = None + """list networks available for vm deployment""" + self.canusefordeploy = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the network belongs to vpc""" + self.forvpc = None + """list networks by id""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """true if network is system, false otherwise""" + self.issystem = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list networks by physical network id""" + self.physicalnetworkid = None + """list objects by project""" + self.projectid = None + """list networks by restartRequired""" + self.restartrequired = None + """true if need to list only networks which support specifying ip ranges""" + self.specifyipranges = None + """list networks supporting certain services""" + self.supportedservices = [] + """List resources by tags (key/value pairs)""" + self.tags = [] + """type of the traffic""" + self.traffictype = None + """the type of the network. Supported values are: Isolated and Shared""" + self.type = None + """List networks by VPC""" + self.vpcid = None + """the Zone ID of the network""" + self.zoneid = None + self.required = [] + +class listNetworksResponse (baseResponse): + def __init__(self): + """the id of the network""" + self.id = None + """the owner of the network""" + self.account = None + """ACL Id associated with the VPC network""" + self.aclid = None + """acl type - access type to the network""" + self.acltype = None + """Broadcast domain type of the network""" + self.broadcastdomaintype = None + """broadcast uri of the network. This parameter is visible to ROOT admins only""" + self.broadcasturi = None + """list networks available for vm deployment""" + self.canusefordeploy = None + """Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" + self.cidr = None + """an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """the displaytext of the network""" + self.displaytext = None + """the first DNS for the network""" + self.dns1 = None + """the second DNS for the network""" + self.dns2 = None + """the domain name of the network owner""" + self.domain = None + """the domain id of the network owner""" + self.domainid = None + """the network's gateway""" + self.gateway = None + """the cidr of IPv6 network""" + self.ip6cidr = None + """the gateway of IPv6 network""" + self.ip6gateway = None + """true if network is default, false otherwise""" + self.isdefault = None + """list networks that are persistent""" + self.ispersistent = None + """true if network is system, false otherwise""" + self.issystem = None + """the name of the network""" + self.name = None + """the network's netmask""" + self.netmask = None + """the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" + self.networkcidr = None + """the network domain""" + self.networkdomain = None + """availability of the network offering the network is created from""" + self.networkofferingavailability = None + """true if network offering is ip conserve mode enabled""" + self.networkofferingconservemode = None + """display text of the network offering the network is created from""" + self.networkofferingdisplaytext = None + """network offering id the network is created from""" + self.networkofferingid = None + """name of the network offering the network is created from""" + self.networkofferingname = None + """the physical network id""" + self.physicalnetworkid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """related to what other network configuration""" + self.related = None + """the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" + self.reservediprange = None + """true network requires restart""" + self.restartrequired = None + """true if network supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """state of the network""" + self.state = None + """true if users from subdomains can access the domain level network""" + self.subdomainaccess = None + """the traffic type of the network""" + self.traffictype = None + """the type of the network""" + self.type = None + """The vlan of the network. This parameter is visible to ROOT admins only""" + self.vlan = None + """VPC the network belongs to""" + self.vpcid = None + """zone id of the network""" + self.zoneid = None + """the name of the zone the network belongs to""" + self.zonename = None + """the list of services""" + self.service = [] + """the list of resource tags associated with network""" + self.tags = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDeviceNetworks.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDeviceNetworks.py new file mode 100644 index 00000000000..d19ba547469 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDeviceNetworks.py @@ -0,0 +1,208 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""lists network that are using a nicira nvp device""" +from baseCmd import * +from baseResponse import * +class listNiciraNvpDeviceNetworksCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """nicira nvp device ID""" + """Required""" + self.nvpdeviceid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["nvpdeviceid",] + +class listNiciraNvpDeviceNetworksResponse (baseResponse): + def __init__(self): + """the id of the network""" + self.id = None + """the owner of the network""" + self.account = None + """ACL Id associated with the VPC network""" + self.aclid = None + """acl type - access type to the network""" + self.acltype = None + """Broadcast domain type of the network""" + self.broadcastdomaintype = None + """broadcast uri of the network. This parameter is visible to ROOT admins only""" + self.broadcasturi = None + """list networks available for vm deployment""" + self.canusefordeploy = None + """Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" + self.cidr = None + """an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """the displaytext of the network""" + self.displaytext = None + """the first DNS for the network""" + self.dns1 = None + """the second DNS for the network""" + self.dns2 = None + """the domain name of the network owner""" + self.domain = None + """the domain id of the network owner""" + self.domainid = None + """the network's gateway""" + self.gateway = None + """the cidr of IPv6 network""" + self.ip6cidr = None + """the gateway of IPv6 network""" + self.ip6gateway = None + """true if network is default, false otherwise""" + self.isdefault = None + """list networks that are persistent""" + self.ispersistent = None + """true if network is system, false otherwise""" + self.issystem = None + """the name of the network""" + self.name = None + """the network's netmask""" + self.netmask = None + """the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" + self.networkcidr = None + """the network domain""" + self.networkdomain = None + """availability of the network offering the network is created from""" + self.networkofferingavailability = None + """true if network offering is ip conserve mode enabled""" + self.networkofferingconservemode = None + """display text of the network offering the network is created from""" + self.networkofferingdisplaytext = None + """network offering id the network is created from""" + self.networkofferingid = None + """name of the network offering the network is created from""" + self.networkofferingname = None + """the physical network id""" + self.physicalnetworkid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """related to what other network configuration""" + self.related = None + """the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" + self.reservediprange = None + """true network requires restart""" + self.restartrequired = None + """true if network supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """state of the network""" + self.state = None + """true if users from subdomains can access the domain level network""" + self.subdomainaccess = None + """the traffic type of the network""" + self.traffictype = None + """the type of the network""" + self.type = None + """The vlan of the network. This parameter is visible to ROOT admins only""" + self.vlan = None + """VPC the network belongs to""" + self.vpcid = None + """zone id of the network""" + self.zoneid = None + """the name of the zone the network belongs to""" + self.zonename = None + """the list of services""" + self.service = [] + """the list of resource tags associated with network""" + self.tags = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDevices.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDevices.py new file mode 100644 index 00000000000..fde71953f4f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDevices.py @@ -0,0 +1,53 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists Nicira NVP devices""" +from baseCmd import * +from baseResponse import * +class listNiciraNvpDevicesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """nicira nvp device ID""" + self.nvpdeviceid = None + """""" + self.page = None + """""" + self.pagesize = None + """the Physical Network ID""" + self.physicalnetworkid = None + self.required = [] + +class listNiciraNvpDevicesResponse (baseResponse): + def __init__(self): + """the controller Ip address""" + self.hostname = None + """this L3 gateway service Uuid""" + self.l3gatewayserviceuuid = None + """device name""" + self.niciradevicename = None + """device id of the Nicire Nvp""" + self.nvpdeviceid = None + """the physical network to which this Nirica Nvp belongs to""" + self.physicalnetworkid = None + """name of the provider""" + self.provider = None + """the transport zone Uuid""" + self.transportzoneuuid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNics.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNics.py new file mode 100644 index 00000000000..d2a663a612e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listNics.py @@ -0,0 +1,72 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""list the vm nics IP to NIC""" +from baseCmd import * +from baseResponse import * +class listNicsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the vm""" + """Required""" + self.virtualmachineid = None + """List by keyword""" + self.keyword = None + """the ID of the nic to to list IPs""" + self.nicid = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["virtualmachineid",] + +class listNicsResponse (baseResponse): + def __init__(self): + """the ID of the nic""" + self.id = None + """the broadcast uri of the nic""" + self.broadcasturi = None + """the gateway of the nic""" + self.gateway = None + """the IPv6 address of network""" + self.ip6address = None + """the cidr of IPv6 network""" + self.ip6cidr = None + """the gateway of IPv6 network""" + self.ip6gateway = None + """the ip address of the nic""" + self.ipaddress = None + """true if nic is default, false otherwise""" + self.isdefault = None + """the isolation uri of the nic""" + self.isolationuri = None + """true if nic is default, false otherwise""" + self.macaddress = None + """the netmask of the nic""" + self.netmask = None + """the ID of the corresponding network""" + self.networkid = None + """the name of the corresponding network""" + self.networkname = None + """the Secondary ipv4 addr of nic""" + self.secondaryip = None + """the traffic type of the nic""" + self.traffictype = None + """the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listOsCategories.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listOsCategories.py new file mode 100644 index 00000000000..6289315c19e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listOsCategories.py @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all supported OS categories for this cloud.""" +from baseCmd import * +from baseResponse import * +class listOsCategoriesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list Os category by id""" + self.id = None + """List by keyword""" + self.keyword = None + """list os category by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listOsCategoriesResponse (baseResponse): + def __init__(self): + """the ID of the OS category""" + self.id = None + """the name of the OS category""" + self.name = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listOsTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listOsTypes.py new file mode 100644 index 00000000000..426a32d1fae --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listOsTypes.py @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all supported OS types for this cloud.""" +from baseCmd import * +from baseResponse import * +class listOsTypesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list os by description""" + self.description = None + """list by Os type Id""" + self.id = None + """List by keyword""" + self.keyword = None + """list by Os Category id""" + self.oscategoryid = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listOsTypesResponse (baseResponse): + def __init__(self): + """the ID of the OS type""" + self.id = None + """the name/description of the OS type""" + self.description = None + """the ID of the OS category""" + self.oscategoryid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPhysicalNetworks.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPhysicalNetworks.py new file mode 100644 index 00000000000..4cc716471ac --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listPhysicalNetworks.py @@ -0,0 +1,61 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists physical networks""" +from baseCmd import * +from baseResponse import * +class listPhysicalNetworksCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list physical network by id""" + self.id = None + """List by keyword""" + self.keyword = None + """search by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the Zone ID for the physical network""" + self.zoneid = None + self.required = [] + +class listPhysicalNetworksResponse (baseResponse): + def __init__(self): + """the uuid of the physical network""" + self.id = None + """Broadcast domain range of the physical network""" + self.broadcastdomainrange = None + """the domain id of the physical network owner""" + self.domainid = None + """isolation methods""" + self.isolationmethods = None + """name of the physical network""" + self.name = None + """the speed of the physical network""" + self.networkspeed = None + """state of the physical network""" + self.state = None + """comma separated tag""" + self.tags = None + """the vlan of the physical network""" + self.vlan = None + """zone id of the physical network""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPods.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPods.py new file mode 100644 index 00000000000..64868d9b501 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listPods.py @@ -0,0 +1,88 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all Pods.""" +from baseCmd import * +from baseResponse import * +class listPodsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list pods by allocation state""" + self.allocationstate = None + """list Pods by ID""" + self.id = None + """List by keyword""" + self.keyword = None + """list Pods by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """flag to display the capacity of the pods""" + self.showcapacities = None + """list Pods by Zone ID""" + self.zoneid = None + self.required = [] + +class listPodsResponse (baseResponse): + def __init__(self): + """the ID of the Pod""" + self.id = None + """the allocation state of the Pod""" + self.allocationstate = None + """the ending IP for the Pod""" + self.endip = None + """the gateway of the Pod""" + self.gateway = None + """the name of the Pod""" + self.name = None + """the netmask of the Pod""" + self.netmask = None + """the starting IP for the Pod""" + self.startip = None + """the Zone ID of the Pod""" + self.zoneid = None + """the Zone name of the Pod""" + self.zonename = None + """the capacity of the Pod""" + self.capacity = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPortForwardingRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPortForwardingRules.py new file mode 100644 index 00000000000..02e9666b32e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listPortForwardingRules.py @@ -0,0 +1,104 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all port forwarding rules for an IP address.""" +from baseCmd import * +from baseResponse import * +class listPortForwardingRulesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """Lists rule with the specified ID.""" + self.id = None + """the id of IP address of the port forwarding services""" + self.ipaddressid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + self.required = [] + +class listPortForwardingRulesResponse (baseResponse): + def __init__(self): + """the ID of the port forwarding rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the public ip address for the port forwarding rule""" + self.ipaddress = None + """the public ip address id for the port forwarding rule""" + self.ipaddressid = None + """the ending port of port forwarding rule's private port range""" + self.privateendport = None + """the starting port of port forwarding rule's private port range""" + self.privateport = None + """the protocol of the port forwarding rule""" + self.protocol = None + """the ending port of port forwarding rule's private port range""" + self.publicendport = None + """the starting port of port forwarding rule's public port range""" + self.publicport = None + """the state of the rule""" + self.state = None + """the VM display name for the port forwarding rule""" + self.virtualmachinedisplayname = None + """the VM ID for the port forwarding rule""" + self.virtualmachineid = None + """the VM name for the port forwarding rule""" + self.virtualmachinename = None + """the vm ip address for the port forwarding rule""" + self.vmguestip = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPortableIpRanges.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPortableIpRanges.py new file mode 100644 index 00000000000..8f1c4d95298 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listPortableIpRanges.py @@ -0,0 +1,78 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""list portable IP ranges""" +from baseCmd import * +from baseResponse import * +class listPortableIpRangesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Id of the portable ip range""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """Id of a Region""" + self.regionid = None + self.required = [] + +class listPortableIpRangesResponse (baseResponse): + def __init__(self): + """portable IP range ID""" + self.id = None + """the end ip of the portable IP range""" + self.endip = None + """the gateway of the VLAN IP range""" + self.gateway = None + """the netmask of the VLAN IP range""" + self.netmask = None + """Region Id in which portable ip range is provisioned""" + self.regionid = None + """the start ip of the portable IP range""" + self.startip = None + """the ID or VID of the VLAN.""" + self.vlan = None + """List of portable IP and association with zone/network/vpc details that are part of GSLB rule""" + self.portableipaddress = [] + +class portableipaddress: + def __init__(self): + """"the account ID the portable IP address is associated with""" + self.accountid = None + """"date the portal IP address was acquired""" + self.allocated = None + """"the domain ID the portable IP address is associated with""" + self.domainid = None + """"public IP address""" + self.ipaddress = None + """"the ID of the Network where ip belongs to""" + self.networkid = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"Region Id in which global load balancer is created""" + self.regionid = None + """"State of the ip address. Can be: Allocatin, Allocated and Releasing""" + self.state = None + """"VPC the ip belongs to""" + self.vpcid = None + """"the ID of the zone the public IP address belongs to""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPrivateGateways.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPrivateGateways.py new file mode 100644 index 00000000000..86695f2ab76 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listPrivateGateways.py @@ -0,0 +1,89 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List private gateways""" +from baseCmd import * +from baseResponse import * +class listPrivateGatewaysCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list private gateway by id""" + self.id = None + """list gateways by ip address""" + self.ipaddress = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """list gateways by state""" + self.state = None + """list gateways by vlan""" + self.vlan = None + """list gateways by vpc""" + self.vpcid = None + self.required = [] + +class listPrivateGatewaysResponse (baseResponse): + def __init__(self): + """the id of the private gateway""" + self.id = None + """the account associated with the private gateway""" + self.account = None + """ACL Id set for private gateway""" + self.aclid = None + """the domain associated with the private gateway""" + self.domain = None + """the ID of the domain associated with the private gateway""" + self.domainid = None + """the gateway""" + self.gateway = None + """the private gateway's ip address""" + self.ipaddress = None + """the private gateway's netmask""" + self.netmask = None + """the physical network id""" + self.physicalnetworkid = None + """the project name of the private gateway""" + self.project = None + """the project id of the private gateway""" + self.projectid = None + """Souce Nat enable status""" + self.sourcenatsupported = None + """State of the gateway, can be Creating, Ready, Deleting""" + self.state = None + """the network implementation uri for the private gateway""" + self.vlan = None + """VPC the private gateaway belongs to""" + self.vpcid = None + """zone id of the private gateway""" + self.zoneid = None + """the name of the zone the private gateway belongs to""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectAccounts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectAccounts.py new file mode 100644 index 00000000000..2b085c3bbed --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectAccounts.py @@ -0,0 +1,151 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists project's accounts""" +from baseCmd import * +from baseResponse import * +class listProjectAccountsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """id of the project""" + """Required""" + self.projectid = None + """list accounts of the project by account name""" + self.account = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """list accounts of the project by role""" + self.role = None + self.required = ["projectid",] + +class listProjectAccountsResponse (baseResponse): + def __init__(self): + """the id of the project""" + self.id = None + """the account name of the project's owner""" + self.account = None + """the total number of cpu cores available to be created for this project""" + self.cpuavailable = None + """the total number of cpu cores the project can own""" + self.cpulimit = None + """the total number of cpu cores owned by project""" + self.cputotal = None + """the displaytext of the project""" + self.displaytext = None + """the domain name where the project belongs to""" + self.domain = None + """the domain id the project belongs to""" + self.domainid = None + """the total number of public ip addresses available for this project to acquire""" + self.ipavailable = None + """the total number of public ip addresses this project can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this project""" + self.iptotal = None + """the total memory (in MB) available to be created for this project""" + self.memoryavailable = None + """the total memory (in MB) the project can own""" + self.memorylimit = None + """the total memory (in MB) owned by project""" + self.memorytotal = None + """the name of the project""" + self.name = None + """the total number of networks available to be created for this project""" + self.networkavailable = None + """the total number of networks the project can own""" + self.networklimit = None + """the total number of networks owned by project""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this project""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the project can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by project""" + self.primarystoragetotal = None + """the total secondary storage space (in GiB) available to be used for this project""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the project can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by project""" + self.secondarystoragetotal = None + """the total number of snapshots available for this project""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this project""" + self.snapshotlimit = None + """the total number of snapshots stored by this project""" + self.snapshottotal = None + """the state of the project""" + self.state = None + """the total number of templates available to be created by this project""" + self.templateavailable = None + """the total number of templates which can be created by this project""" + self.templatelimit = None + """the total number of templates which have been created by this project""" + self.templatetotal = None + """the total number of virtual machines available for this project to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this project""" + self.vmlimit = None + """the total number of virtual machines running for this project""" + self.vmrunning = None + """the total number of virtual machines stopped for this project""" + self.vmstopped = None + """the total number of virtual machines deployed by this project""" + self.vmtotal = None + """the total volume available for this project""" + self.volumeavailable = None + """the total volume which can be used by this project""" + self.volumelimit = None + """the total volume being used by this project""" + self.volumetotal = None + """the total number of vpcs available to be created for this project""" + self.vpcavailable = None + """the total number of vpcs the project can own""" + self.vpclimit = None + """the total number of vpcs owned by project""" + self.vpctotal = None + """the list of resource tags associated with vm""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectInvitations.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectInvitations.py new file mode 100644 index 00000000000..a5ef32b0d35 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectInvitations.py @@ -0,0 +1,67 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists projects and provides detailed information for listed projects""" +from baseCmd import * +from baseResponse import * +class listProjectInvitationsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """if true, list only active invitations - having Pending state and ones that are not timed out yet""" + self.activeonly = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list invitations by id""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list by project id""" + self.projectid = None + """list invitations by state""" + self.state = None + self.required = [] + +class listProjectInvitationsResponse (baseResponse): + def __init__(self): + """the id of the invitation""" + self.id = None + """the account name of the project's owner""" + self.account = None + """the domain name where the project belongs to""" + self.domain = None + """the domain id the project belongs to""" + self.domainid = None + """the email the invitation was sent to""" + self.email = None + """the name of the project""" + self.project = None + """the id of the project""" + self.projectid = None + """the invitation state""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjects.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjects.py new file mode 100644 index 00000000000..a60d3553abe --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjects.py @@ -0,0 +1,162 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists projects and provides detailed information for listed projects""" +from baseCmd import * +from baseResponse import * +class listProjectsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list projects by display text""" + self.displaytext = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list projects by project ID""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """list projects by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list projects by state""" + self.state = None + """List projects by tags (key/value pairs)""" + self.tags = [] + self.required = [] + +class listProjectsResponse (baseResponse): + def __init__(self): + """the id of the project""" + self.id = None + """the account name of the project's owner""" + self.account = None + """the total number of cpu cores available to be created for this project""" + self.cpuavailable = None + """the total number of cpu cores the project can own""" + self.cpulimit = None + """the total number of cpu cores owned by project""" + self.cputotal = None + """the displaytext of the project""" + self.displaytext = None + """the domain name where the project belongs to""" + self.domain = None + """the domain id the project belongs to""" + self.domainid = None + """the total number of public ip addresses available for this project to acquire""" + self.ipavailable = None + """the total number of public ip addresses this project can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this project""" + self.iptotal = None + """the total memory (in MB) available to be created for this project""" + self.memoryavailable = None + """the total memory (in MB) the project can own""" + self.memorylimit = None + """the total memory (in MB) owned by project""" + self.memorytotal = None + """the name of the project""" + self.name = None + """the total number of networks available to be created for this project""" + self.networkavailable = None + """the total number of networks the project can own""" + self.networklimit = None + """the total number of networks owned by project""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this project""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the project can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by project""" + self.primarystoragetotal = None + """the total secondary storage space (in GiB) available to be used for this project""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the project can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by project""" + self.secondarystoragetotal = None + """the total number of snapshots available for this project""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this project""" + self.snapshotlimit = None + """the total number of snapshots stored by this project""" + self.snapshottotal = None + """the state of the project""" + self.state = None + """the total number of templates available to be created by this project""" + self.templateavailable = None + """the total number of templates which can be created by this project""" + self.templatelimit = None + """the total number of templates which have been created by this project""" + self.templatetotal = None + """the total number of virtual machines available for this project to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this project""" + self.vmlimit = None + """the total number of virtual machines running for this project""" + self.vmrunning = None + """the total number of virtual machines stopped for this project""" + self.vmstopped = None + """the total number of virtual machines deployed by this project""" + self.vmtotal = None + """the total volume available for this project""" + self.volumeavailable = None + """the total volume which can be used by this project""" + self.volumelimit = None + """the total volume being used by this project""" + self.volumetotal = None + """the total number of vpcs available to be created for this project""" + self.vpcavailable = None + """the total number of vpcs the project can own""" + self.vpclimit = None + """the total number of vpcs owned by project""" + self.vpctotal = None + """the list of resource tags associated with vm""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPublicIpAddresses.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPublicIpAddresses.py new file mode 100644 index 00000000000..79913f82963 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listPublicIpAddresses.py @@ -0,0 +1,156 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all public ip addresses""" +from baseCmd import * +from baseResponse import * +class listPublicIpAddressesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """limits search results to allocated public IP addresses""" + self.allocatedonly = None + """lists all public IP addresses associated to the network specified""" + self.associatednetworkid = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list only ips used for load balancing""" + self.forloadbalancing = None + """the virtual network for the IP address""" + self.forvirtualnetwork = None + """lists ip address by id""" + self.id = None + """lists the specified IP address""" + self.ipaddress = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """list only source nat ip addresses""" + self.issourcenat = None + """list only static nat ip addresses""" + self.isstaticnat = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """lists all public IP addresses by physical network id""" + self.physicalnetworkid = None + """list objects by project""" + self.projectid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """lists all public IP addresses by VLAN ID""" + self.vlanid = None + """List ips belonging to the VPC""" + self.vpcid = None + """lists all public IP addresses by Zone ID""" + self.zoneid = None + self.required = [] + +class listPublicIpAddressesResponse (baseResponse): + def __init__(self): + """public IP address id""" + self.id = None + """the account the public IP address is associated with""" + self.account = None + """date the public IP address was acquired""" + self.allocated = None + """the ID of the Network associated with the IP address""" + self.associatednetworkid = None + """the name of the Network associated with the IP address""" + self.associatednetworkname = None + """the domain the public IP address is associated with""" + self.domain = None + """the domain ID the public IP address is associated with""" + self.domainid = None + """the virtual network for the IP address""" + self.forvirtualnetwork = None + """public IP address""" + self.ipaddress = None + """is public IP portable across the zones""" + self.isportable = None + """true if the IP address is a source nat address, false otherwise""" + self.issourcenat = None + """true if this ip is for static nat, false otherwise""" + self.isstaticnat = None + """true if this ip is system ip (was allocated as a part of deployVm or createLbRule)""" + self.issystem = None + """the ID of the Network where ip belongs to""" + self.networkid = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value""" + self.purpose = None + """State of the ip address. Can be: Allocatin, Allocated and Releasing""" + self.state = None + """virutal machine display name the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachinedisplayname = None + """virutal machine id the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachineid = None + """virutal machine name the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachinename = None + """the ID of the VLAN associated with the IP address. This parameter is visible to ROOT admins only""" + self.vlanid = None + """the VLAN associated with the IP address""" + self.vlanname = None + """virutal machine (dnat) ip address (not null only for static nat Ip)""" + self.vmipaddress = None + """VPC the ip belongs to""" + self.vpcid = None + """the ID of the zone the public IP address belongs to""" + self.zoneid = None + """the name of the zone the public IP address belongs to""" + self.zonename = None + """the list of resource tags associated with ip address""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listRegions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listRegions.py new file mode 100644 index 00000000000..85499456154 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listRegions.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists Regions""" +from baseCmd import * +from baseResponse import * +class listRegionsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List Region by region ID.""" + self.id = None + """List by keyword""" + self.keyword = None + """List Region by region name.""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listRegionsResponse (baseResponse): + def __init__(self): + """the ID of the region""" + self.id = None + """the end point of the region""" + self.endpoint = None + """true if GSLB service is enabled in the region, false otherwise""" + self.gslbserviceenabled = None + """the name of the region""" + self.name = None + """true if security groups support is enabled, false otherwise""" + self.portableipserviceenabled = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listRemoteAccessVpns.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listRemoteAccessVpns.py new file mode 100644 index 00000000000..dfedf4add18 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listRemoteAccessVpns.py @@ -0,0 +1,70 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists remote access vpns""" +from baseCmd import * +from baseResponse import * +class listRemoteAccessVpnsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """public ip address id of the vpn server""" + """Required""" + self.publicipid = None + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + self.required = ["publicipid",] + +class listRemoteAccessVpnsResponse (baseResponse): + def __init__(self): + """the id of the remote access vpn""" + self.id = None + """the account of the remote access vpn""" + self.account = None + """the domain name of the account of the remote access vpn""" + self.domain = None + """the domain id of the account of the remote access vpn""" + self.domainid = None + """the range of ips to allocate to the clients""" + self.iprange = None + """the ipsec preshared key""" + self.presharedkey = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the public ip address of the vpn server""" + self.publicip = None + """the public ip address of the vpn server""" + self.publicipid = None + """the state of the rule""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceDetails.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceDetails.py new file mode 100644 index 00000000000..133e4897650 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceDetails.py @@ -0,0 +1,71 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List resource detail(s)""" +from baseCmd import * +from baseResponse import * +class listResourceDetailsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """list by key""" + self.key = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """list by resource id""" + self.resourceid = None + """list by resource type""" + self.resourcetype = None + self.required = [] + +class listResourceDetailsResponse (baseResponse): + def __init__(self): + """the account associated with the tag""" + self.account = None + """customer associated with the tag""" + self.customer = None + """the domain associated with the tag""" + self.domain = None + """the ID of the domain associated with the tag""" + self.domainid = None + """tag key name""" + self.key = None + """the project name where tag belongs to""" + self.project = None + """the project id the tag belongs to""" + self.projectid = None + """id of the resource""" + self.resourceid = None + """resource type""" + self.resourcetype = None + """tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceLimits.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceLimits.py new file mode 100644 index 00000000000..d608f3448d5 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceLimits.py @@ -0,0 +1,63 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists resource limits.""" +from baseCmd import * +from baseResponse import * +class listResourceLimitsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """Lists resource limits by ID.""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """Type of resource to update. Values are 0, 1, 2, 3, and 4.0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses an account can own. 2 - Volume. Number of disk volumes an account can own.3 - Snapshot. Number of snapshots an account can own.4 - Template. Number of templates an account can register/create.5 - Project. Number of projects an account can own.6 - Network. Number of networks an account can own.7 - VPC. Number of VPC an account can own.8 - CPU. Number of CPU an account can allocate for his resources.9 - Memory. Amount of RAM an account can allocate for his resources.10 - Primary Storage. Amount of Primary storage an account can allocate for his resoruces.11 - Secondary Storage. Amount of Secondary storage an account can allocate for his resources.""" + self.resourcetype = None + self.required = [] + +class listResourceLimitsResponse (baseResponse): + def __init__(self): + """the account of the resource limit""" + self.account = None + """the domain name of the resource limit""" + self.domain = None + """the domain ID of the resource limit""" + self.domainid = None + """the maximum number of the resource. A -1 means the resource currently has no limit.""" + self.max = None + """the project name of the resource limit""" + self.project = None + """the project id of the resource limit""" + self.projectid = None + """resource type. Values include 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11. See the resourceType parameter for more information on these values.""" + self.resourcetype = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listRouters.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listRouters.py new file mode 100644 index 00000000000..a640aaef458 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listRouters.py @@ -0,0 +1,182 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List routers.""" +from baseCmd import * +from baseResponse import * +class listRoutersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """if true is passed for this parameter, list only VPC routers""" + self.forvpc = None + """the host ID of the router""" + self.hostid = None + """the ID of the disk router""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """the name of the router""" + self.name = None + """list by network id""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """the Pod ID of the router""" + self.podid = None + """list objects by project""" + self.projectid = None + """the state of the router""" + self.state = None + """List networks by VPC""" + self.vpcid = None + """the Zone ID of the router""" + self.zoneid = None + self.required = [] + +class listRoutersResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listS3s.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listS3s.py new file mode 100644 index 00000000000..602411e431c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listS3s.py @@ -0,0 +1,53 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists S3s""" +from baseCmd import * +from baseResponse import * +class listS3sCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listS3sResponse (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSSHKeyPairs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSSHKeyPairs.py new file mode 100644 index 00000000000..8f38bec00a8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listSSHKeyPairs.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List registered keypairs""" +from baseCmd import * +from baseResponse import * +class listSSHKeyPairsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """A public key fingerprint to look for""" + self.fingerprint = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """A key pair name to look for""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + self.required = [] + +class listSSHKeyPairsResponse (baseResponse): + def __init__(self): + """Fingerprint of the public key""" + self.fingerprint = None + """Name of the keypair""" + self.name = None + """Private key""" + self.privatekey = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSecondaryStagingStores.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSecondaryStagingStores.py new file mode 100644 index 00000000000..0fa06962f27 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listSecondaryStagingStores.py @@ -0,0 +1,63 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists secondary staging stores.""" +from baseCmd import * +from baseResponse import * +class listSecondaryStagingStoresCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the staging store""" + self.id = None + """List by keyword""" + self.keyword = None + """the name of the staging store""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the staging store protocol""" + self.protocol = None + """the staging store provider""" + self.provider = None + """the Zone ID for the staging store""" + self.zoneid = None + self.required = [] + +class listSecondaryStagingStoresResponse (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSecurityGroups.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSecurityGroups.py new file mode 100644 index 00000000000..d3cf2cd4845 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listSecurityGroups.py @@ -0,0 +1,144 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists security groups""" +from baseCmd import * +from baseResponse import * +class listSecurityGroupsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list the security group by the id provided""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """lists security groups by name""" + self.securitygroupname = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """lists security groups by virtual machine id""" + self.virtualmachineid = None + self.required = [] + +class listSecurityGroupsResponse (baseResponse): + def __init__(self): + """the ID of the security group""" + self.id = None + """the account owning the security group""" + self.account = None + """the description of the security group""" + self.description = None + """the domain name of the security group""" + self.domain = None + """the domain ID of the security group""" + self.domainid = None + """the name of the security group""" + self.name = None + """the project name of the group""" + self.project = None + """the project id of the group""" + self.projectid = None + """the list of egress rules associated with the security group""" + self.egressrule = [] + """the list of ingress rules associated with the security group""" + self.ingressrule = [] + """the list of resource tags associated with the rule""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listServiceOfferings.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listServiceOfferings.py new file mode 100644 index 00000000000..17580c028aa --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listServiceOfferings.py @@ -0,0 +1,124 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all available service offerings.""" +from baseCmd import * +from baseResponse import * +class listServiceOfferingsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the domain associated with the service offering""" + self.domainid = None + """ID of the service offering""" + self.id = None + """is this a system vm offering""" + self.issystem = None + """List by keyword""" + self.keyword = None + """name of the service offering""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """List service offerings by resource tags (key/value pairs)""" + self.resourcetags = [] + """the system VM type. Possible types are "consoleproxy", "secondarystoragevm" or "domainrouter".""" + self.systemvmtype = None + """the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to.""" + self.virtualmachineid = None + self.required = [] + +class listServiceOfferingsResponse (baseResponse): + def __init__(self): + """the id of the service offering""" + self.id = None + """the number of CPU""" + self.cpunumber = None + """the clock rate CPU speed in Mhz""" + self.cpuspeed = None + """the date this service offering was created""" + self.created = None + """is this a default system vm offering""" + self.defaultuse = None + """deployment strategy used to deploy VM.""" + self.deploymentplanner = None + """bytes read rate of the service offering""" + self.diskBytesReadRate = None + """bytes write rate of the service offering""" + self.diskBytesWriteRate = None + """io requests read rate of the service offering""" + self.diskIopsReadRate = None + """io requests write rate of the service offering""" + self.diskIopsWriteRate = None + """an alternate display text of the service offering.""" + self.displaytext = None + """Domain name for the offering""" + self.domain = None + """the domain id of the service offering""" + self.domainid = None + """the host tag for the service offering""" + self.hosttags = None + """is this a system vm offering""" + self.issystem = None + """true if the vm needs to be volatile, i.e., on every reboot of vm from API root disk is discarded and creates a new root disk""" + self.isvolatile = None + """restrict the CPU usage to committed service offering""" + self.limitcpuuse = None + """the memory in MB""" + self.memory = None + """the name of the service offering""" + self.name = None + """data transfer rate in megabits per second allowed.""" + self.networkrate = None + """the ha support in the service offering""" + self.offerha = None + """additional key/value details tied with this service offering""" + self.serviceofferingdetails = None + """the storage type for this service offering""" + self.storagetype = None + """is this a the systemvm type for system vm offering""" + self.systemvmtype = None + """the tags for the service offering""" + self.tags = None + """the list of resource tags associated with service offering. The resource tags are not used for Volume/VM placement on the specific host.""" + self.resourcetags = [] + +class resourcetags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshotPolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshotPolicies.py new file mode 100644 index 00000000000..7c8ef7941bb --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshotPolicies.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists snapshot policies.""" +from baseCmd import * +from baseResponse import * +class listSnapshotPoliciesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the disk volume""" + """Required""" + self.volumeid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["volumeid",] + +class listSnapshotPoliciesResponse (baseResponse): + def __init__(self): + """the ID of the snapshot policy""" + self.id = None + """the interval type of the snapshot policy""" + self.intervaltype = None + """maximum number of snapshots retained""" + self.maxsnaps = None + """time the snapshot is scheduled to be taken.""" + self.schedule = None + """the time zone of the snapshot policy""" + self.timezone = None + """the ID of the disk volume""" + self.volumeid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshots.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshots.py new file mode 100644 index 00000000000..79213eabd06 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshots.py @@ -0,0 +1,118 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all available snapshots for the account.""" +from baseCmd import * +from baseResponse import * +class listSnapshotsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """lists snapshot by snapshot ID""" + self.id = None + """valid values are HOURLY, DAILY, WEEKLY, and MONTHLY.""" + self.intervaltype = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """lists snapshot by snapshot name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """valid values are MANUAL or RECURRING.""" + self.snapshottype = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """the ID of the disk volume""" + self.volumeid = None + """list snapshots by zone id""" + self.zoneid = None + self.required = [] + +class listSnapshotsResponse (baseResponse): + def __init__(self): + """ID of the snapshot""" + self.id = None + """the account associated with the snapshot""" + self.account = None + """the date the snapshot was created""" + self.created = None + """the domain name of the snapshot's account""" + self.domain = None + """the domain ID of the snapshot's account""" + self.domainid = None + """valid types are hourly, daily, weekly, monthy, template, and none.""" + self.intervaltype = None + """name of the snapshot""" + self.name = None + """the project name of the snapshot""" + self.project = None + """the project id of the snapshot""" + self.projectid = None + """the type of the snapshot""" + self.snapshottype = None + """the state of the snapshot. BackedUp means that snapshot is ready to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp - the snapshot is being backed up on secondary storage""" + self.state = None + """ID of the disk volume""" + self.volumeid = None + """name of the disk volume""" + self.volumename = None + """type of the disk volume""" + self.volumetype = None + """id of the availability zone""" + self.zoneid = None + """the list of resource tags associated with snapshot""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listStaticRoutes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listStaticRoutes.py new file mode 100644 index 00000000000..f965e111575 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listStaticRoutes.py @@ -0,0 +1,98 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all static routes""" +from baseCmd import * +from baseResponse import * +class listStaticRoutesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list static routes by gateway id""" + self.gatewayid = None + """list static route by id""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """list static routes by vpc id""" + self.vpcid = None + self.required = [] + +class listStaticRoutesResponse (baseResponse): + def __init__(self): + """the ID of static route""" + self.id = None + """the account associated with the static route""" + self.account = None + """static route CIDR""" + self.cidr = None + """the domain associated with the static route""" + self.domain = None + """the ID of the domain associated with the static route""" + self.domainid = None + """VPC gateway the route is created for""" + self.gatewayid = None + """the project name of the static route""" + self.project = None + """the project id of the static route""" + self.projectid = None + """the state of the static route""" + self.state = None + """VPC the static route belongs to""" + self.vpcid = None + """the list of resource tags associated with static route""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageNetworkIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageNetworkIpRange.py new file mode 100644 index 00000000000..83807c4b9f9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageNetworkIpRange.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List a storage network IP range.""" +from baseCmd import * +from baseResponse import * +class listStorageNetworkIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """optional parameter. Storaget network IP range uuid, if specicied, using it to search the range.""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """optional parameter. Pod uuid, if specicied and range uuid is absent, using it to search the range.""" + self.podid = None + """optional parameter. Zone uuid, if specicied and both pod uuid and range uuid are absent, using it to search the range.""" + self.zoneid = None + self.required = [] + +class listStorageNetworkIpRangeResponse (baseResponse): + def __init__(self): + """the uuid of storage network IP range.""" + self.id = None + """the end ip of the storage network IP range""" + self.endip = None + """the gateway of the storage network IP range""" + self.gateway = None + """the netmask of the storage network IP range""" + self.netmask = None + """the network uuid of storage network IP range""" + self.networkid = None + """the Pod uuid for the storage network IP range""" + self.podid = None + """the start ip of the storage network IP range""" + self.startip = None + """the ID or VID of the VLAN.""" + self.vlan = None + """the Zone uuid of the storage network IP range""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listStoragePools.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listStoragePools.py new file mode 100644 index 00000000000..7f211a68654 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listStoragePools.py @@ -0,0 +1,97 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists storage pools.""" +from baseCmd import * +from baseResponse import * +class listStoragePoolsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list storage pools belongig to the specific cluster""" + self.clusterid = None + """the ID of the storage pool""" + self.id = None + """the IP address for the storage pool""" + self.ipaddress = None + """List by keyword""" + self.keyword = None + """the name of the storage pool""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the storage pool path""" + self.path = None + """the Pod ID for the storage pool""" + self.podid = None + """the ID of the storage pool""" + self.scope = None + """the Zone ID for the storage pool""" + self.zoneid = None + self.required = [] + +class listStoragePoolsResponse (baseResponse): + def __init__(self): + """the ID of the storage pool""" + self.id = None + """IOPS CloudStack can provision from this storage pool""" + self.capacityiops = None + """the ID of the cluster for the storage pool""" + self.clusterid = None + """the name of the cluster for the storage pool""" + self.clustername = None + """the date and time the storage pool was created""" + self.created = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the storage pool""" + self.disksizetotal = None + """the host's currently used disk size""" + self.disksizeused = None + """the hypervisor type of the storage pool""" + self.hypervisor = None + """the IP address of the storage pool""" + self.ipaddress = None + """the name of the storage pool""" + self.name = None + """the storage pool path""" + self.path = None + """the Pod ID of the storage pool""" + self.podid = None + """the Pod name of the storage pool""" + self.podname = None + """the scope of the storage pool""" + self.scope = None + """the state of the storage pool""" + self.state = None + """true if this pool is suitable to migrate a volume, false otherwise""" + self.suitableformigration = None + """the tags for the storage pool""" + self.tags = None + """the storage pool type""" + self.type = None + """the Zone ID of the storage pool""" + self.zoneid = None + """the Zone name of the storage pool""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageProviders.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageProviders.py new file mode 100644 index 00000000000..264496c901c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageProviders.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists storage providers.""" +from baseCmd import * +from baseResponse import * +class listStorageProvidersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the type of storage provider: either primary or image""" + """Required""" + self.type = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["type",] + +class listStorageProvidersResponse (baseResponse): + def __init__(self): + """the name of the storage provider""" + self.name = None + """the type of the storage provider: primary or image provider""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSupportedNetworkServices.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSupportedNetworkServices.py new file mode 100644 index 00000000000..f9624d6fcc1 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listSupportedNetworkServices.py @@ -0,0 +1,71 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all network services provided by CloudStack or for the given Provider.""" +from baseCmd import * +from baseResponse import * +class listSupportedNetworkServicesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """network service provider name""" + self.provider = None + """network service name to list providers and capabilities of""" + self.service = None + self.required = [] + +class listSupportedNetworkServicesResponse (baseResponse): + def __init__(self): + """the service name""" + self.name = None + """the list of capabilities""" + self.capability = [] + """the service provider name""" + self.provider = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSwifts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSwifts.py new file mode 100644 index 00000000000..b80ac788b30 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listSwifts.py @@ -0,0 +1,55 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List Swift.""" +from baseCmd import * +from baseResponse import * +class listSwiftsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the id of the swift""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listSwiftsResponse (baseResponse): + def __init__(self): + """the ID of the image store""" + self.id = None + """the details of the image store""" + self.details = None + """the name of the image store""" + self.name = None + """the protocol of the image store""" + self.protocol = None + """the provider name of the image store""" + self.providername = None + """the scope of the image store""" + self.scope = None + """the url of the image store""" + self.url = None + """the Zone ID of the image store""" + self.zoneid = None + """the Zone name of the image store""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSystemVms.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSystemVms.py new file mode 100644 index 00000000000..13e54ce329d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listSystemVms.py @@ -0,0 +1,105 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List system virtual machines.""" +from baseCmd import * +from baseResponse import * +class listSystemVmsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the host ID of the system VM""" + self.hostid = None + """the ID of the system VM""" + self.id = None + """List by keyword""" + self.keyword = None + """the name of the system VM""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the Pod ID of the system VM""" + self.podid = None + """the state of the system VM""" + self.state = None + """the storage ID where vm's volumes belong to""" + self.storageid = None + """the system VM type. Possible types are "consoleproxy" and "secondarystoragevm".""" + self.systemvmtype = None + """the Zone ID of the system VM""" + self.zoneid = None + self.required = [] + +class listSystemVmsResponse (baseResponse): + def __init__(self): + """the ID of the system VM""" + self.id = None + """the number of active console sessions for the console proxy system vm""" + self.activeviewersessions = None + """the date and time the system VM was created""" + self.created = None + """the first DNS for the system VM""" + self.dns1 = None + """the second DNS for the system VM""" + self.dns2 = None + """the gateway for the system VM""" + self.gateway = None + """the host ID for the system VM""" + self.hostid = None + """the hostname for the system VM""" + self.hostname = None + """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobid = None + """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobstatus = None + """the link local IP address for the system vm""" + self.linklocalip = None + """the link local MAC address for the system vm""" + self.linklocalmacaddress = None + """the link local netmask for the system vm""" + self.linklocalnetmask = None + """the name of the system VM""" + self.name = None + """the network domain for the system VM""" + self.networkdomain = None + """the Pod ID for the system VM""" + self.podid = None + """the private IP address for the system VM""" + self.privateip = None + """the private MAC address for the system VM""" + self.privatemacaddress = None + """the private netmask for the system VM""" + self.privatenetmask = None + """the public IP address for the system VM""" + self.publicip = None + """the public MAC address for the system VM""" + self.publicmacaddress = None + """the public netmask for the system VM""" + self.publicnetmask = None + """the state of the system VM""" + self.state = None + """the system VM type""" + self.systemvmtype = None + """the template ID for the system VM""" + self.templateid = None + """the Zone ID for the system VM""" + self.zoneid = None + """the Zone name for the system VM""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTags.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTags.py new file mode 100644 index 00000000000..805a1f19b2c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listTags.py @@ -0,0 +1,75 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List resource tag(s)""" +from baseCmd import * +from baseResponse import * +class listTagsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list by customer name""" + self.customer = None + """list only resources belonging to the domain specified""" + self.domainid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """list by key""" + self.key = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """list by resource id""" + self.resourceid = None + """list by resource type""" + self.resourcetype = None + """list by value""" + self.value = None + self.required = [] + +class listTagsResponse (baseResponse): + def __init__(self): + """the account associated with the tag""" + self.account = None + """customer associated with the tag""" + self.customer = None + """the domain associated with the tag""" + self.domain = None + """the ID of the domain associated with the tag""" + self.domainid = None + """tag key name""" + self.key = None + """the project name where tag belongs to""" + self.project = None + """the project id the tag belongs to""" + self.projectid = None + """id of the resource""" + self.resourceid = None + """resource type""" + self.resourcetype = None + """tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplatePermissions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplatePermissions.py new file mode 100644 index 00000000000..9ce101ecc01 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplatePermissions.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List template visibility and all accounts that have permissions to view this template.""" +from baseCmd import * +from baseResponse import * +class listTemplatePermissionsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the template ID""" + """Required""" + self.id = None + self.required = ["id",] + +class listTemplatePermissionsResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the list of accounts the template is available for""" + self.account = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """the list of projects the template is available for""" + self.projectids = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplates.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplates.py new file mode 100644 index 00000000000..1e02b7af44b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplates.py @@ -0,0 +1,157 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List all public, private, and privileged templates.""" +from baseCmd import * +from baseResponse import * +class listTemplatesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """possible values are "featured", "self", "selfexecutable","sharedexecutable","executable", and "community". * featured : templates that have been marked as featured and public. * self : templates that have been registered or created by the calling user. * selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. * sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. * executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. * community : templates that have been marked as public but not featured. * all : all templates (only usable by admins).""" + """Required""" + self.templatefilter = None + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """the hypervisor for which to restrict the search""" + self.hypervisor = None + """the template ID""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """the template name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """list templates by zoneId""" + self.zoneid = None + self.required = ["templatefilter",] + +class listTemplatesResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficMonitors.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficMonitors.py new file mode 100644 index 00000000000..6d94e2fe958 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficMonitors.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List traffic monitor Hosts.""" +from baseCmd import * +from baseResponse import * +class listTrafficMonitorsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """zone Id""" + """Required""" + self.zoneid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["zoneid",] + +class listTrafficMonitorsResponse (baseResponse): + def __init__(self): + """the ID of the external firewall""" + self.id = None + """the management IP address of the external firewall""" + self.ipaddress = None + """the number of times to retry requests to the external firewall""" + self.numretries = None + """the timeout (in seconds) for requests to the external firewall""" + self.timeout = None + """the zone ID of the external firewall""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypeImplementors.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypeImplementors.py new file mode 100644 index 00000000000..282c3bcd803 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypeImplementors.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists implementors of implementor of a network traffic type or implementors of all network traffic types""" +from baseCmd import * +from baseResponse import * +class listTrafficTypeImplementorsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """Optional. The network traffic type, if specified, return its implementor. Otherwise, return all traffic types with their implementor""" + self.traffictype = None + self.required = [] + +class listTrafficTypeImplementorsResponse (baseResponse): + def __init__(self): + """network traffic type""" + self.traffictype = None + """implementor of network traffic type""" + self.traffictypeimplementor = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypes.py new file mode 100644 index 00000000000..2fda712605f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypes.py @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists traffic types of a given physical network.""" +from baseCmd import * +from baseResponse import * +class listTrafficTypesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the Physical Network ID""" + """Required""" + self.physicalnetworkid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["physicalnetworkid",] + +class listTrafficTypesResponse (baseResponse): + def __init__(self): + """uuid of the network provider""" + self.id = None + """true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """the destination physical network""" + self.destinationphysicalnetworkid = None + """the provider name""" + self.name = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """services for this provider""" + self.servicelist = None + """state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsBlades.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsBlades.py new file mode 100644 index 00000000000..c5a3c091524 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsBlades.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List ucs blades""" +from baseCmd import * +from baseResponse import * +class listUcsBladesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """ucs manager id""" + """Required""" + self.ucsmanagerid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["ucsmanagerid",] + +class listUcsBladesResponse (baseResponse): + def __init__(self): + """ucs blade id""" + self.id = None + """ucs blade dn""" + self.bladedn = None + """cloudstack host id this blade associates to""" + self.hostid = None + """associated ucs profile dn""" + self.profiledn = None + """ucs manager id""" + self.ucsmanagerid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsManagers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsManagers.py new file mode 100644 index 00000000000..e18a61e6f6d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsManagers.py @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List ucs manager""" +from baseCmd import * +from baseResponse import * +class listUcsManagersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the ucs manager""" + self.id = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """the zone id""" + self.zoneid = None + self.required = [] + +class listUcsManagersResponse (baseResponse): + def __init__(self): + """the ID of the ucs manager""" + self.id = None + """the name of ucs manager""" + self.name = None + """the url of ucs manager""" + self.url = None + """the zone ID of ucs manager""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsProfiles.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsProfiles.py new file mode 100644 index 00000000000..249fc8eec5f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsProfiles.py @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List profile in ucs manager""" +from baseCmd import * +from baseResponse import * +class listUcsProfilesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the id for the ucs manager""" + """Required""" + self.ucsmanagerid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = ["ucsmanagerid",] + +class listUcsProfilesResponse (baseResponse): + def __init__(self): + """ucs profile dn""" + self.ucsdn = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageRecords.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageRecords.py new file mode 100644 index 00000000000..83131a06e7e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageRecords.py @@ -0,0 +1,101 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists usage records for accounts""" +from baseCmd import * +from baseResponse import * +class listUsageRecordsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """End date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-03.""" + """Required""" + self.enddate = None + """Start date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-01.""" + """Required""" + self.startdate = None + """List usage records for the specified user.""" + self.account = None + """List usage records for the specified account""" + self.accountid = None + """List usage records for the specified domain.""" + self.domainid = None + """List by keyword""" + self.keyword = None + """""" + self.page = None + """""" + self.pagesize = None + """List usage records for specified project""" + self.projectid = None + """List usage records for the specified usage type""" + self.type = None + self.required = ["enddate","startdate",] + +class listUsageRecordsResponse (baseResponse): + def __init__(self): + """the user account name""" + self.account = None + """the user account Id""" + self.accountid = None + """description of the usage record""" + self.description = None + """the domain the resource is associated with""" + self.domain = None + """the domain ID""" + self.domainid = None + """end date of the usage record""" + self.enddate = None + """True if the resource is default""" + self.isdefault = None + """True if the IPAddress is source NAT""" + self.issourcenat = None + """True if the IPAddress is system IP - allocated during vm deploy or lb rule create""" + self.issystem = None + """virtual machine name""" + self.name = None + """id of the network""" + self.networkid = None + """offering ID""" + self.offeringid = None + """the project name of the resource""" + self.project = None + """the project id of the resource""" + self.projectid = None + """raw usage in hours""" + self.rawusage = None + """resource size""" + self.size = None + """start date of the usage record""" + self.startdate = None + """template ID""" + self.templateid = None + """resource type""" + self.type = None + """usage in hours""" + self.usage = None + """id of the resource""" + self.usageid = None + """usage type ID""" + self.usagetype = None + """virtual machine ID""" + self.virtualmachineid = None + """virtual size of resource""" + self.virtualsize = None + """the zone ID""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageTypes.py new file mode 100644 index 00000000000..787a41674fc --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageTypes.py @@ -0,0 +1,33 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List Usage Types""" +from baseCmd import * +from baseResponse import * +class listUsageTypesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + self.required = [] + +class listUsageTypesResponse (baseResponse): + def __init__(self): + """description of usage type""" + self.description = None + """usage type""" + self.usagetypeid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsers.py new file mode 100644 index 00000000000..88dce3bcb25 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsers.py @@ -0,0 +1,85 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists user accounts""" +from baseCmd import * +from baseResponse import * +class listUsersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """List users by account type. Valid types include admin, domain-admin, read-only-admin, or user.""" + self.accounttype = None + """list only resources belonging to the domain specified""" + self.domainid = None + """List user by ID.""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """List users by state of the user account.""" + self.state = None + """List user by the username""" + self.username = None + self.required = [] + +class listUsersResponse (baseResponse): + def __init__(self): + """the user ID""" + self.id = None + """the account name of the user""" + self.account = None + """the account ID of the user""" + self.accountid = None + """the account type of the user""" + self.accounttype = None + """the api key of the user""" + self.apikey = None + """the date and time the user account was created""" + self.created = None + """the domain name of the user""" + self.domain = None + """the domain ID of the user""" + self.domainid = None + """the user email address""" + self.email = None + """the user firstname""" + self.firstname = None + """the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """true if user is default, false otherwise""" + self.isdefault = None + """the user lastname""" + self.lastname = None + """the secret key of the user""" + self.secretkey = None + """the user state""" + self.state = None + """the timezone user was created in""" + self.timezone = None + """the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVMSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVMSnapshot.py new file mode 100644 index 00000000000..340580747fd --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVMSnapshot.py @@ -0,0 +1,89 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List virtual machine snapshot by conditions""" +from baseCmd import * +from baseResponse import * +class listVMSnapshotCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """lists snapshot by snapshot name or display name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """state of the virtual machine snapshot""" + self.state = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """the ID of the vm""" + self.virtualmachineid = None + """The ID of the VM snapshot""" + self.vmsnapshotid = None + self.required = [] + +class listVMSnapshotResponse (baseResponse): + def __init__(self): + """the ID of the vm snapshot""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the create date of the vm snapshot""" + self.created = None + """indiates if this is current snapshot""" + self.current = None + """the description of the vm snapshot""" + self.description = None + """the display name of the vm snapshot""" + self.displayname = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """the name of the vm snapshot""" + self.name = None + """the parent ID of the vm snapshot""" + self.parent = None + """the parent displayName of the vm snapshot""" + self.parentName = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the state of the vm snapshot""" + self.state = None + """VM Snapshot type""" + self.type = None + """the vm ID of the vm snapshot""" + self.virtualmachineid = None + """the Zone ID of the vm snapshot""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCOfferings.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCOfferings.py new file mode 100644 index 00000000000..0c707c1a5d9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCOfferings.py @@ -0,0 +1,116 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists VPC offerings""" +from baseCmd import * +from baseResponse import * +class listVPCOfferingsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list VPC offerings by display text""" + self.displaytext = None + """list VPC offerings by id""" + self.id = None + """true if need to list only default VPC offerings. Default value is false""" + self.isdefault = None + """List by keyword""" + self.keyword = None + """list VPC offerings by name""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list VPC offerings by state""" + self.state = None + """list VPC offerings supporting certain services""" + self.supportedservices = [] + self.required = [] + +class listVPCOfferingsResponse (baseResponse): + def __init__(self): + """the id of the vpc offering""" + self.id = None + """the date this vpc offering was created""" + self.created = None + """an alternate display text of the vpc offering.""" + self.displaytext = None + """true if vpc offering is default, false otherwise""" + self.isdefault = None + """the name of the vpc offering""" + self.name = None + """state of the vpc offering. Can be Disabled/Enabled""" + self.state = None + """the list of supported services""" + self.service = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCs.py new file mode 100644 index 00000000000..51a3b4cdb43 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCs.py @@ -0,0 +1,426 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists VPCs""" +from baseCmd import * +from baseResponse import * +class listVPCsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list by cidr of the VPC. All VPC guest networks' cidrs should be within this CIDR""" + self.cidr = None + """List by display text of the VPC""" + self.displaytext = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list VPC by id""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """list by name of the VPC""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """list VPCs by restartRequired option""" + self.restartrequired = None + """list VPCs by state""" + self.state = None + """list VPC supporting certain services""" + self.supportedservices = [] + """List resources by tags (key/value pairs)""" + self.tags = [] + """list by ID of the VPC offering""" + self.vpcofferingid = None + """list by zone""" + self.zoneid = None + self.required = [] + +class listVPCsResponse (baseResponse): + def __init__(self): + """the id of the VPC""" + self.id = None + """the owner of the VPC""" + self.account = None + """the cidr the VPC""" + self.cidr = None + """the date this VPC was created""" + self.created = None + """an alternate display text of the VPC.""" + self.displaytext = None + """the domain name of the owner""" + self.domain = None + """the domain id of the VPC owner""" + self.domainid = None + """the name of the VPC""" + self.name = None + """the network domain of the VPC""" + self.networkdomain = None + """the project name of the VPC""" + self.project = None + """the project id of the VPC""" + self.projectid = None + """true VPC requires restart""" + self.restartrequired = None + """state of the VPC. Can be Inactive/Enabled""" + self.state = None + """vpc offering id the VPC is created from""" + self.vpcofferingid = None + """zone id of the vpc""" + self.zoneid = None + """the name of the zone the VPC belongs to""" + self.zonename = None + """the list of networks belongign to the VPC""" + self.network = [] + """the list of supported services""" + self.service = [] + """the list of resource tags associated with the project""" + self.tags = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class network: + def __init__(self): + """"the id of the network""" + self.id = None + """"the owner of the network""" + self.account = None + """"ACL Id associated with the VPC network""" + self.aclid = None + """"acl type - access type to the network""" + self.acltype = None + """"Broadcast domain type of the network""" + self.broadcastdomaintype = None + """"broadcast uri of the network. This parameter is visible to ROOT admins only""" + self.broadcasturi = None + """"list networks available for vm deployment""" + self.canusefordeploy = None + """"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" + self.cidr = None + """"an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """"the displaytext of the network""" + self.displaytext = None + """"the first DNS for the network""" + self.dns1 = None + """"the second DNS for the network""" + self.dns2 = None + """"the domain name of the network owner""" + self.domain = None + """"the domain id of the network owner""" + self.domainid = None + """"the network's gateway""" + self.gateway = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"true if network is default, false otherwise""" + self.isdefault = None + """"list networks that are persistent""" + self.ispersistent = None + """"true if network is system, false otherwise""" + self.issystem = None + """"the name of the network""" + self.name = None + """"the network's netmask""" + self.netmask = None + """"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" + self.networkcidr = None + """"the network domain""" + self.networkdomain = None + """"availability of the network offering the network is created from""" + self.networkofferingavailability = None + """"true if network offering is ip conserve mode enabled""" + self.networkofferingconservemode = None + """"display text of the network offering the network is created from""" + self.networkofferingdisplaytext = None + """"network offering id the network is created from""" + self.networkofferingid = None + """"name of the network offering the network is created from""" + self.networkofferingname = None + """"the physical network id""" + self.physicalnetworkid = None + """"the project name of the address""" + self.project = None + """"the project id of the ipaddress""" + self.projectid = None + """"related to what other network configuration""" + self.related = None + """"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" + self.reservediprange = None + """"true network requires restart""" + self.restartrequired = None + """"true if network supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """"state of the network""" + self.state = None + """"true if users from subdomains can access the domain level network""" + self.subdomainaccess = None + """"the traffic type of the network""" + self.traffictype = None + """"the type of the network""" + self.type = None + """"The vlan of the network. This parameter is visible to ROOT admins only""" + self.vlan = None + """"VPC the network belongs to""" + self.vpcid = None + """"zone id of the network""" + self.zoneid = None + """"the name of the zone the network belongs to""" + self.zonename = None + """"the list of services""" + self.service = [] + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + """"the list of resource tags associated with network""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualMachines.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualMachines.py new file mode 100644 index 00000000000..525532c3a9f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualMachines.py @@ -0,0 +1,416 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""List the virtual machines owned by the account.""" +from baseCmd import * +from baseResponse import * +class listVirtualMachinesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list vms by affinity group""" + self.affinitygroupid = None + """comma separated list of host details requested, value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min, affgrp]. If no parameter is passed in, the details will be defaulted to all""" + self.details = [] + """list only resources belonging to the domain specified""" + self.domainid = None + """list by network type; true if need to list vms using Virtual Network, false otherwise""" + self.forvirtualnetwork = None + """the group ID""" + self.groupid = None + """the host ID""" + self.hostid = None + """the target hypervisor for the template""" + self.hypervisor = None + """the ID of the virtual machine""" + self.id = None + """list vms by iso""" + self.isoid = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """name of the virtual machine""" + self.name = None + """list by network id""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """the pod ID""" + self.podid = None + """list objects by project""" + self.projectid = None + """state of the virtual machine""" + self.state = None + """the storage ID where vm's volumes belong to""" + self.storageid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """list vms by template""" + self.templateid = None + """list vms by vpc""" + self.vpcid = None + """the availability zone ID""" + self.zoneid = None + self.required = [] + +class listVirtualMachinesResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualRouterElements.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualRouterElements.py new file mode 100644 index 00000000000..abfe93a397a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualRouterElements.py @@ -0,0 +1,57 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all available virtual router elements.""" +from baseCmd import * +from baseResponse import * +class listVirtualRouterElementsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list network offerings by enabled state""" + self.enabled = None + """list virtual router elements by id""" + self.id = None + """List by keyword""" + self.keyword = None + """list virtual router elements by network service provider id""" + self.nspid = None + """""" + self.page = None + """""" + self.pagesize = None + self.required = [] + +class listVirtualRouterElementsResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the provider""" + self.account = None + """the domain associated with the provider""" + self.domain = None + """the domain ID associated with the provider""" + self.domainid = None + """Enabled/Disabled the service provider""" + self.enabled = None + """the physical network service provider id of the provider""" + self.nspid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVlanIpRanges.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVlanIpRanges.py new file mode 100644 index 00000000000..2d7ac4a24a6 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVlanIpRanges.py @@ -0,0 +1,99 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all VLAN IP ranges.""" +from baseCmd import * +from baseResponse import * +class listVlanIpRangesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the account with which the VLAN IP range is associated. Must be used with the domainId parameter.""" + self.account = None + """the domain ID with which the VLAN IP range is associated. If used with the account parameter, returns all VLAN IP ranges for that account in the specified domain.""" + self.domainid = None + """true if VLAN is of Virtual type, false if Direct""" + self.forvirtualnetwork = None + """the ID of the VLAN IP range""" + self.id = None + """List by keyword""" + self.keyword = None + """network id of the VLAN IP range""" + self.networkid = None + """""" + self.page = None + """""" + self.pagesize = None + """physical network id of the VLAN IP range""" + self.physicalnetworkid = None + """the Pod ID of the VLAN IP range""" + self.podid = None + """project who will own the VLAN""" + self.projectid = None + """the ID or VID of the VLAN. Default is an "untagged" VLAN.""" + self.vlan = None + """the Zone ID of the VLAN IP range""" + self.zoneid = None + self.required = [] + +class listVlanIpRangesResponse (baseResponse): + def __init__(self): + """the ID of the VLAN IP range""" + self.id = None + """the account of the VLAN IP range""" + self.account = None + """the description of the VLAN IP range""" + self.description = None + """the domain name of the VLAN IP range""" + self.domain = None + """the domain ID of the VLAN IP range""" + self.domainid = None + """the end ip of the VLAN IP range""" + self.endip = None + """the end ipv6 of the VLAN IP range""" + self.endipv6 = None + """the virtual network for the VLAN IP range""" + self.forvirtualnetwork = None + """the gateway of the VLAN IP range""" + self.gateway = None + """the cidr of IPv6 network""" + self.ip6cidr = None + """the gateway of IPv6 network""" + self.ip6gateway = None + """the netmask of the VLAN IP range""" + self.netmask = None + """the network id of vlan range""" + self.networkid = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """the Pod ID for the VLAN IP range""" + self.podid = None + """the Pod name for the VLAN IP range""" + self.podname = None + """the project name of the vlan range""" + self.project = None + """the project id of the vlan range""" + self.projectid = None + """the start ip of the VLAN IP range""" + self.startip = None + """the start ipv6 of the VLAN IP range""" + self.startipv6 = None + """the ID or VID of the VLAN.""" + self.vlan = None + """the Zone ID of the VLAN IP range""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVolumes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVolumes.py new file mode 100644 index 00000000000..39f514be531 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVolumes.py @@ -0,0 +1,172 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists all volumes.""" +from baseCmd import * +from baseResponse import * +class listVolumesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """list volumes on specified host""" + self.hostid = None + """the ID of the disk volume""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """the name of the disk volume""" + self.name = None + """""" + self.page = None + """""" + self.pagesize = None + """the pod id the disk volume belongs to""" + self.podid = None + """list objects by project""" + self.projectid = None + """List resources by tags (key/value pairs)""" + self.tags = [] + """the type of disk volume""" + self.type = None + """the ID of the virtual machine""" + self.virtualmachineid = None + """the ID of the availability zone""" + self.zoneid = None + self.required = [] + +class listVolumesResponse (baseResponse): + def __init__(self): + """ID of the disk volume""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the date the volume was attached to a VM instance""" + self.attached = None + """the date the disk volume was created""" + self.created = None + """the boolean state of whether the volume is destroyed or not""" + self.destroyed = None + """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" + self.deviceid = None + """bytes read rate of the disk volume""" + self.diskBytesReadRate = None + """bytes write rate of the disk volume""" + self.diskBytesWriteRate = None + """io requests read rate of the disk volume""" + self.diskIopsReadRate = None + """io requests write rate of the disk volume""" + self.diskIopsWriteRate = None + """the display text of the disk offering""" + self.diskofferingdisplaytext = None + """ID of the disk offering""" + self.diskofferingid = None + """name of the disk offering""" + self.diskofferingname = None + """an optional field whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """Hypervisor the volume belongs to""" + self.hypervisor = None + """true if the volume is extractable, false otherwise""" + self.isextractable = None + """max iops of the disk volume""" + self.maxiops = None + """min iops of the disk volume""" + self.miniops = None + """name of the disk volume""" + self.name = None + """The path of the volume""" + self.path = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the display text of the service offering for root disk""" + self.serviceofferingdisplaytext = None + """ID of the service offering for root disk""" + self.serviceofferingid = None + """name of the service offering for root disk""" + self.serviceofferingname = None + """size of the disk volume""" + self.size = None + """ID of the snapshot from which this volume was created""" + self.snapshotid = None + """the state of the disk volume""" + self.state = None + """the status of the volume""" + self.status = None + """name of the primary storage hosting the disk volume""" + self.storage = None + """id of the primary storage hosting the disk volume; returned to admin user only""" + self.storageid = None + """shared or local storage""" + self.storagetype = None + """type of the disk volume (ROOT or DATADISK)""" + self.type = None + """id of the virtual machine""" + self.virtualmachineid = None + """display name of the virtual machine""" + self.vmdisplayname = None + """name of the virtual machine""" + self.vmname = None + """state of the virtual machine""" + self.vmstate = None + """ID of the availability zone""" + self.zoneid = None + """name of the availability zone""" + self.zonename = None + """the list of resource tags associated with volume""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnConnections.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnConnections.py new file mode 100644 index 00000000000..db94bca2940 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnConnections.py @@ -0,0 +1,89 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists site to site vpn connection gateways""" +from baseCmd import * +from baseResponse import * +class listVpnConnectionsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """id of the vpn connection""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """id of vpc""" + self.vpcid = None + self.required = [] + +class listVpnConnectionsResponse (baseResponse): + def __init__(self): + """the vpn gateway ID""" + self.id = None + """the owner""" + self.account = None + """guest cidr list of the customer gateway""" + self.cidrlist = None + """the date and time the host was created""" + self.created = None + """the domain name of the owner""" + self.domain = None + """the domain id of the owner""" + self.domainid = None + """if DPD is enabled for customer gateway""" + self.dpd = None + """Lifetime of ESP SA of customer gateway""" + self.esplifetime = None + """ESP policy of the customer gateway""" + self.esppolicy = None + """public ip address id of the customer gateway""" + self.gateway = None + """Lifetime of IKE SA of customer gateway""" + self.ikelifetime = None + """IKE policy of the customer gateway""" + self.ikepolicy = None + """IPsec Preshared-Key of the customer gateway""" + self.ipsecpsk = None + """the project name""" + self.project = None + """the project id""" + self.projectid = None + """the public IP address""" + self.publicip = None + """the date and time the host was removed""" + self.removed = None + """the customer gateway ID""" + self.s2scustomergatewayid = None + """the vpn gateway ID""" + self.s2svpngatewayid = None + """State of vpn connection""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnCustomerGateways.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnCustomerGateways.py new file mode 100644 index 00000000000..c730db37559 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnCustomerGateways.py @@ -0,0 +1,81 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists site to site vpn customer gateways""" +from baseCmd import * +from baseResponse import * +class listVpnCustomerGatewaysCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """id of the customer gateway""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + self.required = [] + +class listVpnCustomerGatewaysResponse (baseResponse): + def __init__(self): + """the vpn gateway ID""" + self.id = None + """the owner""" + self.account = None + """guest cidr list of the customer gateway""" + self.cidrlist = None + """the domain name of the owner""" + self.domain = None + """the domain id of the owner""" + self.domainid = None + """if DPD is enabled for customer gateway""" + self.dpd = None + """Lifetime of ESP SA of customer gateway""" + self.esplifetime = None + """IPsec policy of customer gateway""" + self.esppolicy = None + """public ip address id of the customer gateway""" + self.gateway = None + """Lifetime of IKE SA of customer gateway""" + self.ikelifetime = None + """IKE policy of customer gateway""" + self.ikepolicy = None + """guest ip of the customer gateway""" + self.ipaddress = None + """IPsec preshared-key of customer gateway""" + self.ipsecpsk = None + """name of the customer gateway""" + self.name = None + """the project name""" + self.project = None + """the project id""" + self.projectid = None + """the date and time the host was removed""" + self.removed = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnGateways.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnGateways.py new file mode 100644 index 00000000000..14fcb8f5730 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnGateways.py @@ -0,0 +1,67 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists site 2 site vpn gateways""" +from baseCmd import * +from baseResponse import * +class listVpnGatewaysCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """id of the vpn gateway""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """id of vpc""" + self.vpcid = None + self.required = [] + +class listVpnGatewaysResponse (baseResponse): + def __init__(self): + """the vpn gateway ID""" + self.id = None + """the owner""" + self.account = None + """the domain name of the owner""" + self.domain = None + """the domain id of the owner""" + self.domainid = None + """the project name""" + self.project = None + """the project id""" + self.projectid = None + """the public IP address""" + self.publicip = None + """the date and time the host was removed""" + self.removed = None + """the vpc id of this gateway""" + self.vpcid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnUsers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnUsers.py new file mode 100644 index 00000000000..79ae68aea0d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnUsers.py @@ -0,0 +1,65 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists vpn users""" +from baseCmd import * +from baseResponse import * +class listVpnUsersCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """list resources by account. Must be used with the domainId parameter.""" + self.account = None + """list only resources belonging to the domain specified""" + self.domainid = None + """The uuid of the Vpn user""" + self.id = None + """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" + self.isrecursive = None + """List by keyword""" + self.keyword = None + """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" + self.listall = None + """""" + self.page = None + """""" + self.pagesize = None + """list objects by project""" + self.projectid = None + """the username of the vpn user.""" + self.username = None + self.required = [] + +class listVpnUsersResponse (baseResponse): + def __init__(self): + """the vpn userID""" + self.id = None + """the account of the remote access vpn""" + self.account = None + """the domain name of the account of the remote access vpn""" + self.domain = None + """the domain id of the account of the remote access vpn""" + self.domainid = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the state of the Vpn User""" + self.state = None + """the username of the vpn user""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listZones.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listZones.py new file mode 100644 index 00000000000..5e6ed5d6d23 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/listZones.py @@ -0,0 +1,141 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Lists zones""" +from baseCmd import * +from baseResponse import * +class listZonesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """true if you want to retrieve all available Zones. False if you only want to return the Zones from which you have at least one VM. Default is false.""" + self.available = None + """the ID of the domain associated with the zone""" + self.domainid = None + """the ID of the zone""" + self.id = None + """List by keyword""" + self.keyword = None + """the name of the zone""" + self.name = None + """the network type of the zone that the virtual machine belongs to""" + self.networktype = None + """""" + self.page = None + """""" + self.pagesize = None + """flag to display the capacity of the zones""" + self.showcapacities = None + """List zones by resource tags (key/value pairs)""" + self.tags = [] + self.required = [] + +class listZonesResponse (baseResponse): + def __init__(self): + """Zone id""" + self.id = None + """the allocation state of the cluster""" + self.allocationstate = None + """Zone description""" + self.description = None + """the dhcp Provider for the Zone""" + self.dhcpprovider = None + """the display text of the zone""" + self.displaytext = None + """the first DNS for the Zone""" + self.dns1 = None + """the second DNS for the Zone""" + self.dns2 = None + """Network domain name for the networks in the zone""" + self.domain = None + """the UUID of the containing domain, null for public zones""" + self.domainid = None + """the name of the containing domain, null for public zones""" + self.domainname = None + """the guest CIDR address for the Zone""" + self.guestcidraddress = None + """the first internal DNS for the Zone""" + self.internaldns1 = None + """the second internal DNS for the Zone""" + self.internaldns2 = None + """the first IPv6 DNS for the Zone""" + self.ip6dns1 = None + """the second IPv6 DNS for the Zone""" + self.ip6dns2 = None + """true if local storage offering enabled, false otherwise""" + self.localstorageenabled = None + """Zone name""" + self.name = None + """the network type of the zone; can be Basic or Advanced""" + self.networktype = None + """true if security groups support is enabled, false otherwise""" + self.securitygroupsenabled = None + """the vlan range of the zone""" + self.vlan = None + """Zone Token""" + self.zonetoken = None + """the capacity of the Zone""" + self.capacity = [] + """the list of resource tags associated with zone.""" + self.tags = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/lockAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/lockAccount.py new file mode 100644 index 00000000000..d33f898550d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/lockAccount.py @@ -0,0 +1,176 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Locks an account""" +from baseCmd import * +from baseResponse import * +class lockAccountCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Locks the specified account.""" + """Required""" + self.account = None + """Locks the specified account on this domain.""" + """Required""" + self.domainid = None + self.required = ["account","domainid",] + +class lockAccountResponse (baseResponse): + def __init__(self): + """the id of the account""" + self.id = None + """details for the account""" + self.accountdetails = None + """account type (admin, domain-admin, user)""" + self.accounttype = None + """the total number of cpu cores available to be created for this account""" + self.cpuavailable = None + """the total number of cpu cores the account can own""" + self.cpulimit = None + """the total number of cpu cores owned by account""" + self.cputotal = None + """the default zone of the account""" + self.defaultzoneid = None + """name of the Domain the account belongs too""" + self.domain = None + """id of the Domain the account belongs too""" + self.domainid = None + """the total number of public ip addresses available for this account to acquire""" + self.ipavailable = None + """the total number of public ip addresses this account can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this account""" + self.iptotal = None + """true if the account requires cleanup""" + self.iscleanuprequired = None + """true if account is default, false otherwise""" + self.isdefault = None + """the total memory (in MB) available to be created for this account""" + self.memoryavailable = None + """the total memory (in MB) the account can own""" + self.memorylimit = None + """the total memory (in MB) owned by account""" + self.memorytotal = None + """the name of the account""" + self.name = None + """the total number of networks available to be created for this account""" + self.networkavailable = None + """the network domain""" + self.networkdomain = None + """the total number of networks the account can own""" + self.networklimit = None + """the total number of networks owned by account""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this account""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the account can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by account""" + self.primarystoragetotal = None + """the total number of projects available for administration by this account""" + self.projectavailable = None + """the total number of projects the account can own""" + self.projectlimit = None + """the total number of projects being administrated by this account""" + self.projecttotal = None + """the total number of network traffic bytes received""" + self.receivedbytes = None + """the total secondary storage space (in GiB) available to be used for this account""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the account can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by account""" + self.secondarystoragetotal = None + """the total number of network traffic bytes sent""" + self.sentbytes = None + """the total number of snapshots available for this account""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this account""" + self.snapshotlimit = None + """the total number of snapshots stored by this account""" + self.snapshottotal = None + """the state of the account""" + self.state = None + """the total number of templates available to be created by this account""" + self.templateavailable = None + """the total number of templates which can be created by this account""" + self.templatelimit = None + """the total number of templates which have been created by this account""" + self.templatetotal = None + """the total number of virtual machines available for this account to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this account""" + self.vmlimit = None + """the total number of virtual machines running for this account""" + self.vmrunning = None + """the total number of virtual machines stopped for this account""" + self.vmstopped = None + """the total number of virtual machines deployed by this account""" + self.vmtotal = None + """the total volume available for this account""" + self.volumeavailable = None + """the total volume which can be used by this account""" + self.volumelimit = None + """the total volume being used by this account""" + self.volumetotal = None + """the total number of vpcs available to be created for this account""" + self.vpcavailable = None + """the total number of vpcs the account can own""" + self.vpclimit = None + """the total number of vpcs owned by account""" + self.vpctotal = None + """the list of users associated with account""" + self.user = [] + +class user: + def __init__(self): + """"the user ID""" + self.id = None + """"the account name of the user""" + self.account = None + """"the account ID of the user""" + self.accountid = None + """"the account type of the user""" + self.accounttype = None + """"the api key of the user""" + self.apikey = None + """"the date and time the user account was created""" + self.created = None + """"the domain name of the user""" + self.domain = None + """"the domain ID of the user""" + self.domainid = None + """"the user email address""" + self.email = None + """"the user firstname""" + self.firstname = None + """"the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """"true if user is default, false otherwise""" + self.isdefault = None + """"the user lastname""" + self.lastname = None + """"the secret key of the user""" + self.secretkey = None + """"the user state""" + self.state = None + """"the timezone user was created in""" + self.timezone = None + """"the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/lockUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/lockUser.py new file mode 100644 index 00000000000..0372547ea82 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/lockUser.py @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Locks a user account""" +from baseCmd import * +from baseResponse import * +class lockUserCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Locks user by user ID.""" + """Required""" + self.id = None + self.required = ["id",] + +class lockUserResponse (baseResponse): + def __init__(self): + """the user ID""" + self.id = None + """the account name of the user""" + self.account = None + """the account ID of the user""" + self.accountid = None + """the account type of the user""" + self.accounttype = None + """the api key of the user""" + self.apikey = None + """the date and time the user account was created""" + self.created = None + """the domain name of the user""" + self.domain = None + """the domain ID of the user""" + self.domainid = None + """the user email address""" + self.email = None + """the user firstname""" + self.firstname = None + """the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """true if user is default, false otherwise""" + self.isdefault = None + """the user lastname""" + self.lastname = None + """the secret key of the user""" + self.secretkey = None + """the user state""" + self.state = None + """the timezone user was created in""" + self.timezone = None + """the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/login.py b/tools/marvin/build/lib/marvin/cloudstackAPI/login.py new file mode 100644 index 00000000000..003bd1143fe --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/login.py @@ -0,0 +1,63 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Logs a user into the CloudStack. A successful login attempt will generate a JSESSIONID cookie value that can be passed in subsequent Query command calls until the "logout" command has been issued or the session has expired.""" +from baseCmd import * +from baseResponse import * +class loginCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Username""" + """Required""" + self.username = None + """Hashed password (Default is MD5). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.""" + """Required""" + self.password = None + """path of the domain that the user belongs to. Example: domain=/com/cloud/internal. If no domain is passed in, the ROOT domain is assumed.""" + self.domain = None + """id of the domain that the user belongs to. If both domain and domainId are passed in, "domainId" parameter takes precendence""" + self.domainId = None + self.required = ["username","password",] + +class loginResponse (baseResponse): + def __init__(self): + """Username""" + self.username = None + """User id""" + self.userid = None + """Password""" + self.password = None + """domain ID that the user belongs to""" + self.domainid = None + """the time period before the session has expired""" + self.timeout = None + """the account name the user belongs to""" + self.account = None + """first name of the user""" + self.firstname = None + """last name of the user""" + self.lastname = None + """the account type (admin, domain-admin, read-only-admin, user)""" + self.type = None + """user time zone""" + self.timezone = None + """user time zone offset from UTC 00:00""" + self.timezoneoffset = None + """Session key that can be passed in subsequent Query command calls""" + self.sessionkey = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/logout.py b/tools/marvin/build/lib/marvin/cloudstackAPI/logout.py new file mode 100644 index 00000000000..6bd43327fee --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/logout.py @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Logs out the user""" +from baseCmd import * +from baseResponse import * +class logoutCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + self.required = [] + +class logoutResponse (baseResponse): + def __init__(self): + """success if the logout action succeeded""" + self.description = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/markDefaultZoneForAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/markDefaultZoneForAccount.py new file mode 100644 index 00000000000..dcf2621ca5c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/markDefaultZoneForAccount.py @@ -0,0 +1,179 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Marks a default zone for this account""" +from baseCmd import * +from baseResponse import * +class markDefaultZoneForAccountCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Name of the account that is to be marked.""" + """Required""" + self.account = None + """Marks the account that belongs to the specified domain.""" + """Required""" + self.domainid = None + """The Zone ID with which the account is to be marked.""" + """Required""" + self.zoneid = None + self.required = ["account","domainid","zoneid",] + +class markDefaultZoneForAccountResponse (baseResponse): + def __init__(self): + """the id of the account""" + self.id = None + """details for the account""" + self.accountdetails = None + """account type (admin, domain-admin, user)""" + self.accounttype = None + """the total number of cpu cores available to be created for this account""" + self.cpuavailable = None + """the total number of cpu cores the account can own""" + self.cpulimit = None + """the total number of cpu cores owned by account""" + self.cputotal = None + """the default zone of the account""" + self.defaultzoneid = None + """name of the Domain the account belongs too""" + self.domain = None + """id of the Domain the account belongs too""" + self.domainid = None + """the total number of public ip addresses available for this account to acquire""" + self.ipavailable = None + """the total number of public ip addresses this account can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this account""" + self.iptotal = None + """true if the account requires cleanup""" + self.iscleanuprequired = None + """true if account is default, false otherwise""" + self.isdefault = None + """the total memory (in MB) available to be created for this account""" + self.memoryavailable = None + """the total memory (in MB) the account can own""" + self.memorylimit = None + """the total memory (in MB) owned by account""" + self.memorytotal = None + """the name of the account""" + self.name = None + """the total number of networks available to be created for this account""" + self.networkavailable = None + """the network domain""" + self.networkdomain = None + """the total number of networks the account can own""" + self.networklimit = None + """the total number of networks owned by account""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this account""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the account can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by account""" + self.primarystoragetotal = None + """the total number of projects available for administration by this account""" + self.projectavailable = None + """the total number of projects the account can own""" + self.projectlimit = None + """the total number of projects being administrated by this account""" + self.projecttotal = None + """the total number of network traffic bytes received""" + self.receivedbytes = None + """the total secondary storage space (in GiB) available to be used for this account""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the account can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by account""" + self.secondarystoragetotal = None + """the total number of network traffic bytes sent""" + self.sentbytes = None + """the total number of snapshots available for this account""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this account""" + self.snapshotlimit = None + """the total number of snapshots stored by this account""" + self.snapshottotal = None + """the state of the account""" + self.state = None + """the total number of templates available to be created by this account""" + self.templateavailable = None + """the total number of templates which can be created by this account""" + self.templatelimit = None + """the total number of templates which have been created by this account""" + self.templatetotal = None + """the total number of virtual machines available for this account to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this account""" + self.vmlimit = None + """the total number of virtual machines running for this account""" + self.vmrunning = None + """the total number of virtual machines stopped for this account""" + self.vmstopped = None + """the total number of virtual machines deployed by this account""" + self.vmtotal = None + """the total volume available for this account""" + self.volumeavailable = None + """the total volume which can be used by this account""" + self.volumelimit = None + """the total volume being used by this account""" + self.volumetotal = None + """the total number of vpcs available to be created for this account""" + self.vpcavailable = None + """the total number of vpcs the account can own""" + self.vpclimit = None + """the total number of vpcs owned by account""" + self.vpctotal = None + """the list of users associated with account""" + self.user = [] + +class user: + def __init__(self): + """"the user ID""" + self.id = None + """"the account name of the user""" + self.account = None + """"the account ID of the user""" + self.accountid = None + """"the account type of the user""" + self.accounttype = None + """"the api key of the user""" + self.apikey = None + """"the date and time the user account was created""" + self.created = None + """"the domain name of the user""" + self.domain = None + """"the domain ID of the user""" + self.domainid = None + """"the user email address""" + self.email = None + """"the user firstname""" + self.firstname = None + """"the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """"true if user is default, false otherwise""" + self.isdefault = None + """"the user lastname""" + self.lastname = None + """"the secret key of the user""" + self.secretkey = None + """"the user state""" + self.state = None + """"the timezone user was created in""" + self.timezone = None + """"the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateSystemVm.py new file mode 100644 index 00000000000..ab2a7b544be --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateSystemVm.py @@ -0,0 +1,89 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Attempts Migration of a system virtual machine to the host specified.""" +from baseCmd import * +from baseResponse import * +class migrateSystemVmCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """destination Host ID to migrate VM to""" + """Required""" + self.hostid = None + """the ID of the virtual machine""" + """Required""" + self.virtualmachineid = None + self.required = ["hostid","virtualmachineid",] + +class migrateSystemVmResponse (baseResponse): + def __init__(self): + """the ID of the system VM""" + self.id = None + """the number of active console sessions for the console proxy system vm""" + self.activeviewersessions = None + """the date and time the system VM was created""" + self.created = None + """the first DNS for the system VM""" + self.dns1 = None + """the second DNS for the system VM""" + self.dns2 = None + """the gateway for the system VM""" + self.gateway = None + """the host ID for the system VM""" + self.hostid = None + """the hostname for the system VM""" + self.hostname = None + """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobid = None + """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobstatus = None + """the link local IP address for the system vm""" + self.linklocalip = None + """the link local MAC address for the system vm""" + self.linklocalmacaddress = None + """the link local netmask for the system vm""" + self.linklocalnetmask = None + """the name of the system VM""" + self.name = None + """the network domain for the system VM""" + self.networkdomain = None + """the Pod ID for the system VM""" + self.podid = None + """the private IP address for the system VM""" + self.privateip = None + """the private MAC address for the system VM""" + self.privatemacaddress = None + """the private netmask for the system VM""" + self.privatenetmask = None + """the public IP address for the system VM""" + self.publicip = None + """the public MAC address for the system VM""" + self.publicmacaddress = None + """the public netmask for the system VM""" + self.publicnetmask = None + """the state of the system VM""" + self.state = None + """the system VM type""" + self.systemvmtype = None + """the template ID for the system VM""" + self.templateid = None + """the Zone ID for the system VM""" + self.zoneid = None + """the Zone name for the system VM""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachine.py new file mode 100644 index 00000000000..6e72c72785a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachine.py @@ -0,0 +1,373 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Attempts Migration of a VM to a different host or Root volume of the vm to a different storage pool""" +from baseCmd import * +from baseResponse import * +class migrateVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the virtual machine""" + """Required""" + self.virtualmachineid = None + """Destination Host ID to migrate VM to. Required for live migrating a VM from host to host""" + self.hostid = None + """Destination storage pool ID to migrate VM volumes to. Required for migrating the root disk volume""" + self.storageid = None + self.required = ["virtualmachineid",] + +class migrateVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachineWithVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachineWithVolume.py new file mode 100644 index 00000000000..f7e6c53dc2d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachineWithVolume.py @@ -0,0 +1,374 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Attempts Migration of a VM with its volumes to a different host""" +from baseCmd import * +from baseResponse import * +class migrateVirtualMachineWithVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Destination Host ID to migrate VM to.""" + """Required""" + self.hostid = None + """the ID of the virtual machine""" + """Required""" + self.virtualmachineid = None + """Map of pool to which each volume should be migrated (volume/pool pair)""" + self.migrateto = [] + self.required = ["hostid","virtualmachineid",] + +class migrateVirtualMachineWithVolumeResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVolume.py new file mode 100644 index 00000000000..895876f727d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVolume.py @@ -0,0 +1,148 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Migrate volume""" +from baseCmd import * +from baseResponse import * +class migrateVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """destination storage pool ID to migrate the volume to""" + """Required""" + self.storageid = None + """the ID of the volume""" + """Required""" + self.volumeid = None + """if the volume should be live migrated when it is attached to a running vm""" + self.livemigrate = None + self.required = ["storageid","volumeid",] + +class migrateVolumeResponse (baseResponse): + def __init__(self): + """ID of the disk volume""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the date the volume was attached to a VM instance""" + self.attached = None + """the date the disk volume was created""" + self.created = None + """the boolean state of whether the volume is destroyed or not""" + self.destroyed = None + """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" + self.deviceid = None + """bytes read rate of the disk volume""" + self.diskBytesReadRate = None + """bytes write rate of the disk volume""" + self.diskBytesWriteRate = None + """io requests read rate of the disk volume""" + self.diskIopsReadRate = None + """io requests write rate of the disk volume""" + self.diskIopsWriteRate = None + """the display text of the disk offering""" + self.diskofferingdisplaytext = None + """ID of the disk offering""" + self.diskofferingid = None + """name of the disk offering""" + self.diskofferingname = None + """an optional field whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """Hypervisor the volume belongs to""" + self.hypervisor = None + """true if the volume is extractable, false otherwise""" + self.isextractable = None + """max iops of the disk volume""" + self.maxiops = None + """min iops of the disk volume""" + self.miniops = None + """name of the disk volume""" + self.name = None + """The path of the volume""" + self.path = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the display text of the service offering for root disk""" + self.serviceofferingdisplaytext = None + """ID of the service offering for root disk""" + self.serviceofferingid = None + """name of the service offering for root disk""" + self.serviceofferingname = None + """size of the disk volume""" + self.size = None + """ID of the snapshot from which this volume was created""" + self.snapshotid = None + """the state of the disk volume""" + self.state = None + """the status of the volume""" + self.status = None + """name of the primary storage hosting the disk volume""" + self.storage = None + """id of the primary storage hosting the disk volume; returned to admin user only""" + self.storageid = None + """shared or local storage""" + self.storagetype = None + """type of the disk volume (ROOT or DATADISK)""" + self.type = None + """id of the virtual machine""" + self.virtualmachineid = None + """display name of the virtual machine""" + self.vmdisplayname = None + """name of the virtual machine""" + self.vmname = None + """state of the virtual machine""" + self.vmstate = None + """ID of the availability zone""" + self.zoneid = None + """name of the availability zone""" + self.zonename = None + """the list of resource tags associated with volume""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/prepareHostForMaintenance.py b/tools/marvin/build/lib/marvin/cloudstackAPI/prepareHostForMaintenance.py new file mode 100644 index 00000000000..4e36902b4c6 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/prepareHostForMaintenance.py @@ -0,0 +1,122 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Prepares a host for maintenance.""" +from baseCmd import * +from baseResponse import * +class prepareHostForMaintenanceCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the host ID""" + """Required""" + self.id = None + self.required = ["id",] + +class prepareHostForMaintenanceResponse (baseResponse): + def __init__(self): + """the ID of the host""" + self.id = None + """the cpu average load on the host""" + self.averageload = None + """capabilities of the host""" + self.capabilities = None + """the cluster ID of the host""" + self.clusterid = None + """the cluster name of the host""" + self.clustername = None + """the cluster type of the cluster that host belongs to""" + self.clustertype = None + """the amount of the host's CPU currently allocated""" + self.cpuallocated = None + """the CPU number of the host""" + self.cpunumber = None + """the CPU speed of the host""" + self.cpuspeed = None + """the amount of the host's CPU currently used""" + self.cpuused = None + """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" + self.cpuwithoverprovisioning = None + """the date and time the host was created""" + self.created = None + """true if the host is disconnected. False otherwise.""" + self.disconnected = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the host""" + self.disksizetotal = None + """events available for the host""" + self.events = None + """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" + self.hahost = None + """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" + self.hasenoughcapacity = None + """comma-separated list of tags for the host""" + self.hosttags = None + """the host hypervisor""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the IP address of the host""" + self.ipaddress = None + """true if local storage is active, false otherwise""" + self.islocalstorageactive = None + """the date and time the host was last pinged""" + self.lastpinged = None + """the management server ID of the host""" + self.managementserverid = None + """the amount of the host's memory currently allocated""" + self.memoryallocated = None + """the memory total of the host""" + self.memorytotal = None + """the amount of the host's memory currently used""" + self.memoryused = None + """the name of the host""" + self.name = None + """the incoming network traffic on the host""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the OS category ID of the host""" + self.oscategoryid = None + """the OS category name of the host""" + self.oscategoryname = None + """the Pod ID of the host""" + self.podid = None + """the Pod name of the host""" + self.podname = None + """the date and time the host was removed""" + self.removed = None + """the resource state of the host""" + self.resourcestate = None + """the state of the host""" + self.state = None + """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" + self.suitableformigration = None + """the host type""" + self.type = None + """the host version""" + self.version = None + """the Zone ID of the host""" + self.zoneid = None + """the Zone name of the host""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/prepareTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/prepareTemplate.py new file mode 100644 index 00000000000..05a5827c57f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/prepareTemplate.py @@ -0,0 +1,134 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""load template into primary storage""" +from baseCmd import * +from baseResponse import * +class prepareTemplateCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """template ID of the template to be prepared in primary storage(s).""" + """Required""" + self.templateid = None + """zone ID of the template to be prepared in primary storage(s).""" + """Required""" + self.zoneid = None + self.required = ["templateid","zoneid",] + +class prepareTemplateResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/queryAsyncJobResult.py b/tools/marvin/build/lib/marvin/cloudstackAPI/queryAsyncJobResult.py new file mode 100644 index 00000000000..c3396b52e26 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/queryAsyncJobResult.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Retrieves the current status of asynchronous job.""" +from baseCmd import * +from baseResponse import * +class queryAsyncJobResultCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the asychronous job""" + """Required""" + self.jobid = None + self.required = ["jobid",] + +class queryAsyncJobResultResponse (baseResponse): + def __init__(self): + """the account that executed the async command""" + self.accountid = None + """the async command executed""" + self.cmd = None + """the created date of the job""" + self.created = None + """the unique ID of the instance/entity object related to the job""" + self.jobinstanceid = None + """the instance/entity object related to the job""" + self.jobinstancetype = None + """the progress information of the PENDING job""" + self.jobprocstatus = None + """the result reason""" + self.jobresult = None + """the result code for the job""" + self.jobresultcode = None + """the result type""" + self.jobresulttype = None + """the current job status-should be 0 for PENDING""" + self.jobstatus = None + """the user that executed the async command""" + self.userid = None + """the ID of the async job""" + self.jobid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootRouter.py new file mode 100644 index 00000000000..ad29a576f75 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootRouter.py @@ -0,0 +1,151 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Starts a router.""" +from baseCmd import * +from baseResponse import * +class rebootRouterCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the router""" + """Required""" + self.id = None + self.required = ["id",] + +class rebootRouterResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootSystemVm.py new file mode 100644 index 00000000000..871a1fee81d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootSystemVm.py @@ -0,0 +1,86 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Reboots a system VM.""" +from baseCmd import * +from baseResponse import * +class rebootSystemVmCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the system virtual machine""" + """Required""" + self.id = None + self.required = ["id",] + +class rebootSystemVmResponse (baseResponse): + def __init__(self): + """the ID of the system VM""" + self.id = None + """the number of active console sessions for the console proxy system vm""" + self.activeviewersessions = None + """the date and time the system VM was created""" + self.created = None + """the first DNS for the system VM""" + self.dns1 = None + """the second DNS for the system VM""" + self.dns2 = None + """the gateway for the system VM""" + self.gateway = None + """the host ID for the system VM""" + self.hostid = None + """the hostname for the system VM""" + self.hostname = None + """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobid = None + """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobstatus = None + """the link local IP address for the system vm""" + self.linklocalip = None + """the link local MAC address for the system vm""" + self.linklocalmacaddress = None + """the link local netmask for the system vm""" + self.linklocalnetmask = None + """the name of the system VM""" + self.name = None + """the network domain for the system VM""" + self.networkdomain = None + """the Pod ID for the system VM""" + self.podid = None + """the private IP address for the system VM""" + self.privateip = None + """the private MAC address for the system VM""" + self.privatemacaddress = None + """the private netmask for the system VM""" + self.privatenetmask = None + """the public IP address for the system VM""" + self.publicip = None + """the public MAC address for the system VM""" + self.publicmacaddress = None + """the public netmask for the system VM""" + self.publicnetmask = None + """the state of the system VM""" + self.state = None + """the system VM type""" + self.systemvmtype = None + """the template ID for the system VM""" + self.templateid = None + """the Zone ID for the system VM""" + self.zoneid = None + """the Zone name for the system VM""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootVirtualMachine.py new file mode 100644 index 00000000000..265e8282af7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootVirtualMachine.py @@ -0,0 +1,369 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Reboots a virtual machine.""" +from baseCmd import * +from baseResponse import * +class rebootVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.id = None + self.required = ["id",] + +class rebootVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/reconnectHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/reconnectHost.py new file mode 100644 index 00000000000..3d65772cb22 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/reconnectHost.py @@ -0,0 +1,122 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Reconnects a host.""" +from baseCmd import * +from baseResponse import * +class reconnectHostCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the host ID""" + """Required""" + self.id = None + self.required = ["id",] + +class reconnectHostResponse (baseResponse): + def __init__(self): + """the ID of the host""" + self.id = None + """the cpu average load on the host""" + self.averageload = None + """capabilities of the host""" + self.capabilities = None + """the cluster ID of the host""" + self.clusterid = None + """the cluster name of the host""" + self.clustername = None + """the cluster type of the cluster that host belongs to""" + self.clustertype = None + """the amount of the host's CPU currently allocated""" + self.cpuallocated = None + """the CPU number of the host""" + self.cpunumber = None + """the CPU speed of the host""" + self.cpuspeed = None + """the amount of the host's CPU currently used""" + self.cpuused = None + """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" + self.cpuwithoverprovisioning = None + """the date and time the host was created""" + self.created = None + """true if the host is disconnected. False otherwise.""" + self.disconnected = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the host""" + self.disksizetotal = None + """events available for the host""" + self.events = None + """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" + self.hahost = None + """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" + self.hasenoughcapacity = None + """comma-separated list of tags for the host""" + self.hosttags = None + """the host hypervisor""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the IP address of the host""" + self.ipaddress = None + """true if local storage is active, false otherwise""" + self.islocalstorageactive = None + """the date and time the host was last pinged""" + self.lastpinged = None + """the management server ID of the host""" + self.managementserverid = None + """the amount of the host's memory currently allocated""" + self.memoryallocated = None + """the memory total of the host""" + self.memorytotal = None + """the amount of the host's memory currently used""" + self.memoryused = None + """the name of the host""" + self.name = None + """the incoming network traffic on the host""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the OS category ID of the host""" + self.oscategoryid = None + """the OS category name of the host""" + self.oscategoryname = None + """the Pod ID of the host""" + self.podid = None + """the Pod name of the host""" + self.podname = None + """the date and time the host was removed""" + self.removed = None + """the resource state of the host""" + self.resourcestate = None + """the state of the host""" + self.state = None + """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" + self.suitableformigration = None + """the host type""" + self.type = None + """the host version""" + self.version = None + """the Zone ID of the host""" + self.zoneid = None + """the Zone name of the host""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/recoverVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/recoverVirtualMachine.py new file mode 100644 index 00000000000..969baa83d3a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/recoverVirtualMachine.py @@ -0,0 +1,369 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Recovers a virtual machine.""" +from baseCmd import * +from baseResponse import * +class recoverVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """The ID of the virtual machine""" + """Required""" + self.id = None + self.required = ["id",] + +class recoverVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/registerIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/registerIso.py new file mode 100644 index 00000000000..3303e83d457 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/registerIso.py @@ -0,0 +1,162 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Registers an existing ISO into the CloudStack Cloud.""" +from baseCmd import * +from baseResponse import * +class registerIsoCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the display text of the ISO. This is usually used for display purposes.""" + """Required""" + self.displaytext = None + """the name of the ISO""" + """Required""" + self.name = None + """the URL to where the ISO is currently being hosted""" + """Required""" + self.url = None + """the ID of the zone you wish to register the ISO to.""" + """Required""" + self.zoneid = None + """an optional account name. Must be used with domainId.""" + self.account = None + """true if this ISO is bootable. If not passed explicitly its assumed to be true""" + self.bootable = None + """the MD5 checksum value of this ISO""" + self.checksum = None + """an optional domainId. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """Image store uuid""" + self.imagestoreuuid = None + """true if iso contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the iso or its derivatives are extractable; default is false""" + self.isextractable = None + """true if you want this ISO to be featured""" + self.isfeatured = None + """true if you want to register the ISO to be publicly available to all users, false otherwise.""" + self.ispublic = None + """the ID of the OS Type that best represents the OS of this ISO. If the iso is bootable this parameter needs to be passed""" + self.ostypeid = None + """Register iso for the project""" + self.projectid = None + self.required = ["displaytext","name","url","zoneid",] + +class registerIsoResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/registerSSHKeyPair.py b/tools/marvin/build/lib/marvin/cloudstackAPI/registerSSHKeyPair.py new file mode 100644 index 00000000000..264c603af73 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/registerSSHKeyPair.py @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Register a public key in a keypair under a certain name""" +from baseCmd import * +from baseResponse import * +class registerSSHKeyPairCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Name of the keypair""" + """Required""" + self.name = None + """Public key material of the keypair""" + """Required""" + self.publickey = None + """an optional account for the ssh key. Must be used with domainId.""" + self.account = None + """an optional domainId for the ssh key. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """an optional project for the ssh key""" + self.projectid = None + self.required = ["name","publickey",] + +class registerSSHKeyPairResponse (baseResponse): + def __init__(self): + """Fingerprint of the public key""" + self.fingerprint = None + """Name of the keypair""" + self.name = None + """Private key""" + self.privatekey = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/registerTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/registerTemplate.py new file mode 100644 index 00000000000..83393ce8913 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/registerTemplate.py @@ -0,0 +1,179 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Registers an existing template into the CloudStack cloud.""" +from baseCmd import * +from baseResponse import * +class registerTemplateCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the display text of the template. This is usually used for display purposes.""" + """Required""" + self.displaytext = None + """the format for the template. Possible values include QCOW2, RAW, and VHD.""" + """Required""" + self.format = None + """the target hypervisor for the template""" + """Required""" + self.hypervisor = None + """the name of the template""" + """Required""" + self.name = None + """the ID of the OS Type that best represents the OS of this template.""" + """Required""" + self.ostypeid = None + """the URL of where the template is hosted. Possible URL include http:// and https://""" + """Required""" + self.url = None + """the ID of the zone the template is to be hosted on""" + """Required""" + self.zoneid = None + """an optional accountName. Must be used with domainId.""" + self.account = None + """32 or 64 bits support. 64 by default""" + self.bits = None + """the MD5 checksum value of this template""" + self.checksum = None + """Template details in key/value pairs.""" + self.details = [] + """an optional domainId. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template or its derivatives are extractable; default is false""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if the template is available to all accounts; default is true""" + self.ispublic = None + """true if the template type is routing i.e., if template is used to deploy router""" + self.isrouting = None + """true if the template supports the password reset feature; default is false""" + self.passwordenabled = None + """Register template for the project""" + self.projectid = None + """true if this template requires HVM""" + self.requireshvm = None + """true if the template supports the sshkey upload feature; default is false""" + self.sshkeyenabled = None + """the tag for this template.""" + self.templatetag = None + self.required = ["displaytext","format","hypervisor","name","ostypeid","url","zoneid",] + +class registerTemplateResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/registerUserKeys.py b/tools/marvin/build/lib/marvin/cloudstackAPI/registerUserKeys.py new file mode 100644 index 00000000000..6044b6a105d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/registerUserKeys.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user""" +from baseCmd import * +from baseResponse import * +class registerUserKeysCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """User id""" + """Required""" + self.id = None + self.required = ["id",] + +class registerUserKeysResponse (baseResponse): + def __init__(self): + """the api key of the registered user""" + self.apikey = None + """the secret key of the registered user""" + self.secretkey = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedCluster.py new file mode 100644 index 00000000000..4354f6b6a53 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedCluster.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Release the dedication for cluster""" +from baseCmd import * +from baseResponse import * +class releaseDedicatedClusterCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the Cluster""" + """Required""" + self.clusterid = None + self.required = ["clusterid",] + +class releaseDedicatedClusterResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedGuestVlanRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedGuestVlanRange.py new file mode 100644 index 00000000000..b2f84011c45 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedGuestVlanRange.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Releases a dedicated guest vlan range to the system""" +from baseCmd import * +from baseResponse import * +class releaseDedicatedGuestVlanRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the dedicated guest vlan range""" + """Required""" + self.id = None + self.required = ["id",] + +class releaseDedicatedGuestVlanRangeResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedHost.py new file mode 100644 index 00000000000..680cd4599d9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedHost.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Release the dedication for host""" +from baseCmd import * +from baseResponse import * +class releaseDedicatedHostCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the host""" + """Required""" + self.hostid = None + self.required = ["hostid",] + +class releaseDedicatedHostResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedPod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedPod.py new file mode 100644 index 00000000000..2993ed7c59c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedPod.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Release the dedication for the pod""" +from baseCmd import * +from baseResponse import * +class releaseDedicatedPodCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the Pod""" + """Required""" + self.podid = None + self.required = ["podid",] + +class releaseDedicatedPodResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedZone.py new file mode 100644 index 00000000000..0f895c0d3f5 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedZone.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Release dedication of zone""" +from baseCmd import * +from baseResponse import * +class releaseDedicatedZoneCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the Zone""" + """Required""" + self.zoneid = None + self.required = ["zoneid",] + +class releaseDedicatedZoneResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseHostReservation.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseHostReservation.py new file mode 100644 index 00000000000..56626a580d5 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseHostReservation.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Releases host reservation.""" +from baseCmd import * +from baseResponse import * +class releaseHostReservationCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the host ID""" + """Required""" + self.id = None + self.required = ["id",] + +class releaseHostReservationResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releasePublicIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releasePublicIpRange.py new file mode 100644 index 00000000000..02f2a60e293 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/releasePublicIpRange.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Releases a Public IP range back to the system pool""" +from baseCmd import * +from baseResponse import * +class releasePublicIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the id of the Public IP range""" + """Required""" + self.id = None + self.required = ["id",] + +class releasePublicIpRangeResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromGlobalLoadBalancerRule.py new file mode 100644 index 00000000000..b3efe409fc0 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromGlobalLoadBalancerRule.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Removes a load balancer rule association with global load balancer rule""" +from baseCmd import * +from baseResponse import * +class removeFromGlobalLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the load balancer rule""" + """Required""" + self.id = None + """the list load balancer rules that will be assigned to gloabal load balacner rule""" + """Required""" + self.loadbalancerrulelist = [] + self.required = ["id","loadbalancerrulelist",] + +class removeFromGlobalLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromLoadBalancerRule.py new file mode 100644 index 00000000000..ed1a714633e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromLoadBalancerRule.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Removes a virtual machine or a list of virtual machines from a load balancer rule.""" +from baseCmd import * +from baseResponse import * +class removeFromLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the load balancer rule""" + """Required""" + self.id = None + """the list of IDs of the virtual machines that are being removed from the load balancer rule (i.e. virtualMachineIds=1,2,3)""" + """Required""" + self.virtualmachineids = [] + self.required = ["id","virtualmachineids",] + +class removeFromLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeIpFromNic.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeIpFromNic.py new file mode 100644 index 00000000000..dfe2ef27417 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/removeIpFromNic.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Assigns secondary IP to NIC.""" +from baseCmd import * +from baseResponse import * +class removeIpFromNicCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the secondary ip address to nic""" + """Required""" + self.id = None + self.required = ["id",] + +class removeIpFromNicResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeNicFromVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeNicFromVirtualMachine.py new file mode 100644 index 00000000000..8c13453c04c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/removeNicFromVirtualMachine.py @@ -0,0 +1,372 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Removes VM from specified network by deleting a NIC""" +from baseCmd import * +from baseResponse import * +class removeNicFromVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """NIC ID""" + """Required""" + self.nicid = None + """Virtual Machine ID""" + """Required""" + self.virtualmachineid = None + self.required = ["nicid","virtualmachineid",] + +class removeNicFromVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeRegion.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeRegion.py new file mode 100644 index 00000000000..101d51c209e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/removeRegion.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Removes specified region""" +from baseCmd import * +from baseResponse import * +class removeRegionCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """ID of the region to delete""" + """Required""" + self.id = None + self.required = ["id",] + +class removeRegionResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeResourceDetail.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeResourceDetail.py new file mode 100644 index 00000000000..7d97028d48e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/removeResourceDetail.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Removes detail for the Resource.""" +from baseCmd import * +from baseResponse import * +class removeResourceDetailCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Delete details for resource id""" + """Required""" + self.resourceid = None + """Delete detail by resource type""" + """Required""" + self.resourcetype = None + """Delete details matching key/value pairs""" + self.key = None + self.required = ["resourceid","resourcetype",] + +class removeResourceDetailResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeVpnUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeVpnUser.py new file mode 100644 index 00000000000..01ff16709cc --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/removeVpnUser.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Removes vpn user""" +from baseCmd import * +from baseResponse import * +class removeVpnUserCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """username for the vpn user""" + """Required""" + self.username = None + """an optional account for the vpn user. Must be used with domainId.""" + self.account = None + """an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """remove vpn user from the project""" + self.projectid = None + self.required = ["username",] + +class removeVpnUserResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/replaceNetworkACLList.py b/tools/marvin/build/lib/marvin/cloudstackAPI/replaceNetworkACLList.py new file mode 100644 index 00000000000..658366d794e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/replaceNetworkACLList.py @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Replaces ACL associated with a Network or private gateway""" +from baseCmd import * +from baseResponse import * +class replaceNetworkACLListCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the network ACL""" + """Required""" + self.aclid = None + """the ID of the private gateway""" + self.gatewayid = None + """the ID of the network""" + self.networkid = None + self.required = ["aclid",] + +class replaceNetworkACLListResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resetApiLimit.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resetApiLimit.py new file mode 100644 index 00000000000..595f97b8769 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/resetApiLimit.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Reset api count""" +from baseCmd import * +from baseResponse import * +class resetApiLimitCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the acount whose limit to be reset""" + self.account = None + self.required = [] + +class resetApiLimitResponse (baseResponse): + def __init__(self): + """the account name of the api remaining count""" + self.account = None + """the account uuid of the api remaining count""" + self.accountid = None + """currently allowed number of apis""" + self.apiAllowed = None + """number of api already issued""" + self.apiIssued = None + """seconds left to reset counters""" + self.expireAfter = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resetPasswordForVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resetPasswordForVirtualMachine.py new file mode 100644 index 00000000000..28953236e8d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/resetPasswordForVirtualMachine.py @@ -0,0 +1,369 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Resets the password for virtual machine. The virtual machine must be in a "Stopped" state and the template must already support this feature for this command to take effect. [async]""" +from baseCmd import * +from baseResponse import * +class resetPasswordForVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.id = None + self.required = ["id",] + +class resetPasswordForVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resetSSHKeyForVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resetSSHKeyForVirtualMachine.py new file mode 100644 index 00000000000..fa8ba4ecc0a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/resetSSHKeyForVirtualMachine.py @@ -0,0 +1,378 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Resets the SSH Key for virtual machine. The virtual machine must be in a "Stopped" state. [async]""" +from baseCmd import * +from baseResponse import * +class resetSSHKeyForVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.id = None + """name of the ssh key pair used to login to the virtual machine""" + """Required""" + self.keypair = None + """an optional account for the ssh key. Must be used with domainId.""" + self.account = None + """an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """an optional project for the ssh key""" + self.projectid = None + self.required = ["id","keypair",] + +class resetSSHKeyForVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resetVpnConnection.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resetVpnConnection.py new file mode 100644 index 00000000000..b378b0cef0e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/resetVpnConnection.py @@ -0,0 +1,76 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Reset site to site vpn connection""" +from baseCmd import * +from baseResponse import * +class resetVpnConnectionCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of vpn connection""" + """Required""" + self.id = None + """an optional account for connection. Must be used with domainId.""" + self.account = None + """an optional domainId for connection. If the account parameter is used, domainId must also be used.""" + self.domainid = None + self.required = ["id",] + +class resetVpnConnectionResponse (baseResponse): + def __init__(self): + """the vpn gateway ID""" + self.id = None + """the owner""" + self.account = None + """guest cidr list of the customer gateway""" + self.cidrlist = None + """the date and time the host was created""" + self.created = None + """the domain name of the owner""" + self.domain = None + """the domain id of the owner""" + self.domainid = None + """if DPD is enabled for customer gateway""" + self.dpd = None + """Lifetime of ESP SA of customer gateway""" + self.esplifetime = None + """ESP policy of the customer gateway""" + self.esppolicy = None + """public ip address id of the customer gateway""" + self.gateway = None + """Lifetime of IKE SA of customer gateway""" + self.ikelifetime = None + """IKE policy of the customer gateway""" + self.ikepolicy = None + """IPsec Preshared-Key of the customer gateway""" + self.ipsecpsk = None + """the project name""" + self.project = None + """the project id""" + self.projectid = None + """the public IP address""" + self.publicip = None + """the date and time the host was removed""" + self.removed = None + """the customer gateway ID""" + self.s2scustomergatewayid = None + """the vpn gateway ID""" + self.s2svpngatewayid = None + """State of vpn connection""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resizeVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resizeVolume.py new file mode 100644 index 00000000000..f63437c6942 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/resizeVolume.py @@ -0,0 +1,148 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Resizes a volume""" +from baseCmd import * +from baseResponse import * +class resizeVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """new disk offering id""" + self.diskofferingid = None + """the ID of the disk volume""" + self.id = None + """Verify OK to Shrink""" + self.shrinkok = None + """New volume size in G""" + self.size = None + self.required = [] + +class resizeVolumeResponse (baseResponse): + def __init__(self): + """ID of the disk volume""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the date the volume was attached to a VM instance""" + self.attached = None + """the date the disk volume was created""" + self.created = None + """the boolean state of whether the volume is destroyed or not""" + self.destroyed = None + """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" + self.deviceid = None + """bytes read rate of the disk volume""" + self.diskBytesReadRate = None + """bytes write rate of the disk volume""" + self.diskBytesWriteRate = None + """io requests read rate of the disk volume""" + self.diskIopsReadRate = None + """io requests write rate of the disk volume""" + self.diskIopsWriteRate = None + """the display text of the disk offering""" + self.diskofferingdisplaytext = None + """ID of the disk offering""" + self.diskofferingid = None + """name of the disk offering""" + self.diskofferingname = None + """an optional field whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """Hypervisor the volume belongs to""" + self.hypervisor = None + """true if the volume is extractable, false otherwise""" + self.isextractable = None + """max iops of the disk volume""" + self.maxiops = None + """min iops of the disk volume""" + self.miniops = None + """name of the disk volume""" + self.name = None + """The path of the volume""" + self.path = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the display text of the service offering for root disk""" + self.serviceofferingdisplaytext = None + """ID of the service offering for root disk""" + self.serviceofferingid = None + """name of the service offering for root disk""" + self.serviceofferingname = None + """size of the disk volume""" + self.size = None + """ID of the snapshot from which this volume was created""" + self.snapshotid = None + """the state of the disk volume""" + self.state = None + """the status of the volume""" + self.status = None + """name of the primary storage hosting the disk volume""" + self.storage = None + """id of the primary storage hosting the disk volume; returned to admin user only""" + self.storageid = None + """shared or local storage""" + self.storagetype = None + """type of the disk volume (ROOT or DATADISK)""" + self.type = None + """id of the virtual machine""" + self.virtualmachineid = None + """display name of the virtual machine""" + self.vmdisplayname = None + """name of the virtual machine""" + self.vmname = None + """state of the virtual machine""" + self.vmstate = None + """ID of the availability zone""" + self.zoneid = None + """name of the availability zone""" + self.zonename = None + """the list of resource tags associated with volume""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/restartNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/restartNetwork.py new file mode 100644 index 00000000000..9a8eb1af4c7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/restartNetwork.py @@ -0,0 +1,119 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules""" +from baseCmd import * +from baseResponse import * +class restartNetworkCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The id of the network to restart.""" + """Required""" + self.id = None + """If cleanup old network elements""" + self.cleanup = None + self.required = ["id",] + +class restartNetworkResponse (baseResponse): + def __init__(self): + """public IP address id""" + self.id = None + """the account the public IP address is associated with""" + self.account = None + """date the public IP address was acquired""" + self.allocated = None + """the ID of the Network associated with the IP address""" + self.associatednetworkid = None + """the name of the Network associated with the IP address""" + self.associatednetworkname = None + """the domain the public IP address is associated with""" + self.domain = None + """the domain ID the public IP address is associated with""" + self.domainid = None + """the virtual network for the IP address""" + self.forvirtualnetwork = None + """public IP address""" + self.ipaddress = None + """is public IP portable across the zones""" + self.isportable = None + """true if the IP address is a source nat address, false otherwise""" + self.issourcenat = None + """true if this ip is for static nat, false otherwise""" + self.isstaticnat = None + """true if this ip is system ip (was allocated as a part of deployVm or createLbRule)""" + self.issystem = None + """the ID of the Network where ip belongs to""" + self.networkid = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value""" + self.purpose = None + """State of the ip address. Can be: Allocatin, Allocated and Releasing""" + self.state = None + """virutal machine display name the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachinedisplayname = None + """virutal machine id the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachineid = None + """virutal machine name the ip address is assigned to (not null only for static nat Ip)""" + self.virtualmachinename = None + """the ID of the VLAN associated with the IP address. This parameter is visible to ROOT admins only""" + self.vlanid = None + """the VLAN associated with the IP address""" + self.vlanname = None + """virutal machine (dnat) ip address (not null only for static nat Ip)""" + self.vmipaddress = None + """VPC the ip belongs to""" + self.vpcid = None + """the ID of the zone the public IP address belongs to""" + self.zoneid = None + """the name of the zone the public IP address belongs to""" + self.zonename = None + """the list of resource tags associated with ip address""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/restartVPC.py b/tools/marvin/build/lib/marvin/cloudstackAPI/restartVPC.py new file mode 100644 index 00000000000..152e64f2539 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/restartVPC.py @@ -0,0 +1,393 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Restarts a VPC""" +from baseCmd import * +from baseResponse import * +class restartVPCCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the id of the VPC""" + """Required""" + self.id = None + self.required = ["id",] + +class restartVPCResponse (baseResponse): + def __init__(self): + """the id of the VPC""" + self.id = None + """the owner of the VPC""" + self.account = None + """the cidr the VPC""" + self.cidr = None + """the date this VPC was created""" + self.created = None + """an alternate display text of the VPC.""" + self.displaytext = None + """the domain name of the owner""" + self.domain = None + """the domain id of the VPC owner""" + self.domainid = None + """the name of the VPC""" + self.name = None + """the network domain of the VPC""" + self.networkdomain = None + """the project name of the VPC""" + self.project = None + """the project id of the VPC""" + self.projectid = None + """true VPC requires restart""" + self.restartrequired = None + """state of the VPC. Can be Inactive/Enabled""" + self.state = None + """vpc offering id the VPC is created from""" + self.vpcofferingid = None + """zone id of the vpc""" + self.zoneid = None + """the name of the zone the VPC belongs to""" + self.zonename = None + """the list of networks belongign to the VPC""" + self.network = [] + """the list of supported services""" + self.service = [] + """the list of resource tags associated with the project""" + self.tags = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class network: + def __init__(self): + """"the id of the network""" + self.id = None + """"the owner of the network""" + self.account = None + """"ACL Id associated with the VPC network""" + self.aclid = None + """"acl type - access type to the network""" + self.acltype = None + """"Broadcast domain type of the network""" + self.broadcastdomaintype = None + """"broadcast uri of the network. This parameter is visible to ROOT admins only""" + self.broadcasturi = None + """"list networks available for vm deployment""" + self.canusefordeploy = None + """"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" + self.cidr = None + """"an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """"the displaytext of the network""" + self.displaytext = None + """"the first DNS for the network""" + self.dns1 = None + """"the second DNS for the network""" + self.dns2 = None + """"the domain name of the network owner""" + self.domain = None + """"the domain id of the network owner""" + self.domainid = None + """"the network's gateway""" + self.gateway = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"true if network is default, false otherwise""" + self.isdefault = None + """"list networks that are persistent""" + self.ispersistent = None + """"true if network is system, false otherwise""" + self.issystem = None + """"the name of the network""" + self.name = None + """"the network's netmask""" + self.netmask = None + """"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" + self.networkcidr = None + """"the network domain""" + self.networkdomain = None + """"availability of the network offering the network is created from""" + self.networkofferingavailability = None + """"true if network offering is ip conserve mode enabled""" + self.networkofferingconservemode = None + """"display text of the network offering the network is created from""" + self.networkofferingdisplaytext = None + """"network offering id the network is created from""" + self.networkofferingid = None + """"name of the network offering the network is created from""" + self.networkofferingname = None + """"the physical network id""" + self.physicalnetworkid = None + """"the project name of the address""" + self.project = None + """"the project id of the ipaddress""" + self.projectid = None + """"related to what other network configuration""" + self.related = None + """"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" + self.reservediprange = None + """"true network requires restart""" + self.restartrequired = None + """"true if network supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """"state of the network""" + self.state = None + """"true if users from subdomains can access the domain level network""" + self.subdomainaccess = None + """"the traffic type of the network""" + self.traffictype = None + """"the type of the network""" + self.type = None + """"The vlan of the network. This parameter is visible to ROOT admins only""" + self.vlan = None + """"VPC the network belongs to""" + self.vpcid = None + """"zone id of the network""" + self.zoneid = None + """"the name of the zone the network belongs to""" + self.zonename = None + """"the list of services""" + self.service = [] + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + """"the list of resource tags associated with network""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/restoreVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/restoreVirtualMachine.py new file mode 100644 index 00000000000..e22f6c80327 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/restoreVirtualMachine.py @@ -0,0 +1,371 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Restore a VM to original template/ISO or new template/ISO""" +from baseCmd import * +from baseResponse import * +class restoreVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """Virtual Machine ID""" + """Required""" + self.virtualmachineid = None + """an optional template Id to restore vm from the new template. This can be an ISO id in case of restore vm deployed using ISO""" + self.templateid = None + self.required = ["virtualmachineid",] + +class restoreVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/revertSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/revertSnapshot.py new file mode 100644 index 00000000000..e8ba5324a93 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/revertSnapshot.py @@ -0,0 +1,91 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""revert a volume snapshot.""" +from baseCmd import * +from baseResponse import * +class revertSnapshotCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the snapshot""" + """Required""" + self.id = None + self.required = ["id",] + +class revertSnapshotResponse (baseResponse): + def __init__(self): + """ID of the snapshot""" + self.id = None + """the account associated with the snapshot""" + self.account = None + """the date the snapshot was created""" + self.created = None + """the domain name of the snapshot's account""" + self.domain = None + """the domain ID of the snapshot's account""" + self.domainid = None + """valid types are hourly, daily, weekly, monthy, template, and none.""" + self.intervaltype = None + """name of the snapshot""" + self.name = None + """the project name of the snapshot""" + self.project = None + """the project id of the snapshot""" + self.projectid = None + """the type of the snapshot""" + self.snapshottype = None + """the state of the snapshot. BackedUp means that snapshot is ready to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp - the snapshot is being backed up on secondary storage""" + self.state = None + """ID of the disk volume""" + self.volumeid = None + """name of the disk volume""" + self.volumename = None + """type of the disk volume""" + self.volumetype = None + """id of the availability zone""" + self.zoneid = None + """the list of resource tags associated with snapshot""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/revertToVMSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/revertToVMSnapshot.py new file mode 100644 index 00000000000..394ecba5957 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/revertToVMSnapshot.py @@ -0,0 +1,369 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Revert VM from a vmsnapshot.""" +from baseCmd import * +from baseResponse import * +class revertToVMSnapshotCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the vm snapshot""" + """Required""" + self.vmsnapshotid = None + self.required = ["vmsnapshotid",] + +class revertToVMSnapshotResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupEgress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupEgress.py new file mode 100644 index 00000000000..90d8753cfca --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupEgress.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a particular egress rule from this security group""" +from baseCmd import * +from baseResponse import * +class revokeSecurityGroupEgressCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the egress rule""" + """Required""" + self.id = None + self.required = ["id",] + +class revokeSecurityGroupEgressResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupIngress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupIngress.py new file mode 100644 index 00000000000..82309abd2d8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupIngress.py @@ -0,0 +1,36 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Deletes a particular ingress rule from this security group""" +from baseCmd import * +from baseResponse import * +class revokeSecurityGroupIngressCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the ingress rule""" + """Required""" + self.id = None + self.required = ["id",] + +class revokeSecurityGroupIngressResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/scaleSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/scaleSystemVm.py new file mode 100644 index 00000000000..56bbba353c9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/scaleSystemVm.py @@ -0,0 +1,89 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Scale the service offering for a system vm (console proxy or secondary storage). The system vm must be in a "Stopped" state for this command to take effect.""" +from baseCmd import * +from baseResponse import * +class scaleSystemVmCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the system vm""" + """Required""" + self.id = None + """the service offering ID to apply to the system vm""" + """Required""" + self.serviceofferingid = None + self.required = ["id","serviceofferingid",] + +class scaleSystemVmResponse (baseResponse): + def __init__(self): + """the ID of the system VM""" + self.id = None + """the number of active console sessions for the console proxy system vm""" + self.activeviewersessions = None + """the date and time the system VM was created""" + self.created = None + """the first DNS for the system VM""" + self.dns1 = None + """the second DNS for the system VM""" + self.dns2 = None + """the gateway for the system VM""" + self.gateway = None + """the host ID for the system VM""" + self.hostid = None + """the hostname for the system VM""" + self.hostname = None + """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobid = None + """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobstatus = None + """the link local IP address for the system vm""" + self.linklocalip = None + """the link local MAC address for the system vm""" + self.linklocalmacaddress = None + """the link local netmask for the system vm""" + self.linklocalnetmask = None + """the name of the system VM""" + self.name = None + """the network domain for the system VM""" + self.networkdomain = None + """the Pod ID for the system VM""" + self.podid = None + """the private IP address for the system VM""" + self.privateip = None + """the private MAC address for the system VM""" + self.privatemacaddress = None + """the private netmask for the system VM""" + self.privatenetmask = None + """the public IP address for the system VM""" + self.publicip = None + """the public MAC address for the system VM""" + self.publicmacaddress = None + """the public netmask for the system VM""" + self.publicnetmask = None + """the state of the system VM""" + self.state = None + """the system VM type""" + self.systemvmtype = None + """the template ID for the system VM""" + self.templateid = None + """the Zone ID for the system VM""" + self.zoneid = None + """the Zone name for the system VM""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/scaleVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/scaleVirtualMachine.py new file mode 100644 index 00000000000..6e0971d7746 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/scaleVirtualMachine.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Scales the virtual machine to a new service offering.""" +from baseCmd import * +from baseResponse import * +class scaleVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.id = None + """the ID of the service offering for the virtual machine""" + """Required""" + self.serviceofferingid = None + self.required = ["id","serviceofferingid",] + +class scaleVirtualMachineResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/startInternalLoadBalancerVM.py b/tools/marvin/build/lib/marvin/cloudstackAPI/startInternalLoadBalancerVM.py new file mode 100644 index 00000000000..26e38c5040e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/startInternalLoadBalancerVM.py @@ -0,0 +1,151 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Starts an existing internal lb vm.""" +from baseCmd import * +from baseResponse import * +class startInternalLoadBalancerVMCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the internal lb vm""" + """Required""" + self.id = None + self.required = ["id",] + +class startInternalLoadBalancerVMResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/startRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/startRouter.py new file mode 100644 index 00000000000..4d3c71080c8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/startRouter.py @@ -0,0 +1,151 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Starts a router.""" +from baseCmd import * +from baseResponse import * +class startRouterCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the router""" + """Required""" + self.id = None + self.required = ["id",] + +class startRouterResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/startSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/startSystemVm.py new file mode 100644 index 00000000000..5764006f57f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/startSystemVm.py @@ -0,0 +1,86 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Starts a system virtual machine.""" +from baseCmd import * +from baseResponse import * +class startSystemVmCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the system virtual machine""" + """Required""" + self.id = None + self.required = ["id",] + +class startSystemVmResponse (baseResponse): + def __init__(self): + """the ID of the system VM""" + self.id = None + """the number of active console sessions for the console proxy system vm""" + self.activeviewersessions = None + """the date and time the system VM was created""" + self.created = None + """the first DNS for the system VM""" + self.dns1 = None + """the second DNS for the system VM""" + self.dns2 = None + """the gateway for the system VM""" + self.gateway = None + """the host ID for the system VM""" + self.hostid = None + """the hostname for the system VM""" + self.hostname = None + """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobid = None + """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobstatus = None + """the link local IP address for the system vm""" + self.linklocalip = None + """the link local MAC address for the system vm""" + self.linklocalmacaddress = None + """the link local netmask for the system vm""" + self.linklocalnetmask = None + """the name of the system VM""" + self.name = None + """the network domain for the system VM""" + self.networkdomain = None + """the Pod ID for the system VM""" + self.podid = None + """the private IP address for the system VM""" + self.privateip = None + """the private MAC address for the system VM""" + self.privatemacaddress = None + """the private netmask for the system VM""" + self.privatenetmask = None + """the public IP address for the system VM""" + self.publicip = None + """the public MAC address for the system VM""" + self.publicmacaddress = None + """the public netmask for the system VM""" + self.publicnetmask = None + """the state of the system VM""" + self.state = None + """the system VM type""" + self.systemvmtype = None + """the template ID for the system VM""" + self.templateid = None + """the Zone ID for the system VM""" + self.zoneid = None + """the Zone name for the system VM""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/startVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/startVirtualMachine.py new file mode 100644 index 00000000000..4fec3975052 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/startVirtualMachine.py @@ -0,0 +1,371 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Starts a virtual machine.""" +from baseCmd import * +from baseResponse import * +class startVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.id = None + """destination Host ID to deploy the VM to - parameter available for root admin only""" + self.hostid = None + self.required = ["id",] + +class startVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/stopInternalLoadBalancerVM.py b/tools/marvin/build/lib/marvin/cloudstackAPI/stopInternalLoadBalancerVM.py new file mode 100644 index 00000000000..8dc6688c6e8 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/stopInternalLoadBalancerVM.py @@ -0,0 +1,153 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Stops an Internal LB vm.""" +from baseCmd import * +from baseResponse import * +class stopInternalLoadBalancerVMCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the internal lb vm""" + """Required""" + self.id = None + """Force stop the VM. The caller knows the VM is stopped.""" + self.forced = None + self.required = ["id",] + +class stopInternalLoadBalancerVMResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/stopRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/stopRouter.py new file mode 100644 index 00000000000..c2c10dfd78c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/stopRouter.py @@ -0,0 +1,153 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Stops a router.""" +from baseCmd import * +from baseResponse import * +class stopRouterCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the router""" + """Required""" + self.id = None + """Force stop the VM. The caller knows the VM is stopped.""" + self.forced = None + self.required = ["id",] + +class stopRouterResponse (baseResponse): + def __init__(self): + """the id of the router""" + self.id = None + """the account associated with the router""" + self.account = None + """the date and time the router was created""" + self.created = None + """the first DNS for the router""" + self.dns1 = None + """the second DNS for the router""" + self.dns2 = None + """the domain associated with the router""" + self.domain = None + """the domain ID associated with the router""" + self.domainid = None + """the gateway for the router""" + self.gateway = None + """the guest IP address for the router""" + self.guestipaddress = None + """the guest MAC address for the router""" + self.guestmacaddress = None + """the guest netmask for the router""" + self.guestnetmask = None + """the ID of the corresponding guest network""" + self.guestnetworkid = None + """the host ID for the router""" + self.hostid = None + """the hostname for the router""" + self.hostname = None + """the first IPv6 DNS for the router""" + self.ip6dns1 = None + """the second IPv6 DNS for the router""" + self.ip6dns2 = None + """if this router is an redundant virtual router""" + self.isredundantrouter = None + """the link local IP address for the router""" + self.linklocalip = None + """the link local MAC address for the router""" + self.linklocalmacaddress = None + """the link local netmask for the router""" + self.linklocalnetmask = None + """the ID of the corresponding link local network""" + self.linklocalnetworkid = None + """the name of the router""" + self.name = None + """the network domain for the router""" + self.networkdomain = None + """the Pod ID for the router""" + self.podid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """the public IP address for the router""" + self.publicip = None + """the public MAC address for the router""" + self.publicmacaddress = None + """the public netmask for the router""" + self.publicnetmask = None + """the ID of the corresponding public network""" + self.publicnetworkid = None + """the state of redundant virtual router""" + self.redundantstate = None + """role of the domain router""" + self.role = None + """the version of scripts""" + self.scriptsversion = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """the state of the router""" + self.state = None + """the template ID for the router""" + self.templateid = None + """the version of template""" + self.templateversion = None + """VPC the router belongs to""" + self.vpcid = None + """the Zone ID for the router""" + self.zoneid = None + """the Zone name for the router""" + self.zonename = None + """the list of nics associated with the router""" + self.nic = [] + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/stopSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/stopSystemVm.py new file mode 100644 index 00000000000..f6990410ff9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/stopSystemVm.py @@ -0,0 +1,88 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Stops a system VM.""" +from baseCmd import * +from baseResponse import * +class stopSystemVmCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the system virtual machine""" + """Required""" + self.id = None + """Force stop the VM. The caller knows the VM is stopped.""" + self.forced = None + self.required = ["id",] + +class stopSystemVmResponse (baseResponse): + def __init__(self): + """the ID of the system VM""" + self.id = None + """the number of active console sessions for the console proxy system vm""" + self.activeviewersessions = None + """the date and time the system VM was created""" + self.created = None + """the first DNS for the system VM""" + self.dns1 = None + """the second DNS for the system VM""" + self.dns2 = None + """the gateway for the system VM""" + self.gateway = None + """the host ID for the system VM""" + self.hostid = None + """the hostname for the system VM""" + self.hostname = None + """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobid = None + """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" + self.jobstatus = None + """the link local IP address for the system vm""" + self.linklocalip = None + """the link local MAC address for the system vm""" + self.linklocalmacaddress = None + """the link local netmask for the system vm""" + self.linklocalnetmask = None + """the name of the system VM""" + self.name = None + """the network domain for the system VM""" + self.networkdomain = None + """the Pod ID for the system VM""" + self.podid = None + """the private IP address for the system VM""" + self.privateip = None + """the private MAC address for the system VM""" + self.privatemacaddress = None + """the private netmask for the system VM""" + self.privatenetmask = None + """the public IP address for the system VM""" + self.publicip = None + """the public MAC address for the system VM""" + self.publicmacaddress = None + """the public netmask for the system VM""" + self.publicnetmask = None + """the state of the system VM""" + self.state = None + """the system VM type""" + self.systemvmtype = None + """the template ID for the system VM""" + self.templateid = None + """the Zone ID for the system VM""" + self.zoneid = None + """the Zone name for the system VM""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/stopVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/stopVirtualMachine.py new file mode 100644 index 00000000000..3965c50f408 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/stopVirtualMachine.py @@ -0,0 +1,371 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Stops a virtual machine.""" +from baseCmd import * +from baseResponse import * +class stopVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.id = None + """Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend). The caller knows the VM is stopped.""" + self.forced = None + self.required = ["id",] + +class stopVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/suspendProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/suspendProject.py new file mode 100644 index 00000000000..898a63e1ea2 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/suspendProject.py @@ -0,0 +1,141 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Suspends a project""" +from baseCmd import * +from baseResponse import * +class suspendProjectCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of the project to be suspended""" + """Required""" + self.id = None + self.required = ["id",] + +class suspendProjectResponse (baseResponse): + def __init__(self): + """the id of the project""" + self.id = None + """the account name of the project's owner""" + self.account = None + """the total number of cpu cores available to be created for this project""" + self.cpuavailable = None + """the total number of cpu cores the project can own""" + self.cpulimit = None + """the total number of cpu cores owned by project""" + self.cputotal = None + """the displaytext of the project""" + self.displaytext = None + """the domain name where the project belongs to""" + self.domain = None + """the domain id the project belongs to""" + self.domainid = None + """the total number of public ip addresses available for this project to acquire""" + self.ipavailable = None + """the total number of public ip addresses this project can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this project""" + self.iptotal = None + """the total memory (in MB) available to be created for this project""" + self.memoryavailable = None + """the total memory (in MB) the project can own""" + self.memorylimit = None + """the total memory (in MB) owned by project""" + self.memorytotal = None + """the name of the project""" + self.name = None + """the total number of networks available to be created for this project""" + self.networkavailable = None + """the total number of networks the project can own""" + self.networklimit = None + """the total number of networks owned by project""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this project""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the project can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by project""" + self.primarystoragetotal = None + """the total secondary storage space (in GiB) available to be used for this project""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the project can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by project""" + self.secondarystoragetotal = None + """the total number of snapshots available for this project""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this project""" + self.snapshotlimit = None + """the total number of snapshots stored by this project""" + self.snapshottotal = None + """the state of the project""" + self.state = None + """the total number of templates available to be created by this project""" + self.templateavailable = None + """the total number of templates which can be created by this project""" + self.templatelimit = None + """the total number of templates which have been created by this project""" + self.templatetotal = None + """the total number of virtual machines available for this project to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this project""" + self.vmlimit = None + """the total number of virtual machines running for this project""" + self.vmrunning = None + """the total number of virtual machines stopped for this project""" + self.vmstopped = None + """the total number of virtual machines deployed by this project""" + self.vmtotal = None + """the total volume available for this project""" + self.volumeavailable = None + """the total volume which can be used by this project""" + self.volumelimit = None + """the total volume being used by this project""" + self.volumetotal = None + """the total number of vpcs available to be created for this project""" + self.vpcavailable = None + """the total number of vpcs the project can own""" + self.vpclimit = None + """the total number of vpcs owned by project""" + self.vpctotal = None + """the list of resource tags associated with vm""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAccount.py new file mode 100644 index 00000000000..aabd811c592 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAccount.py @@ -0,0 +1,183 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates account information for the authenticated user""" +from baseCmd import * +from baseResponse import * +class updateAccountCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """new name for the account""" + """Required""" + self.newname = None + """the current account name""" + self.account = None + """details for account used to store specific parameters""" + self.accountdetails = [] + """the ID of the domain where the account exists""" + self.domainid = None + """Account id""" + self.id = None + """Network domain for the account's networks; empty string will update domainName with NULL value""" + self.networkdomain = None + self.required = ["newname",] + +class updateAccountResponse (baseResponse): + def __init__(self): + """the id of the account""" + self.id = None + """details for the account""" + self.accountdetails = None + """account type (admin, domain-admin, user)""" + self.accounttype = None + """the total number of cpu cores available to be created for this account""" + self.cpuavailable = None + """the total number of cpu cores the account can own""" + self.cpulimit = None + """the total number of cpu cores owned by account""" + self.cputotal = None + """the default zone of the account""" + self.defaultzoneid = None + """name of the Domain the account belongs too""" + self.domain = None + """id of the Domain the account belongs too""" + self.domainid = None + """the total number of public ip addresses available for this account to acquire""" + self.ipavailable = None + """the total number of public ip addresses this account can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this account""" + self.iptotal = None + """true if the account requires cleanup""" + self.iscleanuprequired = None + """true if account is default, false otherwise""" + self.isdefault = None + """the total memory (in MB) available to be created for this account""" + self.memoryavailable = None + """the total memory (in MB) the account can own""" + self.memorylimit = None + """the total memory (in MB) owned by account""" + self.memorytotal = None + """the name of the account""" + self.name = None + """the total number of networks available to be created for this account""" + self.networkavailable = None + """the network domain""" + self.networkdomain = None + """the total number of networks the account can own""" + self.networklimit = None + """the total number of networks owned by account""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this account""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the account can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by account""" + self.primarystoragetotal = None + """the total number of projects available for administration by this account""" + self.projectavailable = None + """the total number of projects the account can own""" + self.projectlimit = None + """the total number of projects being administrated by this account""" + self.projecttotal = None + """the total number of network traffic bytes received""" + self.receivedbytes = None + """the total secondary storage space (in GiB) available to be used for this account""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the account can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by account""" + self.secondarystoragetotal = None + """the total number of network traffic bytes sent""" + self.sentbytes = None + """the total number of snapshots available for this account""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this account""" + self.snapshotlimit = None + """the total number of snapshots stored by this account""" + self.snapshottotal = None + """the state of the account""" + self.state = None + """the total number of templates available to be created by this account""" + self.templateavailable = None + """the total number of templates which can be created by this account""" + self.templatelimit = None + """the total number of templates which have been created by this account""" + self.templatetotal = None + """the total number of virtual machines available for this account to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this account""" + self.vmlimit = None + """the total number of virtual machines running for this account""" + self.vmrunning = None + """the total number of virtual machines stopped for this account""" + self.vmstopped = None + """the total number of virtual machines deployed by this account""" + self.vmtotal = None + """the total volume available for this account""" + self.volumeavailable = None + """the total volume which can be used by this account""" + self.volumelimit = None + """the total volume being used by this account""" + self.volumetotal = None + """the total number of vpcs available to be created for this account""" + self.vpcavailable = None + """the total number of vpcs the account can own""" + self.vpclimit = None + """the total number of vpcs owned by account""" + self.vpctotal = None + """the list of users associated with account""" + self.user = [] + +class user: + def __init__(self): + """"the user ID""" + self.id = None + """"the account name of the user""" + self.account = None + """"the account ID of the user""" + self.accountid = None + """"the account type of the user""" + self.accounttype = None + """"the api key of the user""" + self.apikey = None + """"the date and time the user account was created""" + self.created = None + """"the domain name of the user""" + self.domain = None + """"the domain ID of the user""" + self.domainid = None + """"the user email address""" + self.email = None + """"the user firstname""" + self.firstname = None + """"the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """"true if user is default, false otherwise""" + self.isdefault = None + """"the user lastname""" + self.lastname = None + """"the secret key of the user""" + self.secretkey = None + """"the user state""" + self.state = None + """"the timezone user was created in""" + self.timezone = None + """"the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScalePolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScalePolicy.py new file mode 100644 index 00000000000..752c07c310e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScalePolicy.py @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates an existing autoscale policy.""" +from baseCmd import * +from baseResponse import * +class updateAutoScalePolicyCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the autoscale policy""" + """Required""" + self.id = None + """the list of IDs of the conditions that are being evaluated on every interval""" + self.conditionids = [] + """the duration for which the conditions have to be true before action is taken""" + self.duration = None + """the cool down period for which the policy should not be evaluated after the action has been taken""" + self.quiettime = None + self.required = ["id",] + +class updateAutoScalePolicyResponse (baseResponse): + def __init__(self): + """the autoscale policy ID""" + self.id = None + """the account owning the autoscale policy""" + self.account = None + """the action to be executed if all the conditions evaluate to true for the specified duration.""" + self.action = None + """the list of IDs of the conditions that are being evaluated on every interval""" + self.conditions = None + """the domain name of the autoscale policy""" + self.domain = None + """the domain ID of the autoscale policy""" + self.domainid = None + """the duration for which the conditions have to be true before action is taken""" + self.duration = None + """the project name of the autoscale policy""" + self.project = None + """the project id autoscale policy""" + self.projectid = None + """the cool down period for which the policy should not be evaluated after the action has been taken""" + self.quiettime = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmGroup.py new file mode 100644 index 00000000000..705714eeb82 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmGroup.py @@ -0,0 +1,70 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates an existing autoscale vm group.""" +from baseCmd import * +from baseResponse import * +class updateAutoScaleVmGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the autoscale group""" + """Required""" + self.id = None + """the frequency at which the conditions have to be evaluated""" + self.interval = None + """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" + self.maxmembers = None + """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" + self.minmembers = None + """list of scaledown autoscale policies""" + self.scaledownpolicyids = [] + """list of scaleup autoscale policies""" + self.scaleuppolicyids = [] + self.required = ["id",] + +class updateAutoScaleVmGroupResponse (baseResponse): + def __init__(self): + """the autoscale vm group ID""" + self.id = None + """the account owning the instance group""" + self.account = None + """the domain name of the vm profile""" + self.domain = None + """the domain ID of the vm profile""" + self.domainid = None + """the frequency at which the conditions have to be evaluated""" + self.interval = None + """the load balancer rule ID""" + self.lbruleid = None + """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" + self.maxmembers = None + """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" + self.minmembers = None + """the project name of the vm profile""" + self.project = None + """the project id vm profile""" + self.projectid = None + """list of scaledown autoscale policies""" + self.scaledownpolicies = None + """list of scaleup autoscale policies""" + self.scaleuppolicies = None + """the current state of the AutoScale Vm Group""" + self.state = None + """the autoscale profile that contains information about the vms in the vm group.""" + self.vmprofileid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmProfile.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmProfile.py new file mode 100644 index 00000000000..d733c792f0b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmProfile.py @@ -0,0 +1,64 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates an existing autoscale vm profile.""" +from baseCmd import * +from baseResponse import * +class updateAutoScaleVmProfileCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the autoscale vm profile""" + """Required""" + self.id = None + """the ID of the user used to launch and destroy the VMs""" + self.autoscaleuserid = None + """counterparam list. Example: counterparam[0].name=snmpcommunity&counterparam[0].value=public&counterparam[1].name=snmpport&counterparam[1].value=161""" + self.counterparam = [] + """the time allowed for existing connections to get closed before a vm is destroyed""" + self.destroyvmgraceperiod = None + """the template of the auto deployed virtual machine""" + self.templateid = None + self.required = ["id",] + +class updateAutoScaleVmProfileResponse (baseResponse): + def __init__(self): + """the autoscale vm profile ID""" + self.id = None + """the account owning the instance group""" + self.account = None + """the ID of the user used to launch and destroy the VMs""" + self.autoscaleuserid = None + """the time allowed for existing connections to get closed before a vm is destroyed""" + self.destroyvmgraceperiod = None + """the domain name of the vm profile""" + self.domain = None + """the domain ID of the vm profile""" + self.domainid = None + """parameters other than zoneId/serviceOfferringId/templateId to be used while deploying a virtual machine""" + self.otherdeployparams = None + """the project name of the vm profile""" + self.project = None + """the project id vm profile""" + self.projectid = None + """the service offering to be used while deploying a virtual machine""" + self.serviceofferingid = None + """the template to be used while deploying a virtual machine""" + self.templateid = None + """the availability zone to be used while deploying a virtual machine""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateCluster.py new file mode 100644 index 00000000000..3c1927937ec --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateCluster.py @@ -0,0 +1,91 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates an existing cluster""" +from baseCmd import * +from baseResponse import * +class updateClusterCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the Cluster""" + """Required""" + self.id = None + """Allocation state of this cluster for allocation of new resources""" + self.allocationstate = None + """the cluster name""" + self.clustername = None + """hypervisor type of the cluster""" + self.clustertype = None + """hypervisor type of the cluster""" + self.hypervisor = None + """whether this cluster is managed by cloudstack""" + self.managedstate = None + self.required = ["id",] + +class updateClusterResponse (baseResponse): + def __init__(self): + """the cluster ID""" + self.id = None + """the allocation state of the cluster""" + self.allocationstate = None + """the type of the cluster""" + self.clustertype = None + """The cpu overcommit ratio of the cluster""" + self.cpuovercommitratio = None + """the hypervisor type of the cluster""" + self.hypervisortype = None + """whether this cluster is managed by cloudstack""" + self.managedstate = None + """The memory overcommit ratio of the cluster""" + self.memoryovercommitratio = None + """the cluster name""" + self.name = None + """the Pod ID of the cluster""" + self.podid = None + """the Pod name of the cluster""" + self.podname = None + """the Zone ID of the cluster""" + self.zoneid = None + """the Zone name of the cluster""" + self.zonename = None + """the capacity of the Cluster""" + self.capacity = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateConfiguration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateConfiguration.py new file mode 100644 index 00000000000..6e54ab55afa --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateConfiguration.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a configuration.""" +from baseCmd import * +from baseResponse import * +class updateConfigurationCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the name of the configuration""" + """Required""" + self.name = None + """the ID of the Account to update the parameter value for corresponding account""" + self.accountid = None + """the ID of the Cluster to update the parameter value for corresponding cluster""" + self.clusterid = None + """the ID of the Storage pool to update the parameter value for corresponding storage pool""" + self.storageid = None + """the value of the configuration""" + self.value = None + """the ID of the Zone to update the parameter value for corresponding zone""" + self.zoneid = None + self.required = ["name",] + +class updateConfigurationResponse (baseResponse): + def __init__(self): + """the value of the configuration""" + self.id = None + """the category of the configuration""" + self.category = None + """the description of the configuration""" + self.description = None + """the name of the configuration""" + self.name = None + """scope(zone/cluster/pool/account) of the parameter that needs to be updated""" + self.scope = None + """the value of the configuration""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDefaultNicForVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDefaultNicForVirtualMachine.py new file mode 100644 index 00000000000..1d073edbcd3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDefaultNicForVirtualMachine.py @@ -0,0 +1,372 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Changes the default NIC on a VM""" +from baseCmd import * +from baseResponse import * +class updateDefaultNicForVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """NIC ID""" + """Required""" + self.nicid = None + """Virtual Machine ID""" + """Required""" + self.virtualmachineid = None + self.required = ["nicid","virtualmachineid",] + +class updateDefaultNicForVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDiskOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDiskOffering.py new file mode 100644 index 00000000000..a90dab81ea7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDiskOffering.py @@ -0,0 +1,76 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a disk offering.""" +from baseCmd import * +from baseResponse import * +class updateDiskOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """ID of the disk offering""" + """Required""" + self.id = None + """an optional field, whether to display the offering to the end user or not.""" + self.displayoffering = None + """updates alternate display text of the disk offering with this value""" + self.displaytext = None + """updates name of the disk offering with this value""" + self.name = None + """sort key of the disk offering, integer""" + self.sortkey = None + self.required = ["id",] + +class updateDiskOfferingResponse (baseResponse): + def __init__(self): + """unique ID of the disk offering""" + self.id = None + """the date this disk offering was created""" + self.created = None + """bytes read rate of the disk offering""" + self.diskBytesReadRate = None + """bytes write rate of the disk offering""" + self.diskBytesWriteRate = None + """io requests read rate of the disk offering""" + self.diskIopsReadRate = None + """io requests write rate of the disk offering""" + self.diskIopsWriteRate = None + """the size of the disk offering in GB""" + self.disksize = None + """whether to display the offering to the end user or not.""" + self.displayoffering = None + """an alternate display text of the disk offering.""" + self.displaytext = None + """the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.""" + self.domain = None + """the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.""" + self.domainid = None + """true if disk offering uses custom size, false otherwise""" + self.iscustomized = None + """true if disk offering uses custom iops, false otherwise""" + self.iscustomizediops = None + """the max iops of the disk offering""" + self.maxiops = None + """the min iops of the disk offering""" + self.miniops = None + """the name of the disk offering""" + self.name = None + """the storage type for this disk offering""" + self.storagetype = None + """the tags for the disk offering""" + self.tags = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDomain.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDomain.py new file mode 100644 index 00000000000..3ba237790dd --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDomain.py @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a domain with a new name""" +from baseCmd import * +from baseResponse import * +class updateDomainCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """ID of domain to update""" + """Required""" + self.id = None + """updates domain with this name""" + self.name = None + """Network domain for the domain's networks; empty string will update domainName with NULL value""" + self.networkdomain = None + self.required = ["id",] + +class updateDomainResponse (baseResponse): + def __init__(self): + """the ID of the domain""" + self.id = None + """whether the domain has one or more sub-domains""" + self.haschild = None + """the level of the domain""" + self.level = None + """the name of the domain""" + self.name = None + """the network domain""" + self.networkdomain = None + """the domain ID of the parent domain""" + self.parentdomainid = None + """the domain name of the parent domain""" + self.parentdomainname = None + """the path of the domain""" + self.path = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateGlobalLoadBalancerRule.py new file mode 100644 index 00000000000..98e907ba94a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateGlobalLoadBalancerRule.py @@ -0,0 +1,148 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""update global load balancer rules.""" +from baseCmd import * +from baseResponse import * +class updateGlobalLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the global load balancer rule""" + """Required""" + self.id = None + """the description of the load balancer rule""" + self.description = None + """load balancer algorithm (roundrobin, leastconn, proximity) that is used to distributed traffic across the zones participating in global server load balancing, if not specified defaults to 'round robin'""" + self.gslblbmethod = None + """session sticky method (sourceip) if not specified defaults to sourceip""" + self.gslbstickysessionmethodname = None + self.required = ["id",] + +class updateGlobalLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """global load balancer rule ID""" + self.id = None + """the account of the load balancer rule""" + self.account = None + """the description of the global load balancer rule""" + self.description = None + """the domain of the load balancer rule""" + self.domain = None + """the domain ID of the load balancer rule""" + self.domainid = None + """DNS domain name given for the global load balancer""" + self.gslbdomainname = None + """Load balancing method used for the global load balancer""" + self.gslblbmethod = None + """GSLB service type""" + self.gslbservicetype = None + """session persistence method used for the global load balancer""" + self.gslbstickysessionmethodname = None + """name of the global load balancer rule""" + self.name = None + """the project name of the load balancer""" + self.project = None + """the project id of the load balancer""" + self.projectid = None + """Region Id in which global load balancer is created""" + self.regionid = None + """List of load balancer rules that are part of GSLB rule""" + self.loadbalancerrule = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class loadbalancerrule: + def __init__(self): + """"the load balancer rule ID""" + self.id = None + """"the account of the load balancer rule""" + self.account = None + """"the load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """"the cidr list to forward traffic from""" + self.cidrlist = None + """"the description of the load balancer""" + self.description = None + """"the domain of the load balancer rule""" + self.domain = None + """"the domain ID of the load balancer rule""" + self.domainid = None + """"the name of the load balancer""" + self.name = None + """"the id of the guest network the lb rule belongs to""" + self.networkid = None + """"the private port""" + self.privateport = None + """"the project name of the load balancer""" + self.project = None + """"the project id of the load balancer""" + self.projectid = None + """"the public ip address""" + self.publicip = None + """"the public ip address id""" + self.publicipid = None + """"the public port""" + self.publicport = None + """"the state of the rule""" + self.state = None + """"the id of the zone the rule belongs to""" + self.zoneid = None + """"the list of resource tags associated with load balancer""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHost.py new file mode 100644 index 00000000000..18b5f9300c4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHost.py @@ -0,0 +1,130 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a host.""" +from baseCmd import * +from baseResponse import * +class updateHostCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the host to update""" + """Required""" + self.id = None + """Change resource state of host, valid values are [Enable, Disable]. Operation may failed if host in states not allowing Enable/Disable""" + self.allocationstate = None + """list of tags to be added to the host""" + self.hosttags = [] + """the id of Os category to update the host with""" + self.oscategoryid = None + """the new uri for the secondary storage: nfs://host/path""" + self.url = None + self.required = ["id",] + +class updateHostResponse (baseResponse): + def __init__(self): + """the ID of the host""" + self.id = None + """the cpu average load on the host""" + self.averageload = None + """capabilities of the host""" + self.capabilities = None + """the cluster ID of the host""" + self.clusterid = None + """the cluster name of the host""" + self.clustername = None + """the cluster type of the cluster that host belongs to""" + self.clustertype = None + """the amount of the host's CPU currently allocated""" + self.cpuallocated = None + """the CPU number of the host""" + self.cpunumber = None + """the CPU speed of the host""" + self.cpuspeed = None + """the amount of the host's CPU currently used""" + self.cpuused = None + """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" + self.cpuwithoverprovisioning = None + """the date and time the host was created""" + self.created = None + """true if the host is disconnected. False otherwise.""" + self.disconnected = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the host""" + self.disksizetotal = None + """events available for the host""" + self.events = None + """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" + self.hahost = None + """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" + self.hasenoughcapacity = None + """comma-separated list of tags for the host""" + self.hosttags = None + """the host hypervisor""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the IP address of the host""" + self.ipaddress = None + """true if local storage is active, false otherwise""" + self.islocalstorageactive = None + """the date and time the host was last pinged""" + self.lastpinged = None + """the management server ID of the host""" + self.managementserverid = None + """the amount of the host's memory currently allocated""" + self.memoryallocated = None + """the memory total of the host""" + self.memorytotal = None + """the amount of the host's memory currently used""" + self.memoryused = None + """the name of the host""" + self.name = None + """the incoming network traffic on the host""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the OS category ID of the host""" + self.oscategoryid = None + """the OS category name of the host""" + self.oscategoryname = None + """the Pod ID of the host""" + self.podid = None + """the Pod name of the host""" + self.podname = None + """the date and time the host was removed""" + self.removed = None + """the resource state of the host""" + self.resourcestate = None + """the state of the host""" + self.state = None + """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" + self.suitableformigration = None + """the host type""" + self.type = None + """the host version""" + self.version = None + """the Zone ID of the host""" + self.zoneid = None + """the Zone name of the host""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHostPassword.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHostPassword.py new file mode 100644 index 00000000000..eaeb0bcc4ef --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHostPassword.py @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Update password of a host/pool on management server.""" +from baseCmd import * +from baseResponse import * +class updateHostPasswordCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the new password for the host/cluster""" + """Required""" + self.password = None + """the username for the host/cluster""" + """Required""" + self.username = None + """the cluster ID""" + self.clusterid = None + """the host ID""" + self.hostid = None + self.required = ["password","username",] + +class updateHostPasswordResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHypervisorCapabilities.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHypervisorCapabilities.py new file mode 100644 index 00000000000..f640aa85d1b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHypervisorCapabilities.py @@ -0,0 +1,51 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a hypervisor capabilities.""" +from baseCmd import * +from baseResponse import * +class updateHypervisorCapabilitiesCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """ID of the hypervisor capability""" + self.id = None + """the max number of Guest VMs per host for this hypervisor.""" + self.maxguestslimit = None + """set true to enable security group for this hypervisor.""" + self.securitygroupenabled = None + self.required = [] + +class updateHypervisorCapabilitiesResponse (baseResponse): + def __init__(self): + """the ID of the hypervisor capabilities row""" + self.id = None + """the hypervisor type""" + self.hypervisor = None + """the hypervisor version""" + self.hypervisorversion = None + """the maximum number of Data Volumes that can be attached for this hypervisor""" + self.maxdatavolumeslimit = None + """the maximum number of guest vms recommended for this hypervisor""" + self.maxguestslimit = None + """the maximum number of Hosts per cluster for this hypervisor""" + self.maxhostspercluster = None + """true if security group is supported""" + self.securitygroupenabled = None + """true if storage motion is supported""" + self.storagemotionenabled = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateInstanceGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateInstanceGroup.py new file mode 100644 index 00000000000..357f7781ee7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateInstanceGroup.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a vm group""" +from baseCmd import * +from baseResponse import * +class updateInstanceGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Instance group ID""" + """Required""" + self.id = None + """new instance group name""" + self.name = None + self.required = ["id",] + +class updateInstanceGroupResponse (baseResponse): + def __init__(self): + """the id of the instance group""" + self.id = None + """the account owning the instance group""" + self.account = None + """time and date the instance group was created""" + self.created = None + """the domain name of the instance group""" + self.domain = None + """the domain ID of the instance group""" + self.domainid = None + """the name of the instance group""" + self.name = None + """the project name of the group""" + self.project = None + """the project id of the group""" + self.projectid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateIso.py new file mode 100644 index 00000000000..5416462f5fd --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateIso.py @@ -0,0 +1,149 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates an ISO file.""" +from baseCmd import * +from baseResponse import * +class updateIsoCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the image file""" + """Required""" + self.id = None + """true if image is bootable, false otherwise""" + self.bootable = None + """the display text of the image""" + self.displaytext = None + """the format for the image""" + self.format = None + """true if template/ISO contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template type is routing i.e., if template is used to deploy router""" + self.isrouting = None + """the name of the image file""" + self.name = None + """the ID of the OS type that best represents the OS of this image.""" + self.ostypeid = None + """true if the image supports the password reset feature; default is false""" + self.passwordenabled = None + """sort key of the template, integer""" + self.sortkey = None + self.required = ["id",] + +class updateIsoResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateIsoPermissions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateIsoPermissions.py new file mode 100644 index 00000000000..4e8debc3433 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateIsoPermissions.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates iso permissions""" +from baseCmd import * +from baseResponse import * +class updateIsoPermissionsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the template ID""" + """Required""" + self.id = None + """a comma delimited list of accounts. If specified, "op" parameter has to be passed in.""" + self.accounts = [] + """true if the template/iso is extractable, false other wise. Can be set only by root admin""" + self.isextractable = None + """true for featured template/iso, false otherwise""" + self.isfeatured = None + """true for public template/iso, false for private templates/isos""" + self.ispublic = None + """permission operator (add, remove, reset)""" + self.op = None + """a comma delimited list of projects. If specified, "op" parameter has to be passed in.""" + self.projectids = [] + self.required = ["id",] + +class updateIsoPermissionsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateLoadBalancerRule.py new file mode 100644 index 00000000000..b02139fdc0f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateLoadBalancerRule.py @@ -0,0 +1,97 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates load balancer""" +from baseCmd import * +from baseResponse import * +class updateLoadBalancerRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the id of the load balancer rule to update""" + """Required""" + self.id = None + """load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """the description of the load balancer rule""" + self.description = None + """the name of the load balancer rule""" + self.name = None + self.required = ["id",] + +class updateLoadBalancerRuleResponse (baseResponse): + def __init__(self): + """the load balancer rule ID""" + self.id = None + """the account of the load balancer rule""" + self.account = None + """the load balancer algorithm (source, roundrobin, leastconn)""" + self.algorithm = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the description of the load balancer""" + self.description = None + """the domain of the load balancer rule""" + self.domain = None + """the domain ID of the load balancer rule""" + self.domainid = None + """the name of the load balancer""" + self.name = None + """the id of the guest network the lb rule belongs to""" + self.networkid = None + """the private port""" + self.privateport = None + """the project name of the load balancer""" + self.project = None + """the project id of the load balancer""" + self.projectid = None + """the public ip address""" + self.publicip = None + """the public ip address id""" + self.publicipid = None + """the public port""" + self.publicport = None + """the state of the rule""" + self.state = None + """the id of the zone the rule belongs to""" + self.zoneid = None + """the list of resource tags associated with load balancer""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetwork.py new file mode 100644 index 00000000000..b0230f59dd3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetwork.py @@ -0,0 +1,216 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a network""" +from baseCmd import * +from baseResponse import * +class updateNetworkCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the network""" + """Required""" + self.id = None + """Force update even if cidr type is different""" + self.changecidr = None + """an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """the new display text for the network""" + self.displaytext = None + """CIDR for Guest VMs,Cloudstack allocates IPs to Guest VMs only from this CIDR""" + self.guestvmcidr = None + """the new name for the network""" + self.name = None + """network domain""" + self.networkdomain = None + """network offering ID""" + self.networkofferingid = None + self.required = ["id",] + +class updateNetworkResponse (baseResponse): + def __init__(self): + """the id of the network""" + self.id = None + """the owner of the network""" + self.account = None + """ACL Id associated with the VPC network""" + self.aclid = None + """acl type - access type to the network""" + self.acltype = None + """Broadcast domain type of the network""" + self.broadcastdomaintype = None + """broadcast uri of the network. This parameter is visible to ROOT admins only""" + self.broadcasturi = None + """list networks available for vm deployment""" + self.canusefordeploy = None + """Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" + self.cidr = None + """an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """the displaytext of the network""" + self.displaytext = None + """the first DNS for the network""" + self.dns1 = None + """the second DNS for the network""" + self.dns2 = None + """the domain name of the network owner""" + self.domain = None + """the domain id of the network owner""" + self.domainid = None + """the network's gateway""" + self.gateway = None + """the cidr of IPv6 network""" + self.ip6cidr = None + """the gateway of IPv6 network""" + self.ip6gateway = None + """true if network is default, false otherwise""" + self.isdefault = None + """list networks that are persistent""" + self.ispersistent = None + """true if network is system, false otherwise""" + self.issystem = None + """the name of the network""" + self.name = None + """the network's netmask""" + self.netmask = None + """the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" + self.networkcidr = None + """the network domain""" + self.networkdomain = None + """availability of the network offering the network is created from""" + self.networkofferingavailability = None + """true if network offering is ip conserve mode enabled""" + self.networkofferingconservemode = None + """display text of the network offering the network is created from""" + self.networkofferingdisplaytext = None + """network offering id the network is created from""" + self.networkofferingid = None + """name of the network offering the network is created from""" + self.networkofferingname = None + """the physical network id""" + self.physicalnetworkid = None + """the project name of the address""" + self.project = None + """the project id of the ipaddress""" + self.projectid = None + """related to what other network configuration""" + self.related = None + """the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" + self.reservediprange = None + """true network requires restart""" + self.restartrequired = None + """true if network supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """state of the network""" + self.state = None + """true if users from subdomains can access the domain level network""" + self.subdomainaccess = None + """the traffic type of the network""" + self.traffictype = None + """the type of the network""" + self.type = None + """The vlan of the network. This parameter is visible to ROOT admins only""" + self.vlan = None + """VPC the network belongs to""" + self.vpcid = None + """zone id of the network""" + self.zoneid = None + """the name of the zone the network belongs to""" + self.zonename = None + """the list of services""" + self.service = [] + """the list of resource tags associated with network""" + self.tags = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkACLItem.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkACLItem.py new file mode 100644 index 00000000000..acc979f2609 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkACLItem.py @@ -0,0 +1,99 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates ACL Item with specified Id""" +from baseCmd import * +from baseResponse import * +class updateNetworkACLItemCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the ID of the network ACL Item""" + """Required""" + self.id = None + """scl entry action, allow or deny""" + self.action = None + """the cidr list to allow traffic from/to""" + self.cidrlist = [] + """the ending port of ACL""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """The network of the vm the ACL will be created for""" + self.number = None + """the protocol for the ACL rule. Valid values are TCP/UDP/ICMP/ALL or valid protocol number""" + self.protocol = None + """the starting port of ACL""" + self.startport = None + """the traffic type for the ACL,can be Ingress or Egress, defaulted to Ingress if not specified""" + self.traffictype = None + self.required = ["id",] + +class updateNetworkACLItemResponse (baseResponse): + def __init__(self): + """the ID of the ACL Item""" + self.id = None + """the ID of the ACL this item belongs to""" + self.aclid = None + """Action of ACL Item. Allow/Deny""" + self.action = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the ending port of ACL's port range""" + self.endport = None + """error code for this icmp message""" + self.icmpcode = None + """type of the icmp message being sent""" + self.icmptype = None + """Number of the ACL Item""" + self.number = None + """the protocol of the ACL""" + self.protocol = None + """the starting port of ACL's port range""" + self.startport = None + """the state of the rule""" + self.state = None + """the traffic type for the ACL""" + self.traffictype = None + """the list of resource tags associated with the network ACLs""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkOffering.py new file mode 100644 index 00000000000..813af27dcb1 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkOffering.py @@ -0,0 +1,140 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a network offering.""" +from baseCmd import * +from baseResponse import * +class updateNetworkOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the availability of network offering. Default value is Required for Guest Virtual network offering; Optional for Guest Direct network offering""" + self.availability = None + """the display text of the network offering""" + self.displaytext = None + """the id of the network offering""" + self.id = None + """maximum number of concurrent connections supported by the network offering""" + self.maxconnections = None + """the name of the network offering""" + self.name = None + """sort key of the network offering, integer""" + self.sortkey = None + """update state for the network offering""" + self.state = None + self.required = [] + +class updateNetworkOfferingResponse (baseResponse): + def __init__(self): + """the id of the network offering""" + self.id = None + """availability of the network offering""" + self.availability = None + """true if network offering is ip conserve mode enabled""" + self.conservemode = None + """the date this network offering was created""" + self.created = None + """additional key/value details tied with network offering""" + self.details = None + """an alternate display text of the network offering.""" + self.displaytext = None + """true if network offering supports persistent networks, false otherwise""" + self.egressdefaultpolicy = None + """true if network offering can be used by VPC networks only""" + self.forvpc = None + """guest type of the network offering, can be Shared or Isolated""" + self.guestiptype = None + """true if network offering is default, false otherwise""" + self.isdefault = None + """true if network offering supports persistent networks, false otherwise""" + self.ispersistent = None + """maximum number of concurrents connections to be handled by lb""" + self.maxconnections = None + """the name of the network offering""" + self.name = None + """data transfer rate in megabits per second allowed.""" + self.networkrate = None + """the ID of the service offering used by virtual router provider""" + self.serviceofferingid = None + """true if network offering supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """true if network offering supports vlans, false otherwise""" + self.specifyvlan = None + """state of the network offering. Can be Disabled/Enabled/Inactive""" + self.state = None + """the tags for the network offering""" + self.tags = None + """the traffic type for the network offering, supported types are Public, Management, Control, Guest, Vlan or Storage.""" + self.traffictype = None + """the list of supported services""" + self.service = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkServiceProvider.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkServiceProvider.py new file mode 100644 index 00000000000..677ef4b11f7 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkServiceProvider.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a network serviceProvider of a physical network""" +from baseCmd import * +from baseResponse import * +class updateNetworkServiceProviderCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """network service provider id""" + """Required""" + self.id = None + """the list of services to be enabled for this physical network service provider""" + self.servicelist = [] + """Enabled/Disabled/Shutdown the physical network service provider""" + self.state = None + self.required = ["id",] + +class updateNetworkServiceProviderResponse (baseResponse): + def __init__(self): + """uuid of the network provider""" + self.id = None + """true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """the destination physical network""" + self.destinationphysicalnetworkid = None + """the provider name""" + self.name = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """services for this provider""" + self.servicelist = None + """state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePhysicalNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePhysicalNetwork.py new file mode 100644 index 00000000000..e994066aeca --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePhysicalNetwork.py @@ -0,0 +1,60 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a physical network""" +from baseCmd import * +from baseResponse import * +class updatePhysicalNetworkCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """physical network id""" + """Required""" + self.id = None + """the speed for the physical network[1G/10G]""" + self.networkspeed = None + """Enabled/Disabled""" + self.state = None + """Tag the physical network""" + self.tags = [] + """the VLAN for the physical network""" + self.vlan = None + self.required = ["id",] + +class updatePhysicalNetworkResponse (baseResponse): + def __init__(self): + """the uuid of the physical network""" + self.id = None + """Broadcast domain range of the physical network""" + self.broadcastdomainrange = None + """the domain id of the physical network owner""" + self.domainid = None + """isolation methods""" + self.isolationmethods = None + """name of the physical network""" + self.name = None + """the speed of the physical network""" + self.networkspeed = None + """state of the physical network""" + self.state = None + """comma separated tag""" + self.tags = None + """the vlan of the physical network""" + self.vlan = None + """zone id of the physical network""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePod.py new file mode 100644 index 00000000000..54aa412aa24 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePod.py @@ -0,0 +1,87 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a Pod.""" +from baseCmd import * +from baseResponse import * +class updatePodCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the Pod""" + """Required""" + self.id = None + """Allocation state of this cluster for allocation of new resources""" + self.allocationstate = None + """the ending IP address for the Pod""" + self.endip = None + """the gateway for the Pod""" + self.gateway = None + """the name of the Pod""" + self.name = None + """the netmask of the Pod""" + self.netmask = None + """the starting IP address for the Pod""" + self.startip = None + self.required = ["id",] + +class updatePodResponse (baseResponse): + def __init__(self): + """the ID of the Pod""" + self.id = None + """the allocation state of the Pod""" + self.allocationstate = None + """the ending IP for the Pod""" + self.endip = None + """the gateway of the Pod""" + self.gateway = None + """the name of the Pod""" + self.name = None + """the netmask of the Pod""" + self.netmask = None + """the starting IP for the Pod""" + self.startip = None + """the Zone ID of the Pod""" + self.zoneid = None + """the Zone name of the Pod""" + self.zonename = None + """the capacity of the Pod""" + self.capacity = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePortForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePortForwardingRule.py new file mode 100644 index 00000000000..ddafa5125bd --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePortForwardingRule.py @@ -0,0 +1,98 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a port forwarding rule. Only the private port and the virtual machine can be updated.""" +from baseCmd import * +from baseResponse import * +class updatePortForwardingRuleCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the IP address id of the port forwarding rule""" + """Required""" + self.ipaddressid = None + """the private port of the port forwarding rule""" + """Required""" + self.privateport = None + """the protocol for the port fowarding rule. Valid values are TCP or UDP.""" + """Required""" + self.protocol = None + """the public port of the port forwarding rule""" + """Required""" + self.publicport = None + """the private IP address of the port forwarding rule""" + self.privateip = None + """the ID of the virtual machine for the port forwarding rule""" + self.virtualmachineid = None + self.required = ["ipaddressid","privateport","protocol","publicport",] + +class updatePortForwardingRuleResponse (baseResponse): + def __init__(self): + """the ID of the port forwarding rule""" + self.id = None + """the cidr list to forward traffic from""" + self.cidrlist = None + """the public ip address for the port forwarding rule""" + self.ipaddress = None + """the public ip address id for the port forwarding rule""" + self.ipaddressid = None + """the ending port of port forwarding rule's private port range""" + self.privateendport = None + """the starting port of port forwarding rule's private port range""" + self.privateport = None + """the protocol of the port forwarding rule""" + self.protocol = None + """the ending port of port forwarding rule's private port range""" + self.publicendport = None + """the starting port of port forwarding rule's public port range""" + self.publicport = None + """the state of the rule""" + self.state = None + """the VM display name for the port forwarding rule""" + self.virtualmachinedisplayname = None + """the VM ID for the port forwarding rule""" + self.virtualmachineid = None + """the VM name for the port forwarding rule""" + self.virtualmachinename = None + """the vm ip address for the port forwarding rule""" + self.vmguestip = None + """the list of resource tags associated with the rule""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateProject.py new file mode 100644 index 00000000000..3cce35aaa0e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateProject.py @@ -0,0 +1,145 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a project""" +from baseCmd import * +from baseResponse import * +class updateProjectCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of the project to be modified""" + """Required""" + self.id = None + """new Admin account for the project""" + self.account = None + """display text of the project""" + self.displaytext = None + self.required = ["id",] + +class updateProjectResponse (baseResponse): + def __init__(self): + """the id of the project""" + self.id = None + """the account name of the project's owner""" + self.account = None + """the total number of cpu cores available to be created for this project""" + self.cpuavailable = None + """the total number of cpu cores the project can own""" + self.cpulimit = None + """the total number of cpu cores owned by project""" + self.cputotal = None + """the displaytext of the project""" + self.displaytext = None + """the domain name where the project belongs to""" + self.domain = None + """the domain id the project belongs to""" + self.domainid = None + """the total number of public ip addresses available for this project to acquire""" + self.ipavailable = None + """the total number of public ip addresses this project can acquire""" + self.iplimit = None + """the total number of public ip addresses allocated for this project""" + self.iptotal = None + """the total memory (in MB) available to be created for this project""" + self.memoryavailable = None + """the total memory (in MB) the project can own""" + self.memorylimit = None + """the total memory (in MB) owned by project""" + self.memorytotal = None + """the name of the project""" + self.name = None + """the total number of networks available to be created for this project""" + self.networkavailable = None + """the total number of networks the project can own""" + self.networklimit = None + """the total number of networks owned by project""" + self.networktotal = None + """the total primary storage space (in GiB) available to be used for this project""" + self.primarystorageavailable = None + """the total primary storage space (in GiB) the project can own""" + self.primarystoragelimit = None + """the total primary storage space (in GiB) owned by project""" + self.primarystoragetotal = None + """the total secondary storage space (in GiB) available to be used for this project""" + self.secondarystorageavailable = None + """the total secondary storage space (in GiB) the project can own""" + self.secondarystoragelimit = None + """the total secondary storage space (in GiB) owned by project""" + self.secondarystoragetotal = None + """the total number of snapshots available for this project""" + self.snapshotavailable = None + """the total number of snapshots which can be stored by this project""" + self.snapshotlimit = None + """the total number of snapshots stored by this project""" + self.snapshottotal = None + """the state of the project""" + self.state = None + """the total number of templates available to be created by this project""" + self.templateavailable = None + """the total number of templates which can be created by this project""" + self.templatelimit = None + """the total number of templates which have been created by this project""" + self.templatetotal = None + """the total number of virtual machines available for this project to acquire""" + self.vmavailable = None + """the total number of virtual machines that can be deployed by this project""" + self.vmlimit = None + """the total number of virtual machines running for this project""" + self.vmrunning = None + """the total number of virtual machines stopped for this project""" + self.vmstopped = None + """the total number of virtual machines deployed by this project""" + self.vmtotal = None + """the total volume available for this project""" + self.volumeavailable = None + """the total volume which can be used by this project""" + self.volumelimit = None + """the total volume being used by this project""" + self.volumetotal = None + """the total number of vpcs available to be created for this project""" + self.vpcavailable = None + """the total number of vpcs the project can own""" + self.vpclimit = None + """the total number of vpcs owned by project""" + self.vpctotal = None + """the list of resource tags associated with vm""" + self.tags = [] + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateProjectInvitation.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateProjectInvitation.py new file mode 100644 index 00000000000..f56aac5a41d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateProjectInvitation.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Accepts or declines project invitation""" +from baseCmd import * +from baseResponse import * +class updateProjectInvitationCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of the project to join""" + """Required""" + self.projectid = None + """if true, accept the invitation, decline if false. True by default""" + self.accept = None + """account that is joining the project""" + self.account = None + """list invitations for specified account; this parameter has to be specified with domainId""" + self.token = None + self.required = ["projectid",] + +class updateProjectInvitationResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateRegion.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateRegion.py new file mode 100644 index 00000000000..c7552db0deb --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateRegion.py @@ -0,0 +1,46 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a region""" +from baseCmd import * +from baseResponse import * +class updateRegionCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Id of region to update""" + """Required""" + self.id = None + """updates region with this end point""" + self.endpoint = None + """updates region with this name""" + self.name = None + self.required = ["id",] + +class updateRegionResponse (baseResponse): + def __init__(self): + """the ID of the region""" + self.id = None + """the end point of the region""" + self.endpoint = None + """true if GSLB service is enabled in the region, false otherwise""" + self.gslbserviceenabled = None + """the name of the region""" + self.name = None + """true if security groups support is enabled, false otherwise""" + self.portableipserviceenabled = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceCount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceCount.py new file mode 100644 index 00000000000..f197b9e65a4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceCount.py @@ -0,0 +1,52 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Recalculate and update resource count for an account or domain.""" +from baseCmd import * +from baseResponse import * +class updateResourceCountCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """If account parameter specified then updates resource counts for a specified account in this domain else update resource counts for all accounts & child domains in specified domain.""" + """Required""" + self.domainid = None + """Update resource count for a specified account. Must be used with the domainId parameter.""" + self.account = None + """Update resource limits for project""" + self.projectid = None + """Type of resource to update. If specifies valid values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and 11. If not specified will update all resource counts0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses a user can own. 2 - Volume. Number of disk volumes a user can create.3 - Snapshot. Number of snapshots a user can create.4 - Template. Number of templates that a user can register/create.5 - Project. Number of projects that a user can create.6 - Network. Number of guest network a user can create.7 - VPC. Number of VPC a user can create.8 - CPU. Total number of CPU cores a user can use.9 - Memory. Total Memory (in MB) a user can use.10 - PrimaryStorage. Total primary storage space (in GiB) a user can use.11 - SecondaryStorage. Total secondary storage space (in GiB) a user can use.""" + self.resourcetype = None + self.required = ["domainid",] + +class updateResourceCountResponse (baseResponse): + def __init__(self): + """the account for which resource count's are updated""" + self.account = None + """the domain name for which resource count's are updated""" + self.domain = None + """the domain ID for which resource count's are updated""" + self.domainid = None + """the project name for which resource count's are updated""" + self.project = None + """the project id for which resource count's are updated""" + self.projectid = None + """resource count""" + self.resourcecount = None + """resource type. Values include 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. See the resourceType parameter for more information on these values.""" + self.resourcetype = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceLimit.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceLimit.py new file mode 100644 index 00000000000..00918544cab --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceLimit.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates resource limits for an account or domain.""" +from baseCmd import * +from baseResponse import * +class updateResourceLimitCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """Type of resource to update. Values are 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 and 11. 0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses a user can own. 2 - Volume. Number of disk volumes a user can create.3 - Snapshot. Number of snapshots a user can create.4 - Template. Number of templates that a user can register/create.6 - Network. Number of guest network a user can create.7 - VPC. Number of VPC a user can create.8 - CPU. Total number of CPU cores a user can use.9 - Memory. Total Memory (in MB) a user can use.10 - PrimaryStorage. Total primary storage space (in GiB) a user can use.11 - SecondaryStorage. Total secondary storage space (in GiB) a user can use.""" + """Required""" + self.resourcetype = None + """Update resource for a specified account. Must be used with the domainId parameter.""" + self.account = None + """Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.""" + self.domainid = None + """Maximum resource limit.""" + self.max = None + """Update resource limits for project""" + self.projectid = None + self.required = ["resourcetype",] + +class updateResourceLimitResponse (baseResponse): + def __init__(self): + """the account of the resource limit""" + self.account = None + """the domain name of the resource limit""" + self.domain = None + """the domain ID of the resource limit""" + self.domainid = None + """the maximum number of the resource. A -1 means the resource currently has no limit.""" + self.max = None + """the project name of the resource limit""" + self.project = None + """the project id of the resource limit""" + self.projectid = None + """resource type. Values include 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11. See the resourceType parameter for more information on these values.""" + self.resourcetype = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateServiceOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateServiceOffering.py new file mode 100644 index 00000000000..ed5981403ec --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateServiceOffering.py @@ -0,0 +1,113 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a service offering.""" +from baseCmd import * +from baseResponse import * +class updateServiceOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the service offering to be updated""" + """Required""" + self.id = None + """the display text of the service offering to be updated""" + self.displaytext = None + """the name of the service offering to be updated""" + self.name = None + """sort key of the service offering, integer""" + self.sortkey = None + self.required = ["id",] + +class updateServiceOfferingResponse (baseResponse): + def __init__(self): + """the id of the service offering""" + self.id = None + """the number of CPU""" + self.cpunumber = None + """the clock rate CPU speed in Mhz""" + self.cpuspeed = None + """the date this service offering was created""" + self.created = None + """is this a default system vm offering""" + self.defaultuse = None + """deployment strategy used to deploy VM.""" + self.deploymentplanner = None + """bytes read rate of the service offering""" + self.diskBytesReadRate = None + """bytes write rate of the service offering""" + self.diskBytesWriteRate = None + """io requests read rate of the service offering""" + self.diskIopsReadRate = None + """io requests write rate of the service offering""" + self.diskIopsWriteRate = None + """an alternate display text of the service offering.""" + self.displaytext = None + """Domain name for the offering""" + self.domain = None + """the domain id of the service offering""" + self.domainid = None + """the host tag for the service offering""" + self.hosttags = None + """is this a system vm offering""" + self.issystem = None + """true if the vm needs to be volatile, i.e., on every reboot of vm from API root disk is discarded and creates a new root disk""" + self.isvolatile = None + """restrict the CPU usage to committed service offering""" + self.limitcpuuse = None + """the memory in MB""" + self.memory = None + """the name of the service offering""" + self.name = None + """data transfer rate in megabits per second allowed.""" + self.networkrate = None + """the ha support in the service offering""" + self.offerha = None + """additional key/value details tied with this service offering""" + self.serviceofferingdetails = None + """the storage type for this service offering""" + self.storagetype = None + """is this a the systemvm type for system vm offering""" + self.systemvmtype = None + """the tags for the service offering""" + self.tags = None + """the list of resource tags associated with service offering. The resource tags are not used for Volume/VM placement on the specific host.""" + self.resourcetags = [] + +class resourcetags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateStorageNetworkIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateStorageNetworkIpRange.py new file mode 100644 index 00000000000..8d398307fed --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateStorageNetworkIpRange.py @@ -0,0 +1,58 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Update a Storage network IP range, only allowed when no IPs in this range have been allocated.""" +from baseCmd import * +from baseResponse import * +class updateStorageNetworkIpRangeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """UUID of storage network ip range""" + """Required""" + self.id = None + """the ending IP address""" + self.endip = None + """the netmask for storage network""" + self.netmask = None + """the beginning IP address""" + self.startip = None + """Optional. the vlan the ip range sits on""" + self.vlan = None + self.required = ["id",] + +class updateStorageNetworkIpRangeResponse (baseResponse): + def __init__(self): + """the uuid of storage network IP range.""" + self.id = None + """the end ip of the storage network IP range""" + self.endip = None + """the gateway of the storage network IP range""" + self.gateway = None + """the netmask of the storage network IP range""" + self.netmask = None + """the network uuid of storage network IP range""" + self.networkid = None + """the Pod uuid for the storage network IP range""" + self.podid = None + """the start ip of the storage network IP range""" + self.startip = None + """the ID or VID of the VLAN.""" + self.vlan = None + """the Zone uuid of the storage network IP range""" + self.zoneid = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateStoragePool.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateStoragePool.py new file mode 100644 index 00000000000..d77e0e71d9e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateStoragePool.py @@ -0,0 +1,84 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a storage pool.""" +from baseCmd import * +from baseResponse import * +class updateStoragePoolCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the Id of the storage pool""" + """Required""" + self.id = None + """bytes CloudStack can provision from this storage pool""" + self.capacitybytes = None + """IOPS CloudStack can provision from this storage pool""" + self.capacityiops = None + """comma-separated list of tags for the storage pool""" + self.tags = [] + self.required = ["id",] + +class updateStoragePoolResponse (baseResponse): + def __init__(self): + """the ID of the storage pool""" + self.id = None + """IOPS CloudStack can provision from this storage pool""" + self.capacityiops = None + """the ID of the cluster for the storage pool""" + self.clusterid = None + """the name of the cluster for the storage pool""" + self.clustername = None + """the date and time the storage pool was created""" + self.created = None + """the host's currently allocated disk size""" + self.disksizeallocated = None + """the total disk size of the storage pool""" + self.disksizetotal = None + """the host's currently used disk size""" + self.disksizeused = None + """the hypervisor type of the storage pool""" + self.hypervisor = None + """the IP address of the storage pool""" + self.ipaddress = None + """the name of the storage pool""" + self.name = None + """the storage pool path""" + self.path = None + """the Pod ID of the storage pool""" + self.podid = None + """the Pod name of the storage pool""" + self.podname = None + """the scope of the storage pool""" + self.scope = None + """the state of the storage pool""" + self.state = None + """true if this pool is suitable to migrate a volume, false otherwise""" + self.suitableformigration = None + """the tags for the storage pool""" + self.tags = None + """the storage pool type""" + self.type = None + """the Zone ID of the storage pool""" + self.zoneid = None + """the Zone name of the storage pool""" + self.zonename = None + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplate.py new file mode 100644 index 00000000000..57873821ee4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplate.py @@ -0,0 +1,149 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates attributes of a template.""" +from baseCmd import * +from baseResponse import * +class updateTemplateCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the image file""" + """Required""" + self.id = None + """true if image is bootable, false otherwise""" + self.bootable = None + """the display text of the image""" + self.displaytext = None + """the format for the image""" + self.format = None + """true if template/ISO contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template type is routing i.e., if template is used to deploy router""" + self.isrouting = None + """the name of the image file""" + self.name = None + """the ID of the OS type that best represents the OS of this image.""" + self.ostypeid = None + """true if the image supports the password reset feature; default is false""" + self.passwordenabled = None + """sort key of the template, integer""" + self.sortkey = None + self.required = ["id",] + +class updateTemplateResponse (baseResponse): + def __init__(self): + """the template ID""" + self.id = None + """the account name to which the template belongs""" + self.account = None + """the account id to which the template belongs""" + self.accountid = None + """true if the ISO is bootable, false otherwise""" + self.bootable = None + """checksum of the template""" + self.checksum = None + """the date this template was created""" + self.created = None + """true if the template is managed across all Zones, false otherwise""" + self.crossZones = None + """additional key/value details tied with template""" + self.details = None + """the template display text""" + self.displaytext = None + """the name of the domain to which the template belongs""" + self.domain = None + """the ID of the domain to which the template belongs""" + self.domainid = None + """the format of the template.""" + self.format = None + """the ID of the secondary storage host for the template""" + self.hostid = None + """the name of the secondary storage host for the template""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """true if the template is extractable, false otherwise""" + self.isextractable = None + """true if this template is a featured template, false otherwise""" + self.isfeatured = None + """true if this template is a public template, false otherwise""" + self.ispublic = None + """true if the template is ready to be deployed from, false otherwise.""" + self.isready = None + """the template name""" + self.name = None + """the ID of the OS type for this template.""" + self.ostypeid = None + """the name of the OS type for this template.""" + self.ostypename = None + """true if the reset password feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the template""" + self.project = None + """the project id of the template""" + self.projectid = None + """the date this template was removed""" + self.removed = None + """the size of the template""" + self.size = None + """the template ID of the parent template if present""" + self.sourcetemplateid = None + """true if template is sshkey enabled, false otherwise""" + self.sshkeyenabled = None + """the status of the template""" + self.status = None + """the tag of this template""" + self.templatetag = None + """the type of the template""" + self.templatetype = None + """the ID of the zone for this template""" + self.zoneid = None + """the name of the zone for this template""" + self.zonename = None + """the list of resource tags associated with tempate""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplatePermissions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplatePermissions.py new file mode 100644 index 00000000000..88d01e04f11 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplatePermissions.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a template visibility permissions. A public template is visible to all accounts within the same domain. A private template is visible only to the owner of the template. A priviledged template is a private template with account permissions added. Only accounts specified under the template permissions are visible to them.""" +from baseCmd import * +from baseResponse import * +class updateTemplatePermissionsCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the template ID""" + """Required""" + self.id = None + """a comma delimited list of accounts. If specified, "op" parameter has to be passed in.""" + self.accounts = [] + """true if the template/iso is extractable, false other wise. Can be set only by root admin""" + self.isextractable = None + """true for featured template/iso, false otherwise""" + self.isfeatured = None + """true for public template/iso, false for private templates/isos""" + self.ispublic = None + """permission operator (add, remove, reset)""" + self.op = None + """a comma delimited list of projects. If specified, "op" parameter has to be passed in.""" + self.projectids = [] + self.required = ["id",] + +class updateTemplatePermissionsResponse (baseResponse): + def __init__(self): + """any text associated with the success or failure""" + self.displaytext = None + """true if operation is executed successfully""" + self.success = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTrafficType.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTrafficType.py new file mode 100644 index 00000000000..8d216421382 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTrafficType.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates traffic type of a physical network""" +from baseCmd import * +from baseResponse import * +class updateTrafficTypeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """traffic type id""" + """Required""" + self.id = None + """The network name label of the physical device dedicated to this traffic on a KVM host""" + self.kvmnetworklabel = None + """The network name label of the physical device dedicated to this traffic on a VMware host""" + self.vmwarenetworklabel = None + """The network name label of the physical device dedicated to this traffic on a XenServer host""" + self.xennetworklabel = None + self.required = ["id",] + +class updateTrafficTypeResponse (baseResponse): + def __init__(self): + """id of the network provider""" + self.id = None + """The network name label of the physical device dedicated to this traffic on a KVM host""" + self.kvmnetworklabel = None + """the physical network this belongs to""" + self.physicalnetworkid = None + """the trafficType to be added to the physical network""" + self.traffictype = None + """The network name label of the physical device dedicated to this traffic on a VMware host""" + self.vmwarenetworklabel = None + """The network name label of the physical device dedicated to this traffic on a XenServer host""" + self.xennetworklabel = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateUser.py new file mode 100644 index 00000000000..e60959b886f --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateUser.py @@ -0,0 +1,82 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a user account""" +from baseCmd import * +from baseResponse import * +class updateUserCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """User uuid""" + """Required""" + self.id = None + """email""" + self.email = None + """first name""" + self.firstname = None + """last name""" + self.lastname = None + """Clear text password (default hashed to SHA256SALT). If you wish to use any other hasing algorithm, you would need to write a custom authentication adapter""" + self.password = None + """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" + self.timezone = None + """The API key for the user. Must be specified with userSecretKey""" + self.userapikey = None + """Unique username""" + self.username = None + """The secret key for the user. Must be specified with userApiKey""" + self.usersecretkey = None + self.required = ["id",] + +class updateUserResponse (baseResponse): + def __init__(self): + """the user ID""" + self.id = None + """the account name of the user""" + self.account = None + """the account ID of the user""" + self.accountid = None + """the account type of the user""" + self.accounttype = None + """the api key of the user""" + self.apikey = None + """the date and time the user account was created""" + self.created = None + """the domain name of the user""" + self.domain = None + """the domain ID of the user""" + self.domainid = None + """the user email address""" + self.email = None + """the user firstname""" + self.firstname = None + """the boolean value representing if the updating target is in caller's child domain""" + self.iscallerchilddomain = None + """true if user is default, false otherwise""" + self.isdefault = None + """the user lastname""" + self.lastname = None + """the secret key of the user""" + self.secretkey = None + """the user state""" + self.state = None + """the timezone user was created in""" + self.timezone = None + """the user name""" + self.username = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVMAffinityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVMAffinityGroup.py new file mode 100644 index 00000000000..b5e63dc115e --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVMAffinityGroup.py @@ -0,0 +1,373 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates the affinity/anti-affinity group associations of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect.""" +from baseCmd import * +from baseResponse import * +class updateVMAffinityGroupCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The ID of the virtual machine""" + """Required""" + self.id = None + """comma separated list of affinity groups id that are going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter""" + self.affinitygroupids = [] + """comma separated list of affinity groups names that are going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupids parameter""" + self.affinitygroupnames = [] + self.required = ["id",] + +class updateVMAffinityGroupResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPC.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPC.py new file mode 100644 index 00000000000..b43cb95f507 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPC.py @@ -0,0 +1,398 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a VPC""" +from baseCmd import * +from baseResponse import * +class updateVPCCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the id of the VPC""" + """Required""" + self.id = None + """the name of the VPC""" + """Required""" + self.name = None + """the display text of the VPC""" + self.displaytext = None + self.required = ["id","name",] + +class updateVPCResponse (baseResponse): + def __init__(self): + """the id of the VPC""" + self.id = None + """the owner of the VPC""" + self.account = None + """the cidr the VPC""" + self.cidr = None + """the date this VPC was created""" + self.created = None + """an alternate display text of the VPC.""" + self.displaytext = None + """the domain name of the owner""" + self.domain = None + """the domain id of the VPC owner""" + self.domainid = None + """the name of the VPC""" + self.name = None + """the network domain of the VPC""" + self.networkdomain = None + """the project name of the VPC""" + self.project = None + """the project id of the VPC""" + self.projectid = None + """true VPC requires restart""" + self.restartrequired = None + """state of the VPC. Can be Inactive/Enabled""" + self.state = None + """vpc offering id the VPC is created from""" + self.vpcofferingid = None + """zone id of the vpc""" + self.zoneid = None + """the name of the zone the VPC belongs to""" + self.zonename = None + """the list of networks belongign to the VPC""" + self.network = [] + """the list of supported services""" + self.service = [] + """the list of resource tags associated with the project""" + self.tags = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class network: + def __init__(self): + """"the id of the network""" + self.id = None + """"the owner of the network""" + self.account = None + """"ACL Id associated with the VPC network""" + self.aclid = None + """"acl type - access type to the network""" + self.acltype = None + """"Broadcast domain type of the network""" + self.broadcastdomaintype = None + """"broadcast uri of the network. This parameter is visible to ROOT admins only""" + self.broadcasturi = None + """"list networks available for vm deployment""" + self.canusefordeploy = None + """"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" + self.cidr = None + """"an optional field, whether to the display the network to the end user or not.""" + self.displaynetwork = None + """"the displaytext of the network""" + self.displaytext = None + """"the first DNS for the network""" + self.dns1 = None + """"the second DNS for the network""" + self.dns2 = None + """"the domain name of the network owner""" + self.domain = None + """"the domain id of the network owner""" + self.domainid = None + """"the network's gateway""" + self.gateway = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"true if network is default, false otherwise""" + self.isdefault = None + """"list networks that are persistent""" + self.ispersistent = None + """"true if network is system, false otherwise""" + self.issystem = None + """"the name of the network""" + self.name = None + """"the network's netmask""" + self.netmask = None + """"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" + self.networkcidr = None + """"the network domain""" + self.networkdomain = None + """"availability of the network offering the network is created from""" + self.networkofferingavailability = None + """"true if network offering is ip conserve mode enabled""" + self.networkofferingconservemode = None + """"display text of the network offering the network is created from""" + self.networkofferingdisplaytext = None + """"network offering id the network is created from""" + self.networkofferingid = None + """"name of the network offering the network is created from""" + self.networkofferingname = None + """"the physical network id""" + self.physicalnetworkid = None + """"the project name of the address""" + self.project = None + """"the project id of the ipaddress""" + self.projectid = None + """"related to what other network configuration""" + self.related = None + """"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" + self.reservediprange = None + """"true network requires restart""" + self.restartrequired = None + """"true if network supports specifying ip ranges, false otherwise""" + self.specifyipranges = None + """"state of the network""" + self.state = None + """"true if users from subdomains can access the domain level network""" + self.subdomainaccess = None + """"the traffic type of the network""" + self.traffictype = None + """"the type of the network""" + self.type = None + """"The vlan of the network. This parameter is visible to ROOT admins only""" + self.vlan = None + """"VPC the network belongs to""" + self.vpcid = None + """"zone id of the network""" + self.zoneid = None + """"the name of the zone the network belongs to""" + self.zonename = None + """"the list of services""" + self.service = [] + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + """"the list of resource tags associated with network""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPCOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPCOffering.py new file mode 100644 index 00000000000..aab8917335c --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPCOffering.py @@ -0,0 +1,107 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates VPC offering""" +from baseCmd import * +from baseResponse import * +class updateVPCOfferingCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the id of the VPC offering""" + """Required""" + self.id = None + """the display text of the VPC offering""" + self.displaytext = None + """the name of the VPC offering""" + self.name = None + """update state for the VPC offering; supported states - Enabled/Disabled""" + self.state = None + self.required = ["id",] + +class updateVPCOfferingResponse (baseResponse): + def __init__(self): + """the id of the vpc offering""" + self.id = None + """the date this vpc offering was created""" + self.created = None + """an alternate display text of the vpc offering.""" + self.displaytext = None + """true if vpc offering is default, false otherwise""" + self.isdefault = None + """the name of the vpc offering""" + self.name = None + """state of the vpc offering. Can be Disabled/Enabled""" + self.state = None + """the list of supported services""" + self.service = [] + +class capability: + def __init__(self): + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + +class provider: + def __init__(self): + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + +class service: + def __init__(self): + """"the service name""" + self.name = None + """"the list of capabilities""" + self.capability = [] + """"can this service capability value can be choosable while creatine network offerings""" + self.canchooseservicecapability = None + """"the capability name""" + self.name = None + """"the capability value""" + self.value = None + """"the service provider name""" + self.provider = [] + """"uuid of the network provider""" + self.id = None + """"true if individual services can be enabled/disabled""" + self.canenableindividualservice = None + """"the destination physical network""" + self.destinationphysicalnetworkid = None + """"the provider name""" + self.name = None + """"the physical network this belongs to""" + self.physicalnetworkid = None + """"services for this provider""" + self.servicelist = None + """"state of the network provider""" + self.state = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVirtualMachine.py new file mode 100644 index 00000000000..b1ad6e4193b --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVirtualMachine.py @@ -0,0 +1,383 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates properties of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect. UpdateVirtualMachine does not first check whether the VM is stopped. Therefore, stop the VM manually before issuing this call.""" +from baseCmd import * +from baseResponse import * +class updateVirtualMachineCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """The ID of the virtual machine""" + """Required""" + self.id = None + """user generated name""" + self.displayname = None + """an optional field, whether to the display the vm to the end user or not.""" + self.displayvm = None + """group of the virtual machine""" + self.group = None + """true if high-availability is enabled for the virtual machine, false otherwise""" + self.haenable = None + """true if VM contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" + self.isdynamicallyscalable = None + """the ID of the OS type that best represents this VM.""" + self.ostypeid = None + """an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding. Using HTTP POST(via POST body), you can send up to 32K of data after base64 encoding.""" + self.userdata = None + self.required = ["id",] + +class updateVirtualMachineResponse (baseResponse): + def __init__(self): + """the ID of the virtual machine""" + self.id = None + """the account associated with the virtual machine""" + self.account = None + """the number of cpu this virtual machine is running with""" + self.cpunumber = None + """the speed of each cpu""" + self.cpuspeed = None + """the amount of the vm's CPU currently used""" + self.cpuused = None + """the date when this virtual machine was created""" + self.created = None + """the read (io) of disk on the vm""" + self.diskioread = None + """the write (io) of disk on the vm""" + self.diskiowrite = None + """the read (bytes) of disk on the vm""" + self.diskkbsread = None + """the write (bytes) of disk on the vm""" + self.diskkbswrite = None + """user generated name. The name of the virtual machine is returned if no displayname exists.""" + self.displayname = None + """an optional field whether to the display the vm to the end user or not.""" + self.displayvm = None + """the name of the domain in which the virtual machine exists""" + self.domain = None + """the ID of the domain in which the virtual machine exists""" + self.domainid = None + """the virtual network for the service offering""" + self.forvirtualnetwork = None + """the group name of the virtual machine""" + self.group = None + """the group ID of the virtual machine""" + self.groupid = None + """Os type ID of the virtual machine""" + self.guestosid = None + """true if high-availability is enabled, false otherwise""" + self.haenable = None + """the ID of the host for the virtual machine""" + self.hostid = None + """the name of the host for the virtual machine""" + self.hostname = None + """the hypervisor on which the template runs""" + self.hypervisor = None + """instance name of the user vm; this parameter is returned to the ROOT admin only""" + self.instancename = None + """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" + self.isdynamicallyscalable = None + """an alternate display text of the ISO attached to the virtual machine""" + self.isodisplaytext = None + """the ID of the ISO attached to the virtual machine""" + self.isoid = None + """the name of the ISO attached to the virtual machine""" + self.isoname = None + """ssh key-pair""" + self.keypair = None + """the memory allocated for the virtual machine""" + self.memory = None + """the name of the virtual machine""" + self.name = None + """the incoming network traffic on the vm""" + self.networkkbsread = None + """the outgoing network traffic on the host""" + self.networkkbswrite = None + """the password (if exists) of the virtual machine""" + self.password = None + """true if the password rest feature is enabled, false otherwise""" + self.passwordenabled = None + """the project name of the vm""" + self.project = None + """the project id of the vm""" + self.projectid = None + """public IP address id associated with vm via Static nat rule""" + self.publicip = None + """public IP address id associated with vm via Static nat rule""" + self.publicipid = None + """device ID of the root volume""" + self.rootdeviceid = None + """device type of the root volume""" + self.rootdevicetype = None + """the ID of the service offering of the virtual machine""" + self.serviceofferingid = None + """the name of the service offering of the virtual machine""" + self.serviceofferingname = None + """State of the Service from LB rule""" + self.servicestate = None + """the state of the virtual machine""" + self.state = None + """an alternate display text of the template for the virtual machine""" + self.templatedisplaytext = None + """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" + self.templateid = None + """the name of the template for the virtual machine""" + self.templatename = None + """the ID of the availablility zone for the virtual machine""" + self.zoneid = None + """the name of the availability zone for the virtual machine""" + self.zonename = None + """list of affinity groups associated with the virtual machine""" + self.affinitygroup = [] + """the list of nics associated with vm""" + self.nic = [] + """list of security groups associated with the virtual machine""" + self.securitygroup = [] + """the list of resource tags associated with vm""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class affinitygroup: + def __init__(self): + """"the ID of the affinity group""" + self.id = None + """"the account owning the affinity group""" + self.account = None + """"the description of the affinity group""" + self.description = None + """"the domain name of the affinity group""" + self.domain = None + """"the domain ID of the affinity group""" + self.domainid = None + """"the name of the affinity group""" + self.name = None + """"the type of the affinity group""" + self.type = None + """"virtual machine Ids associated with this affinity group""" + self.virtualmachineIds = None + +class nic: + def __init__(self): + """"the ID of the nic""" + self.id = None + """"the broadcast uri of the nic""" + self.broadcasturi = None + """"the gateway of the nic""" + self.gateway = None + """"the IPv6 address of network""" + self.ip6address = None + """"the cidr of IPv6 network""" + self.ip6cidr = None + """"the gateway of IPv6 network""" + self.ip6gateway = None + """"the ip address of the nic""" + self.ipaddress = None + """"true if nic is default, false otherwise""" + self.isdefault = None + """"the isolation uri of the nic""" + self.isolationuri = None + """"true if nic is default, false otherwise""" + self.macaddress = None + """"the netmask of the nic""" + self.netmask = None + """"the ID of the corresponding network""" + self.networkid = None + """"the name of the corresponding network""" + self.networkname = None + """"the Secondary ipv4 addr of nic""" + self.secondaryip = None + """"the traffic type of the nic""" + self.traffictype = None + """"the type of the nic""" + self.type = None + +class egressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class ingressrule: + def __init__(self): + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + +class securitygroup: + def __init__(self): + """"the ID of the security group""" + self.id = None + """"the account owning the security group""" + self.account = None + """"the description of the security group""" + self.description = None + """"the domain name of the security group""" + self.domain = None + """"the domain ID of the security group""" + self.domainid = None + """"the name of the security group""" + self.name = None + """"the project name of the group""" + self.project = None + """"the project id of the group""" + self.projectid = None + """"the list of egress rules associated with the security group""" + self.egressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of ingress rules associated with the security group""" + self.ingressrule = [] + """"account owning the security group rule""" + self.account = None + """"the CIDR notation for the base IP address of the security group rule""" + self.cidr = None + """"the ending IP of the security group rule""" + self.endport = None + """"the code for the ICMP message response""" + self.icmpcode = None + """"the type of the ICMP message response""" + self.icmptype = None + """"the protocol of the security group rule""" + self.protocol = None + """"the id of the security group rule""" + self.ruleid = None + """"security group name""" + self.securitygroupname = None + """"the starting IP of the security group rule""" + self.startport = None + """"the list of resource tags associated with the rule""" + self.tags = [] + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + """"the ID of the latest async job acting on this object""" + self.jobid = None + """"the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVolume.py new file mode 100644 index 00000000000..5955ec1e4e1 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVolume.py @@ -0,0 +1,150 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates the volume.""" +from baseCmd import * +from baseResponse import * +class updateVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """an optional field, whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the ID of the disk volume""" + self.id = None + """The path of the volume""" + self.path = None + """The state of the volume""" + self.state = None + """Destination storage pool UUID for the volume""" + self.storageid = None + self.required = [] + +class updateVolumeResponse (baseResponse): + def __init__(self): + """ID of the disk volume""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the date the volume was attached to a VM instance""" + self.attached = None + """the date the disk volume was created""" + self.created = None + """the boolean state of whether the volume is destroyed or not""" + self.destroyed = None + """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" + self.deviceid = None + """bytes read rate of the disk volume""" + self.diskBytesReadRate = None + """bytes write rate of the disk volume""" + self.diskBytesWriteRate = None + """io requests read rate of the disk volume""" + self.diskIopsReadRate = None + """io requests write rate of the disk volume""" + self.diskIopsWriteRate = None + """the display text of the disk offering""" + self.diskofferingdisplaytext = None + """ID of the disk offering""" + self.diskofferingid = None + """name of the disk offering""" + self.diskofferingname = None + """an optional field whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """Hypervisor the volume belongs to""" + self.hypervisor = None + """true if the volume is extractable, false otherwise""" + self.isextractable = None + """max iops of the disk volume""" + self.maxiops = None + """min iops of the disk volume""" + self.miniops = None + """name of the disk volume""" + self.name = None + """The path of the volume""" + self.path = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the display text of the service offering for root disk""" + self.serviceofferingdisplaytext = None + """ID of the service offering for root disk""" + self.serviceofferingid = None + """name of the service offering for root disk""" + self.serviceofferingname = None + """size of the disk volume""" + self.size = None + """ID of the snapshot from which this volume was created""" + self.snapshotid = None + """the state of the disk volume""" + self.state = None + """the status of the volume""" + self.status = None + """name of the primary storage hosting the disk volume""" + self.storage = None + """id of the primary storage hosting the disk volume; returned to admin user only""" + self.storageid = None + """shared or local storage""" + self.storagetype = None + """type of the disk volume (ROOT or DATADISK)""" + self.type = None + """id of the virtual machine""" + self.virtualmachineid = None + """display name of the virtual machine""" + self.vmdisplayname = None + """name of the virtual machine""" + self.vmname = None + """state of the virtual machine""" + self.vmstate = None + """ID of the availability zone""" + self.zoneid = None + """name of the availability zone""" + self.zonename = None + """the list of resource tags associated with volume""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVpnCustomerGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVpnCustomerGateway.py new file mode 100644 index 00000000000..959473a382d --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVpnCustomerGateway.py @@ -0,0 +1,93 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Update site to site vpn customer gateway""" +from baseCmd import * +from baseResponse import * +class updateVpnCustomerGatewayCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """id of customer gateway""" + """Required""" + self.id = None + """guest cidr of the customer gateway""" + """Required""" + self.cidrlist = None + """ESP policy of the customer gateway""" + """Required""" + self.esppolicy = None + """public ip address id of the customer gateway""" + """Required""" + self.gateway = None + """IKE policy of the customer gateway""" + """Required""" + self.ikepolicy = None + """IPsec Preshared-Key of the customer gateway""" + """Required""" + self.ipsecpsk = None + """the account associated with the gateway. Must be used with the domainId parameter.""" + self.account = None + """the domain ID associated with the gateway. If used with the account parameter returns the gateway associated with the account for the specified domain.""" + self.domainid = None + """If DPD is enabled for VPN connection""" + self.dpd = None + """Lifetime of phase 2 VPN connection to the customer gateway, in seconds""" + self.esplifetime = None + """Lifetime of phase 1 VPN connection to the customer gateway, in seconds""" + self.ikelifetime = None + """name of this customer gateway""" + self.name = None + self.required = ["id","cidrlist","esppolicy","gateway","ikepolicy","ipsecpsk",] + +class updateVpnCustomerGatewayResponse (baseResponse): + def __init__(self): + """the vpn gateway ID""" + self.id = None + """the owner""" + self.account = None + """guest cidr list of the customer gateway""" + self.cidrlist = None + """the domain name of the owner""" + self.domain = None + """the domain id of the owner""" + self.domainid = None + """if DPD is enabled for customer gateway""" + self.dpd = None + """Lifetime of ESP SA of customer gateway""" + self.esplifetime = None + """IPsec policy of customer gateway""" + self.esppolicy = None + """public ip address id of the customer gateway""" + self.gateway = None + """Lifetime of IKE SA of customer gateway""" + self.ikelifetime = None + """IKE policy of customer gateway""" + self.ikepolicy = None + """guest ip of the customer gateway""" + self.ipaddress = None + """IPsec preshared-key of customer gateway""" + self.ipsecpsk = None + """name of the customer gateway""" + self.name = None + """the project name""" + self.project = None + """the project id""" + self.projectid = None + """the date and time the host was removed""" + self.removed = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateZone.py new file mode 100644 index 00000000000..b1b436007b3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/updateZone.py @@ -0,0 +1,154 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Updates a Zone.""" +from baseCmd import * +from baseResponse import * +class updateZoneCmd (baseCmd): + def __init__(self): + self.isAsync = "false" + """the ID of the Zone""" + """Required""" + self.id = None + """Allocation state of this cluster for allocation of new resources""" + self.allocationstate = None + """the details for the Zone""" + self.details = [] + """the dhcp Provider for the Zone""" + self.dhcpprovider = None + """the first DNS for the Zone""" + self.dns1 = None + """the second DNS for the Zone""" + self.dns2 = None + """the dns search order list""" + self.dnssearchorder = [] + """Network domain name for the networks in the zone; empty string will update domain with NULL value""" + self.domain = None + """the guest CIDR address for the Zone""" + self.guestcidraddress = None + """the first internal DNS for the Zone""" + self.internaldns1 = None + """the second internal DNS for the Zone""" + self.internaldns2 = None + """the first DNS for IPv6 network in the Zone""" + self.ip6dns1 = None + """the second DNS for IPv6 network in the Zone""" + self.ip6dns2 = None + """updates a private zone to public if set, but not vice-versa""" + self.ispublic = None + """true if local storage offering enabled, false otherwise""" + self.localstorageenabled = None + """the name of the Zone""" + self.name = None + self.required = ["id",] + +class updateZoneResponse (baseResponse): + def __init__(self): + """Zone id""" + self.id = None + """the allocation state of the cluster""" + self.allocationstate = None + """Zone description""" + self.description = None + """the dhcp Provider for the Zone""" + self.dhcpprovider = None + """the display text of the zone""" + self.displaytext = None + """the first DNS for the Zone""" + self.dns1 = None + """the second DNS for the Zone""" + self.dns2 = None + """Network domain name for the networks in the zone""" + self.domain = None + """the UUID of the containing domain, null for public zones""" + self.domainid = None + """the name of the containing domain, null for public zones""" + self.domainname = None + """the guest CIDR address for the Zone""" + self.guestcidraddress = None + """the first internal DNS for the Zone""" + self.internaldns1 = None + """the second internal DNS for the Zone""" + self.internaldns2 = None + """the first IPv6 DNS for the Zone""" + self.ip6dns1 = None + """the second IPv6 DNS for the Zone""" + self.ip6dns2 = None + """true if local storage offering enabled, false otherwise""" + self.localstorageenabled = None + """Zone name""" + self.name = None + """the network type of the zone; can be Basic or Advanced""" + self.networktype = None + """true if security groups support is enabled, false otherwise""" + self.securitygroupsenabled = None + """the vlan range of the zone""" + self.vlan = None + """Zone Token""" + self.zonetoken = None + """the capacity of the Zone""" + self.capacity = [] + """the list of resource tags associated with zone.""" + self.tags = [] + +class capacity: + def __init__(self): + """"the total capacity available""" + self.capacitytotal = None + """"the capacity currently in use""" + self.capacityused = None + """"the Cluster ID""" + self.clusterid = None + """"the Cluster name""" + self.clustername = None + """"the percentage of capacity currently in use""" + self.percentused = None + """"the Pod ID""" + self.podid = None + """"the Pod name""" + self.podname = None + """"the capacity type""" + self.type = None + """"the Zone ID""" + self.zoneid = None + """"the Zone name""" + self.zonename = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/uploadCustomCertificate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/uploadCustomCertificate.py new file mode 100644 index 00000000000..d84f448fa52 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/uploadCustomCertificate.py @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Uploads a custom certificate for the console proxy VMs to use for SSL. Can be used to upload a single certificate signed by a known CA. Can also be used, through multiple calls, to upload a chain of certificates from CA to the custom certificate itself.""" +from baseCmd import * +from baseResponse import * +class uploadCustomCertificateCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """The certificate to be uploaded.""" + """Required""" + self.certificate = None + """DNS domain suffix that the certificate is granted for.""" + """Required""" + self.domainsuffix = None + """An integer providing the location in a chain that the certificate will hold. Usually, this can be left empty. When creating a chain, the top level certificate should have an ID of 1, with each step in the chain incrementing by one. Example, CA with id = 1, Intermediate CA with id = 2, Site certificate with ID = 3""" + self.id = None + """A name / alias for the certificate.""" + self.name = None + """The private key for the attached certificate.""" + self.privatekey = None + self.required = ["certificate","domainsuffix",] + +class uploadCustomCertificateResponse (baseResponse): + def __init__(self): + """message of the certificate upload operation""" + self.message = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/uploadVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/uploadVolume.py new file mode 100644 index 00000000000..acd4a0ebb86 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackAPI/uploadVolume.py @@ -0,0 +1,162 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +"""Uploads a data disk.""" +from baseCmd import * +from baseResponse import * +class uploadVolumeCmd (baseCmd): + def __init__(self): + self.isAsync = "true" + """the format for the volume. Possible values include QCOW2, OVA, and VHD.""" + """Required""" + self.format = None + """the name of the volume""" + """Required""" + self.name = None + """the URL of where the volume is hosted. Possible URL include http:// and https://""" + """Required""" + self.url = None + """the ID of the zone the volume is to be hosted on""" + """Required""" + self.zoneid = None + """an optional accountName. Must be used with domainId.""" + self.account = None + """the MD5 checksum value of this volume""" + self.checksum = None + """an optional domainId. If the account parameter is used, domainId must also be used.""" + self.domainid = None + """Image store uuid""" + self.imagestoreuuid = None + """Upload volume for the project""" + self.projectid = None + self.required = ["format","name","url","zoneid",] + +class uploadVolumeResponse (baseResponse): + def __init__(self): + """ID of the disk volume""" + self.id = None + """the account associated with the disk volume""" + self.account = None + """the date the volume was attached to a VM instance""" + self.attached = None + """the date the disk volume was created""" + self.created = None + """the boolean state of whether the volume is destroyed or not""" + self.destroyed = None + """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" + self.deviceid = None + """bytes read rate of the disk volume""" + self.diskBytesReadRate = None + """bytes write rate of the disk volume""" + self.diskBytesWriteRate = None + """io requests read rate of the disk volume""" + self.diskIopsReadRate = None + """io requests write rate of the disk volume""" + self.diskIopsWriteRate = None + """the display text of the disk offering""" + self.diskofferingdisplaytext = None + """ID of the disk offering""" + self.diskofferingid = None + """name of the disk offering""" + self.diskofferingname = None + """an optional field whether to the display the volume to the end user or not.""" + self.displayvolume = None + """the domain associated with the disk volume""" + self.domain = None + """the ID of the domain associated with the disk volume""" + self.domainid = None + """Hypervisor the volume belongs to""" + self.hypervisor = None + """true if the volume is extractable, false otherwise""" + self.isextractable = None + """max iops of the disk volume""" + self.maxiops = None + """min iops of the disk volume""" + self.miniops = None + """name of the disk volume""" + self.name = None + """The path of the volume""" + self.path = None + """the project name of the vpn""" + self.project = None + """the project id of the vpn""" + self.projectid = None + """the display text of the service offering for root disk""" + self.serviceofferingdisplaytext = None + """ID of the service offering for root disk""" + self.serviceofferingid = None + """name of the service offering for root disk""" + self.serviceofferingname = None + """size of the disk volume""" + self.size = None + """ID of the snapshot from which this volume was created""" + self.snapshotid = None + """the state of the disk volume""" + self.state = None + """the status of the volume""" + self.status = None + """name of the primary storage hosting the disk volume""" + self.storage = None + """id of the primary storage hosting the disk volume; returned to admin user only""" + self.storageid = None + """shared or local storage""" + self.storagetype = None + """type of the disk volume (ROOT or DATADISK)""" + self.type = None + """id of the virtual machine""" + self.virtualmachineid = None + """display name of the virtual machine""" + self.vmdisplayname = None + """name of the virtual machine""" + self.vmname = None + """state of the virtual machine""" + self.vmstate = None + """ID of the availability zone""" + self.zoneid = None + """name of the availability zone""" + self.zonename = None + """the list of resource tags associated with volume""" + self.tags = [] + """the ID of the latest async job acting on this object""" + self.jobid = None + """the current status of the latest async job acting on this object""" + self.jobstatus = None + +class tags: + def __init__(self): + """"the account associated with the tag""" + self.account = None + """"customer associated with the tag""" + self.customer = None + """"the domain associated with the tag""" + self.domain = None + """"the ID of the domain associated with the tag""" + self.domainid = None + """"tag key name""" + self.key = None + """"the project name where tag belongs to""" + self.project = None + """"the project id the tag belongs to""" + self.projectid = None + """"id of the resource""" + self.resourceid = None + """"resource type""" + self.resourcetype = None + """"tag value""" + self.value = None + diff --git a/tools/marvin/build/lib/marvin/cloudstackConnection.py b/tools/marvin/build/lib/marvin/cloudstackConnection.py new file mode 100644 index 00000000000..686c533b86a --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackConnection.py @@ -0,0 +1,235 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 requests +import urllib +import base64 +import hmac +import hashlib +import logging +import time +import cloudstackException +from cloudstackAPI import * +import jsonHelper +from requests import ConnectionError +from requests import HTTPError +from requests import Timeout +from requests import RequestException + + +class cloudConnection(object): + + """ Connections to make API calls to the cloudstack management server + """ + + def __init__(self, mgtSvr, port=8096, user=None, passwd=None, + apiKey=None, securityKey=None, + asyncTimeout=3600, logging=None, scheme='http', + path='client/api'): + self.loglevel() # Turn off requests logs + self.apiKey = apiKey + self.securityKey = securityKey + self.mgtSvr = mgtSvr + self.port = port + self.user = user + self.passwd = passwd + self.logging = logging + self.path = path + self.retries = 5 + self.asyncTimeout = asyncTimeout + self.auth = True + if port == 8096 or \ + (self.apiKey is None and self.securityKey is None): + self.auth = False + if scheme not in ['http', 'https']: + raise RequestException("Protocol must be HTTP") + self.protocol = scheme + self.baseurl = "%s://%s:%d/%s"\ + % (self.protocol, self.mgtSvr, self.port, self.path) + + def __copy__(self): + return cloudConnection(self.mgtSvr, self.port, self.user, self.passwd, + self.apiKey, self.securityKey, + self.asyncTimeout, self.logging, self.protocol, + self.path) + + def loglevel(self, lvl=logging.WARNING): + """ + Turns off the INFO/DEBUG logs from `requests` + """ + requests_log = logging.getLogger("requests") + requests_log.setLevel(lvl) + + def poll(self, jobid, response): + """ + polls the completion of a given jobid + @param jobid: + @param response: + @return: + """ + cmd = queryAsyncJobResult.queryAsyncJobResultCmd() + cmd.jobid = jobid + timeout = self.asyncTimeout + + while timeout > 0: + asyncResonse = self.marvin_request(cmd, response_type=response) + + if asyncResonse.jobstatus == 2: + raise cloudstackException.cloudstackAPIException( + "asyncquery", asyncResonse.jobresult) + elif asyncResonse.jobstatus == 1: + return asyncResonse + + time.sleep(5) + if self.logging is not None: + self.logging.debug("job: %s still processing," + " will timeout in %ds" % (jobid, timeout)) + timeout = timeout - 5 + + raise cloudstackException.cloudstackAPIException( + "asyncquery", "Async job timeout %s" % jobid) + + def sign(self, payload): + """ + signs a given request URL when the apiKey and secretKey are known + + @param payload: dict of GET params to be signed + @return: the signature of the payload + """ + params = zip(payload.keys(), payload.values()) + params.sort(key=lambda k: str.lower(k[0])) + hashStr = "&".join( + ["=".join( + [str.lower(r[0]), + str.lower( + urllib.quote_plus(str(r[1])) + ).replace("+", "%20")] + ) for r in params] + ) + signature = base64.encodestring(hmac.new( + self.securityKey, hashStr, hashlib.sha1).digest()).strip() + self.logging.debug("Computed Signature by Marvin: %s" % signature) + return signature + + def request(self, command, auth=True, payload={}, method='GET'): + """ + Makes requests using auth or over integration port + @param command: cloudstack API command name + eg: deployVirtualMachineCommand + @param auth: Authentication (apikey,secretKey) => True + else False for integration.api.port + @param payload: request data composed as a dictionary + @param method: GET/POST via HTTP + @return: + """ + payload["command"] = command + payload["response"] = "json" + + if auth: + payload["apiKey"] = self.apiKey + signature = self.sign(payload) + payload["signature"] = signature + + try: + if method == 'POST': + response = requests.post( + self.baseurl, params=payload, verify=False) + else: + response = requests.get( + self.baseurl, params=payload, verify=False) + except ConnectionError, c: + self.logging.debug("Connection refused. Reason: %s : %s" % + (self.baseurl, c)) + raise c + except HTTPError, h: + self.logging.debug("Server returned error code: %s" % h) + raise h + except Timeout, t: + self.logging.debug("Connection timed out with %s" % t) + raise t + except RequestException, r: + self.logging.debug("Error returned by server %s" % r) + raise r + else: + return response + + def sanitize_command(self, cmd): + """ + Removes None values, Validates all required params are present + @param cmd: Cmd object eg: createPhysicalNetwork + @return: + """ + requests = {} + required = [] + for attribute in dir(cmd): + if not attribute.startswith('__'): + if attribute == "isAsync": + isAsync = getattr(cmd, attribute) + elif attribute == "required": + required = getattr(cmd, attribute) + else: + requests[attribute] = getattr(cmd, attribute) + + cmdname = cmd.__class__.__name__.replace("Cmd", "") + for requiredPara in required: + if requests[requiredPara] is None: + raise cloudstackException.cloudstackAPIException( + cmdname, "%s is required" % requiredPara) + for param, value in requests.items(): + if value is None: + requests.pop(param) + elif isinstance(value, list): + if len(value) == 0: + requests.pop(param) + else: + if not isinstance(value[0], dict): + requests[param] = ",".join(value) + else: + requests.pop(param) + i = 0 + for val in value: + for k, v in val.iteritems(): + requests["%s[%d].%s" % (param, i, k)] = v + i = i + 1 + return cmdname, isAsync, requests + + def marvin_request(self, cmd, response_type=None, method='GET', data=''): + """ + Requester for marvin command objects + @param cmd: marvin's command from cloudstackAPI + @param response_type: response type of the command in cmd + @param method: HTTP GET/POST, defaults to GET + @return: + """ + cmdname, isAsync, payload = self.sanitize_command(cmd) + self.logging.debug("sending %s request: %s %s" % (method, cmdname, + str(payload))) + response = self.request( + cmdname, self.auth, payload=payload, method=method) + self.logging.debug("Request: %s Response: %s" % + (response.url, response.text)) + try: + response = jsonHelper.getResultObj(response.json(), response_type) + except TypeError: + response = jsonHelper.getResultObj(response.json, response_type) + + if isAsync == "false": + return response + else: + asyncJobId = response.jobid + response = self.poll(asyncJobId, response_type) + return response.jobresult diff --git a/tools/marvin/build/lib/marvin/cloudstackException.py b/tools/marvin/build/lib/marvin/cloudstackException.py new file mode 100644 index 00000000000..6200003bbc3 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackException.py @@ -0,0 +1,48 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +class cloudstackAPIException(Exception): + def __init__(self, cmd="", result=""): + self.errorMsg = "Execute cmd: %s failed, due to: %s" % (cmd, result) + + def __str__(self): + return self.errorMsg + + +class InvalidParameterException(Exception): + def __init__(self, msg=''): + self.errorMsg = msg + + def __str__(self): + return self.errorMsg + + +class dbException(Exception): + def __init__(self, msg=''): + self.errorMsg = msg + + def __str__(self): + return self.errorMsg + + +class internalError(Exception): + def __init__(self, msg=''): + self.errorMsg = msg + + def __str__(self): + return self.errorMsg diff --git a/tools/marvin/build/lib/marvin/cloudstackTestCase.py b/tools/marvin/build/lib/marvin/cloudstackTestCase.py new file mode 100644 index 00000000000..85ef5423091 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackTestCase.py @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 + + +def user(Name, DomainName, AcctType): + def wrapper(cls): + orig_init = cls.__init__ + + def __init__(self, *args, **kws): + cls.UserName = Name + cls.DomainName = DomainName + cls.AcctType = AcctType + orig_init(self, *args, **kws) + cls.__init__ = __init__ + return cls + return wrapper + + +class cloudstackTestCase(unittest.case.TestCase): + clstestclient = None + + @classmethod + def getClsTestClient(cls): + return cls.clstestclient diff --git a/tools/marvin/build/lib/marvin/cloudstackTestClient.py b/tools/marvin/build/lib/marvin/cloudstackTestClient.py new file mode 100644 index 00000000000..36f7f8d8369 --- /dev/null +++ b/tools/marvin/build/lib/marvin/cloudstackTestClient.py @@ -0,0 +1,201 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 cloudstackConnection +import asyncJobMgr +import dbConnection +from cloudstackAPI import * +import random +import string +import hashlib + + +class cloudstackTestClient(object): + def __init__(self, mgtSvr=None, port=8096, user=None, passwd=None, + apiKey=None, securityKey=None, asyncTimeout=3600, + defaultWorkerThreads=10, logging=None): + self.connection = \ + cloudstackConnection.cloudConnection(mgtSvr, port, user, passwd, + apiKey, securityKey, + asyncTimeout, logging) + self.apiClient =\ + cloudstackAPIClient.CloudStackAPIClient(self.connection) + self.dbConnection = None + self.asyncJobMgr = None + self.ssh = None + self.id = None + self.defaultWorkerThreads = defaultWorkerThreads + + @property + def identifier(self): + return self.id + + @identifier.setter + def identifier(self, id): + self.id = id + + def dbConfigure(self, host="localhost", port=3306, user='cloud', + passwd='cloud', db='cloud'): + self.dbConnection = dbConnection.dbConnection(host, port, user, passwd, + db) + + def isAdminContext(self): + """ + A user is a regular user if he fails to listDomains; + if he is a domain-admin, he can list only domains that are non-ROOT; + if he is an admin, he can list the ROOT domain successfully + """ + try: + listdom = listDomains.listDomainsCmd() + listdom.name = 'ROOT' + listdomres = self.apiClient.listDomains(listdom) + rootdom = listdomres[0].name + if rootdom == 'ROOT': + return 1 # admin + else: + return 2 # domain-admin + except: + return 0 # user + + def random_gen(self, size=6, chars=string.ascii_uppercase + string.digits): + """Generate Random Strings of variable length""" + randomstr = ''.join(random.choice(chars) for x in range(size)) + if self.identifier: + return ''.join([self.identifier, '-', randomstr]) + return randomstr + + def createUserApiClient(self, UserName, DomainName, acctType=0): + if not self.isAdminContext(): + return self.apiClient + + listDomain = listDomains.listDomainsCmd() + listDomain.listall = True + listDomain.name = DomainName + try: + domains = self.apiClient.listDomains(listDomain) + domId = domains[0].id + except: + cdomain = createDomain.createDomainCmd() + cdomain.name = DomainName + domain = self.apiClient.createDomain(cdomain) + domId = domain.id + + cmd = listAccounts.listAccountsCmd() + cmd.name = UserName + cmd.domainid = domId + try: + accounts = self.apiClient.listAccounts(cmd) + acctId = accounts[0].id + except: + createAcctCmd = createAccount.createAccountCmd() + createAcctCmd.accounttype = acctType + createAcctCmd.domainid = domId + createAcctCmd.email = "test-" + self.random_gen()\ + + "@cloudstack.org" + createAcctCmd.firstname = UserName + createAcctCmd.lastname = UserName + createAcctCmd.password = 'password' + createAcctCmd.username = UserName + acct = self.apiClient.createAccount(createAcctCmd) + acctId = acct.id + + listuser = listUsers.listUsersCmd() + listuser.username = UserName + + listuserRes = self.apiClient.listUsers(listuser) + userId = listuserRes[0].id + apiKey = listuserRes[0].apikey + securityKey = listuserRes[0].secretkey + + if apiKey is None: + registerUser = registerUserKeys.registerUserKeysCmd() + registerUser.id = userId + registerUserRes = self.apiClient.registerUserKeys(registerUser) + apiKey = registerUserRes.apikey + securityKey = registerUserRes.secretkey + + newUserConnection =\ + cloudstackConnection.cloudConnection(self.connection.mgtSvr, + self.connection.port, + self.connection.user, + self.connection.passwd, + apiKey, securityKey, + self.connection.asyncTimeout, + self.connection.logging) + self.userApiClient =\ + cloudstackAPIClient.CloudStackAPIClient(newUserConnection) + self.userApiClient.connection = newUserConnection + self.userApiClient.hypervisor = self.apiClient.hypervisor + return self.userApiClient + + def close(self): + if self.connection is not None: + self.connection.close() + + def getDbConnection(self): + return self.dbConnection + + def executeSql(self, sql=None): + if sql is None or self.dbConnection is None: + return None + + return self.dbConnection.execute() + + def executeSqlFromFile(self, sqlFile=None): + if sqlFile is None or self.dbConnection is None: + return None + return self.dbConnection.executeSqlFromFile(sqlFile) + + def getApiClient(self): + self.apiClient.id = self.identifier + return self.apiClient + + def getUserApiClient(self, account, domain, type=0): + """ + 0 - user + 1 - admin + 2 - domain admin + """ + self.createUserApiClient(account, domain, type) + if hasattr(self, "userApiClient"): + return self.userApiClient + return None + + def submitCmdsAndWait(self, cmds, workers=1): + '''FixME, httplib has issue if more than one thread submitted''' + if self.asyncJobMgr is None: + self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, + self.dbConnection) + return self.asyncJobMgr.submitCmdsAndWait(cmds, workers) + + def submitJob(self, job, ntimes=1, nums_threads=10, interval=1): + ''' + submit one job and execute the same job ntimes, with nums_threads + of threads + ''' + if self.asyncJobMgr is None: + self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, + self.dbConnection) + self.asyncJobMgr.submitJobExecuteNtimes(job, ntimes, nums_threads, + interval) + + def submitJobs(self, jobs, nums_threads=10, interval=1): + '''submit n jobs, execute them with nums_threads of threads''' + if self.asyncJobMgr is None: + self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, + self.dbConnection) + self.asyncJobMgr.submitJobs(jobs, nums_threads, interval) diff --git a/tools/marvin/build/lib/marvin/codegenerator.py b/tools/marvin/build/lib/marvin/codegenerator.py new file mode 100644 index 00000000000..96729f6bbfe --- /dev/null +++ b/tools/marvin/build/lib/marvin/codegenerator.py @@ -0,0 +1,463 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 xml.dom.minidom +import json +from optparse import OptionParser +from textwrap import dedent +import os +import sys +import urllib2 + + +class cmdParameterProperty(object): + def __init__(self): + self.name = None + self.required = False + self.desc = "" + self.type = "planObject" + self.subProperties = [] + + +class cloudStackCmd(object): + def __init__(self): + self.name = "" + self.desc = "" + self.async = "false" + self.request = [] + self.response = [] + + +class codeGenerator(object): + """ + Apache CloudStack- marvin python classes can be generated from the json + returned by API discovery or from the xml spec of commands generated by + the ApiDocWriter. This class provides helper methods for these uses. + """ + space = ' ' + newline = '\n' + cmdsName = [] + + def __init__(self, outputFolder): + self.cmd = None + self.code = "" + self.required = [] + self.subclass = [] + self.outputFolder = outputFolder + lic = """\ + # Licensed to the Apache Software Foundation (ASF) under one + # or more contributor license agreements. See the NOTICE file + # distributed with this work for additional information + # regarding copyright ownership. The ASF licenses this file + # to you under the Apache License, Version 2.0 (the + # "License"); you may not use this file except in compliance + # with the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, + # software distributed under the License is distributed on an + # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + # KIND, either express or implied. See the License for the + # specific language governing permissions and limitations + # under the License. + + """ + self.license = dedent(lic) + + def addAttribute(self, attr, pro): + value = pro.value + if pro.required: + self.required.append(attr) + desc = pro.desc + if desc is not None: + self.code += self.space + self.code += "''' " + pro.desc + " '''" + self.code += self.newline + + self.code += self.space + self.code += attr + " = " + str(value) + self.code += self.newline + + def generateSubClass(self, name, properties): + '''generate code for sub list''' + subclass = 'class %s:\n' % name + subclass += self.space + "def __init__(self):\n" + for pro in properties: + if pro.desc is not None: + subclass += self.space + self.space + '""""%s"""\n' % pro.desc + if len(pro.subProperties) > 0: + subclass += self.space + self.space + subclass += 'self.%s = []\n' % pro.name + self.generateSubClass(pro.name, pro.subProperties) + else: + subclass += self.space + self.space + subclass += 'self.%s = None\n' % pro.name + + self.subclass.append(subclass) + + def generate(self, cmd): + + self.cmd = cmd + self.cmdsName.append(self.cmd.name) + self.code = self.license + self.code += self.newline + self.code += '"""%s"""\n' % self.cmd.desc + self.code += 'from baseCmd import *\n' + self.code += 'from baseResponse import *\n' + self.code += "class %sCmd (baseCmd):\n" % self.cmd.name + self.code += self.space + "def __init__(self):\n" + + self.code += self.space + self.space + self.code += 'self.isAsync = "%s"\n' % str(self.cmd.async).lower() + + for req in self.cmd.request: + if req.desc is not None: + self.code += self.space + self.space + '"""%s"""\n' % req.desc + if req.required == "true": + self.code += self.space + self.space + '"""Required"""\n' + + value = "None" + if req.type == "list" or req.type == "map": + value = "[]" + + self.code += self.space + self.space + self.code += 'self.%s = %s\n' % (req.name, value) + if req.required == "true": + self.required.append(req.name) + + self.code += self.space + self.space + "self.required = [" + for require in self.required: + self.code += '"' + require + '",' + self.code += "]\n" + self.required = [] + + """generate response code""" + subItems = {} + self.code += self.newline + self.code += 'class %sResponse (baseResponse):\n' % self.cmd.name + self.code += self.space + "def __init__(self):\n" + if len(self.cmd.response) == 0: + self.code += self.space + self.space + "pass" + else: + for res in self.cmd.response: + if res.desc is not None: + self.code += self.space + self.space + self.code += '"""%s"""\n' % res.desc + + if len(res.subProperties) > 0: + self.code += self.space + self.space + self.code += 'self.%s = []\n' % res.name + self.generateSubClass(res.name, res.subProperties) + else: + self.code += self.space + self.space + self.code += 'self.%s = None\n' % res.name + self.code += self.newline + + for subclass in self.subclass: + self.code += subclass + "\n" + + fp = open(self.outputFolder + "/cloudstackAPI/%s.py" % self.cmd.name, + "w") + fp.write(self.code) + fp.close() + self.code = "" + self.subclass = [] + + def finalize(self): + '''generate an api call''' + + header = '"""Test Client for CloudStack API"""\n' + imports = "import copy\n" + initCmdsList = '__all__ = [' + body = '' + body += "class CloudStackAPIClient(object):\n" + body += self.space + 'def __init__(self, connection):\n' + body += self.space + self.space + 'self.connection = connection\n' + body += self.space + self.space + 'self._id = None\n' + body += self.newline + + body += self.space + 'def __copy__(self):\n' + body += self.space + self.space + body += 'return CloudStackAPIClient(copy.copy(self.connection))\n' + body += self.newline + + # The `id` property will be used to link the test with the cloud + # resource being created + # @property + # def id(self): + # return self._id + # + # @id.setter + # def id(self, identifier): + # self._id = identifier + + body += self.space + '@property' + self.newline + body += self.space + 'def id(self):' + self.newline + body += self.space*2 + 'return self._id' + self.newline + body += self.newline + + body += self.space + '@id.setter' + self.newline + body += self.space + 'def id(self, identifier):' + self.newline + body += self.space*2 + 'self._id = identifier' + self.newline + body += self.newline + + for cmdName in self.cmdsName: + body += self.space + body += 'def %s(self, command, method="GET"):\n' % cmdName + body += self.space + self.space + body += 'response = %sResponse()\n' % cmdName + body += self.space + self.space + body += 'response = self.connection.marvin_request(command,' + body += ' response_type=response, method=method)\n' + body += self.space + self.space + 'return response\n' + body += self.newline + + imports += 'from %s import %sResponse\n' % (cmdName, cmdName) + initCmdsList += '"%s",' % cmdName + + fp = open(self.outputFolder + '/cloudstackAPI/cloudstackAPIClient.py', + 'w') + fp.write(self.license) + for item in [header, imports, body]: + fp.write(item) + fp.close() + + '''generate __init__.py''' + initCmdsList = self.license + initCmdsList + '"cloudstackAPIClient"]' + fp = open(self.outputFolder + '/cloudstackAPI/__init__.py', 'w') + fp.write(initCmdsList) + fp.close() + + fp = open(self.outputFolder + '/cloudstackAPI/baseCmd.py', 'w') + basecmd = self.license + basecmd += '"""Base Command"""\n' + basecmd += 'class baseCmd(object):\n' + basecmd += self.space + 'pass\n' + fp.write(basecmd) + fp.close() + + fp = open(self.outputFolder + '/cloudstackAPI/baseResponse.py', 'w') + basecmd = self.license + basecmd += '"""Base class for response"""\n' + basecmd += 'class baseResponse(object):\n' + basecmd += self.space + 'pass\n' + fp.write(basecmd) + fp.close() + + def constructResponseFromXML(self, response): + paramProperty = cmdParameterProperty() + paramProperty.name = getText(response.getElementsByTagName('name')) + paramProperty.desc = getText(response. + getElementsByTagName('description')) + if paramProperty.name.find('(*)') != -1: + '''This is a list''' + paramProperty.name = paramProperty.name.split('(*)')[0] + argList = response.getElementsByTagName('arguments')[0].\ + getElementsByTagName('arg') + for subresponse in argList: + subProperty = self.constructResponseFromXML(subresponse) + paramProperty.subProperties.append(subProperty) + return paramProperty + + def loadCmdFromXML(self, dom): + cmds = [] + for cmd in dom.getElementsByTagName("command"): + csCmd = cloudStackCmd() + csCmd.name = getText(cmd.getElementsByTagName('name')) + assert csCmd.name + + desc = getText(cmd.getElementsByTagName('description')) + if desc: + csCmd.desc = desc + + async = getText(cmd.getElementsByTagName('isAsync')) + if async: + csCmd.async = async + + argList = cmd.getElementsByTagName("request")[0].\ + getElementsByTagName("arg") + for param in argList: + paramProperty = cmdParameterProperty() + + paramProperty.name =\ + getText(param.getElementsByTagName('name')) + assert paramProperty.name + + required = param.getElementsByTagName('required') + if required: + paramProperty.required = getText(required) + + requestDescription = param.getElementsByTagName('description') + if requestDescription: + paramProperty.desc = getText(requestDescription) + + type = param.getElementsByTagName("type") + if type: + paramProperty.type = getText(type) + + csCmd.request.append(paramProperty) + + responseEle = cmd.getElementsByTagName("response")[0] + for response in responseEle.getElementsByTagName("arg"): + if response.parentNode != responseEle: + continue + + paramProperty = self.constructResponseFromXML(response) + csCmd.response.append(paramProperty) + + cmds.append(csCmd) + return cmds + + def generateCodeFromXML(self, apiSpecFile): + dom = xml.dom.minidom.parse(apiSpecFile) + cmds = self.loadCmdFromXML(dom) + for cmd in cmds: + self.generate(cmd) + self.finalize() + + def constructResponseFromJSON(self, response): + paramProperty = cmdParameterProperty() + if 'name' in response: + paramProperty.name = response['name'] + assert paramProperty.name, "%s has no property name" % response + + if 'description' in response: + paramProperty.desc = response['description'] + if 'type' in response: + if response['type'] in ['list', 'map', 'set']: + #Here list becomes a subproperty + if 'response' in response: + for innerResponse in response['response']: + subProperty =\ + self.constructResponseFromJSON(innerResponse) + paramProperty.subProperties.append(subProperty) + paramProperty.type = response['type'] + return paramProperty + + def loadCmdFromJSON(self, apiStream): + if apiStream is None: + raise Exception("No APIs found through discovery") + + jsonOut = apiStream.readlines() + assert len(jsonOut) > 0 + apiDict = json.loads(jsonOut[0]) + if not 'listapisresponse' in apiDict: + raise Exception("API discovery plugin response failed") + if not 'count' in apiDict['listapisresponse']: + raise Exception("Malformed api response") + + apilist = apiDict['listapisresponse']['api'] + cmds = [] + for cmd in apilist: + csCmd = cloudStackCmd() + if 'name' in cmd: + csCmd.name = cmd['name'] + assert csCmd.name + + if 'description' in cmd: + csCmd.desc = cmd['description'] + + if 'isasync' in cmd: + csCmd.async = cmd['isasync'] + + for param in cmd['params']: + paramProperty = cmdParameterProperty() + + if 'name' in param: + paramProperty.name = param['name'] + assert paramProperty.name + + if 'required' in param: + paramProperty.required = param['required'] + + if 'description' in param: + paramProperty.desc = param['description'] + + if 'type' in param: + paramProperty.type = param['type'] + + csCmd.request.append(paramProperty) + + for response in cmd['response']: + #FIXME: ExtractImage related APIs return empty dicts in response + if len(response) > 0: + paramProperty = self.constructResponseFromJSON(response) + csCmd.response.append(paramProperty) + + cmds.append(csCmd) + return cmds + + def generateCodeFromJSON(self, endpointUrl): + """ + Api Discovery plugin returns the supported APIs of a CloudStack + endpoint. + @return: The classes in cloudstackAPI/ formed from api discovery json + """ + if endpointUrl.find('response=json') >= 0: + apiStream = urllib2.urlopen(endpointUrl) + cmds = self.loadCmdFromJSON(apiStream) + for cmd in cmds: + self.generate(cmd) + self.finalize() + + +def getText(elements): + return elements[0].childNodes[0].nodeValue.strip() + +if __name__ == "__main__": + parser = OptionParser() + parser.add_option("-o", "--output", dest="output", + help="The path to the generated code entities, default\ + is .") + parser.add_option("-s", "--specfile", dest="spec", + help="The path and name of the api spec xml file,\ + default is /etc/cloud/cli/commands.xml") + parser.add_option("-e", "--endpoint", dest="endpoint", + help="The endpoint mgmt server (with open 8096) where\ + apis are discovered, default is localhost") + + (options, args) = parser.parse_args() + + folder = "." + if options.output is not None: + folder = options.output + apiModule = folder + "/cloudstackAPI" + if not os.path.exists(apiModule): + try: + os.mkdir(apiModule) + except: + print "Failed to create folder %s, due to %s" % (apiModule, + sys.exc_info()) + print parser.print_help() + exit(2) + + apiSpecFile = "/etc/cloud/cli/commands.xml" + if options.spec is not None: + apiSpecFile = options.spec + if not os.path.exists(apiSpecFile): + print "the spec file %s does not exists" % apiSpecFile + print parser.print_help() + exit(1) + + cg = codeGenerator(folder) + if options.spec is not None: + cg.generateCodeFromXML(apiSpecFile) + elif options.endpoint is not None: + endpointUrl = 'http://%s:8096/client/api?command=listApis&\ +response=json' % options.endpoint + cg.generateCodeFromJSON(endpointUrl) diff --git a/tools/marvin/build/lib/marvin/configGenerator.py b/tools/marvin/build/lib/marvin/configGenerator.py new file mode 100644 index 00000000000..a966ae089e4 --- /dev/null +++ b/tools/marvin/build/lib/marvin/configGenerator.py @@ -0,0 +1,870 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 json +import os +from optparse import OptionParser +import jsonHelper + + +class managementServer(object): + def __init__(self): + self.mgtSvrIp = None + self.port = 8096 + self.apiKey = None + self.securityKey = None + + +class dbServer(object): + def __init__(self): + self.dbSvr = None + self.port = 3306 + self.user = "cloud" + self.passwd = "cloud" + self.db = "cloud" + + +class configuration(object): + def __init__(self): + self.name = None + self.value = None + + +class logger(object): + def __init__(self): + '''TestCase/TestClient''' + self.name = None + self.file = None + + +class cloudstackConfiguration(object): + def __init__(self): + self.zones = [] + self.mgtSvr = [] + self.dbSvr = None + self.globalConfig = [] + self.logger = [] + + +class zone(object): + def __init__(self): + self.dns1 = None + self.internaldns1 = None + self.name = None + '''Basic or Advanced''' + self.networktype = None + self.dns2 = None + self.internaldns2 = None + self.securitygroupenabled = None + self.localstorageenabled = None + '''default public network, in advanced mode''' + self.ipranges = [] + self.physical_networks = [] + self.pods = [] + self.secondaryStorages = [] + self.cacheStorages = [] + + +class traffictype(object): + def __init__(self, typ, labeldict=None): + self.typ = typ # Guest/Management/Public + if labeldict: + self.xen = labeldict['xen'] if 'xen' in labeldict.keys() else None + self.kvm = labeldict['kvm'] if 'kvm' in labeldict.keys() else None + self.vmware = labeldict['vmware']\ + if 'vmware' in labeldict.keys() else None + self.simulator = labeldict['simulator']\ + if 'simulator' in labeldict.keys() else None + #{ + # 'xen' : 'cloud-xen', + # 'kvm' : 'cloud-kvm', + # 'vmware' : 'cloud-vmware' + #} + + +class pod(object): + def __init__(self): + self.gateway = None + self.name = None + self.netmask = None + self.startip = None + self.endip = None + self.zoneid = None + self.clusters = [] + self.vmwaredc = [] + '''Used in basic network mode''' + self.guestIpRanges = [] + + +class VmwareDc(object): + def __init__(self): + self.zoneid = None + self.name = None + self.vcenter = None + self.username = None + self.password = None + + +class cluster(object): + def __init__(self): + self.clustername = None + self.clustertype = None + self.hypervisor = None + self.zoneid = None + self.podid = None + self.password = None + self.url = None + self.username = None + self.hosts = [] + self.primaryStorages = [] + + +class host(object): + def __init__(self): + self.hypervisor = None + self.password = None + self.url = None + self.username = None + self.zoneid = None + self.podid = None + self.clusterid = None + self.clustername = None + self.cpunumber = None + self.cpuspeed = None + self.hostmac = None + self.hosttags = None + self.memory = None + + +class physical_network(object): + def __init__(self): + self.name = None + self.tags = [] + self.traffictypes = [] + self.broadcastdomainrange = 'Zone' + self.vlan = None + self.isolationmethods = [] + '''enable default virtual router provider''' + vrouter = provider() + vrouter.name = 'VirtualRouter' + self.providers = [vrouter] + + +class provider(object): + def __init__(self, name=None): + self.name = name + self.state = None + self.broadcastdomainrange = 'ZONE' + self.zoneid = None + self.servicelist = [] + self.devices = [] + + +class network(object): + def __init__(self): + self.displaytext = None + self.name = None + self.zoneid = None + self.acltype = None + self.domainid = None + self.networkdomain = None + self.networkofferingid = None + self.ipranges = [] + + +class iprange(object): + def __init__(self): + '''tagged/untagged''' + self.gateway = None + self.netmask = None + self.startip = None + self.endip = None + self.vlan = None + '''for account specific ''' + self.account = None + self.domain = None + + +class primaryStorage(object): + def __init__(self): + self.name = None + self.url = None + + +class secondaryStorage(object): + def __init__(self): + self.url = None + self.provider = None + self.details = None + + +class cacheStorage(object): + def __init__(self): + self.url = None + self.provider = None + self.details = None + + +class s3(object): + def __init__(self): + self.accesskey = None + self.secretkey = None + self.bucket = None + self.endpoint = None + self.sockettimeout = None + self.connectiontimeout = None + self.maxerrorrety = None + self.usehttps = None + + +class netscaler(object): + def __init__(self, hostname=None, username='nsroot', password='nsroot'): + self.hostname = hostname + self.username = username + self.password = password + self.networkdevicetype = 'NetscalerVPXLoadBalancer' + self.publicinterface = '1/1' + self.privateinterface = '1/1' + self.numretries = '2' + self.lbdevicecapacity = '50' + self.lbdevicededicated = 'false' + + def getUrl(self): + return repr(self) + + def __repr__(self): + req = zip(self.__dict__.keys(), self.__dict__.values()) + return self.hostname+"?" + "&".join(["=".join([r[0], r[1]]) + for r in req]) + + +class srx(object): + def __init__(self, hostname=None, username='root', password='admin'): + self.hostname = hostname + self.username = username + self.password = password + self.networkdevicetype = 'JuniperSRXFirewall' + self.publicinterface = '1/1' + self.privateinterface = '1/1' + self.numretries = '2' + self.fwdevicededicated = 'false' + self.timeout = '300' + self.publicnetwork = 'untrusted' + self.privatenetwork = 'trusted' + + def getUrl(self): + return repr(self) + + def __repr__(self): + req = zip(self.__dict__.keys(), self.__dict__.values()) + return self.hostname+"?" + "&".join(["=".join([r[0], r[1]]) + for r in req]) + + +class bigip(object): + def __init__(self, hostname=None, username='root', password='default'): + self.hostname = hostname + self.username = username + self.password = password + self.networkdevicetype = 'F5BigIpLoadBalancer' + self.publicinterface = '1/1' + self.privateinterface = '1/1' + self.numretries = '2' + self.lbdevicededicated = 'false' + self.lbdevicecapacity = '50' + + def getUrl(self): + return repr(self) + + def __repr__(self): + req = zip(self.__dict__.keys(), self.__dict__.values()) + return self.hostname+"?" + "&".join(["=".join([r[0], r[1]]) + for r in req]) + + +def getDeviceUrl(obj): + req = zip(obj.__dict__.keys(), obj.__dict__.values()) + if obj.hostname: + return "http://" + obj.hostname+"?" + "&".join(["=".join([r[0], + r[1]]) + for r in req]) + else: + return None + + +def describe_setup_in_basic_mode(): + '''sample code to generate setup configuration file''' + zs = cloudstackConfiguration() + + for l in range(1): + z = zone() + z.dns1 = "8.8.8.8" + z.dns2 = "8.8.4.4" + z.internaldns1 = "192.168.110.254" + z.internaldns2 = "192.168.110.253" + z.name = "test"+str(l) + z.networktype = 'Basic' + z.securitygroupenabled = 'True' + + #If security groups are reqd + sgprovider = provider() + sgprovider.broadcastdomainrange = 'Pod' + sgprovider.name = 'SecurityGroupProvider' + + pn = physical_network() + pn.name = "test-network" + pn.traffictypes = [traffictype("Guest"), traffictype("Management")] + pn.providers.append(sgprovider) + + z.physical_networks.append(pn) + + '''create 10 pods''' + for i in range(2): + p = pod() + p.name = "test" + str(l) + str(i) + p.gateway = "192.168.%d.1" % i + p.netmask = "255.255.255.0" + p.startip = "192.168.%d.150" % i + p.endip = "192.168.%d.220" % i + + '''add two pod guest ip ranges''' + for j in range(2): + ip = iprange() + ip.gateway = p.gateway + ip.netmask = p.netmask + ip.startip = "192.168.%d.%d" % (i, j*20) + ip.endip = "192.168.%d.%d" % (i, j*20+10) + + p.guestIpRanges.append(ip) + + '''add 10 clusters''' + for j in range(2): + c = cluster() + c.clustername = "test"+str(l)+str(i) + str(j) + c.clustertype = "CloudManaged" + c.hypervisor = "Simulator" + + '''add 10 hosts''' + for k in range(2): + h = host() + h.username = "root" + h.password = "password" + memory = 8*1024*1024*1024 + localstorage = 1*1024*1024*1024*1024 + h.url = "http://sim/%d%d%d%d" % (l, i, j, k) + c.hosts.append(h) + + '''add 2 primary storages''' + for m in range(2): + primary = primaryStorage() + primary.name = "primary"+str(l) + str(i) + str(j) + str(m) + primary.url = "nfs://localhost/path%s" % (str(l) + str(i) + + str(j) + str(m)) + c.primaryStorages.append(primary) + + p.clusters.append(c) + + z.pods.append(p) + + '''add two secondary''' + for i in range(5): + secondary = secondaryStorage() + secondary.url = "nfs://localhost/path"+str(l) + str(i) + z.secondaryStorages.append(secondary) + + zs.zones.append(z) + + '''Add one mgt server''' + mgt = managementServer() + mgt.mgtSvrIp = "localhost" + zs.mgtSvr.append(mgt) + + '''Add a database''' + db = dbServer() + db.dbSvr = "localhost" + + zs.dbSvr = db + + '''add global configuration''' + global_settings = {'expunge.delay': '60', + 'expunge.interval': '60', + 'expunge.workers': '3', + } + for k, v in global_settings.iteritems(): + cfg = configuration() + cfg.name = k + cfg.value = v + zs.globalConfig.append(cfg) + + ''''add loggers''' + testClientLogger = logger() + testClientLogger.name = "TestClient" + testClientLogger.file = "/tmp/testclient.log" + + testCaseLogger = logger() + testCaseLogger.name = "TestCase" + testCaseLogger.file = "/tmp/testcase.log" + + zs.logger.append(testClientLogger) + zs.logger.append(testCaseLogger) + + return zs + + +def describe_setup_in_eip_mode(): + """ + Setting up an EIP/ELB enabled zone with netscaler provider + """ + zs = cloudstackConfiguration() + + for l in range(1): + z = zone() + z.dns1 = "8.8.8.8" + z.dns2 = "8.8.4.4" + z.internaldns1 = "192.168.110.254" + z.internaldns2 = "192.168.110.253" + z.name = "test"+str(l) + z.networktype = 'Basic' + + ips = iprange() + ips.vlan = "49" + ips.startip = "10.147.49.200" + ips.endip = "10.147.49.250" + ips.gateway = "10.147.49.1" + ips.netmask = "255.255.255.0" + z.ipranges.append(ips) + + #If security groups are reqd + sgprovider = provider() + sgprovider.broadcastdomainrange = 'Pod' + sgprovider.name = 'SecurityGroupProvider' + + nsprovider = provider() + nsprovider.name = 'Netscaler' + ns = netscaler() + ns.hostname = '10.147.40.100' + nsprovider.devices.append(ns) + + pn = physical_network() + pn.name = "test-network" + pn.traffictypes = [traffictype("Guest", + {"xen": "cloud-guest"}), + traffictype("Management"), + traffictype("Public", {"xen": "cloud-public"})] + pn.providers.extend([sgprovider, nsprovider]) + z.physical_networks.append(pn) + + '''create 10 pods''' + for i in range(2): + p = pod() + p.name = "test" + str(l) + str(i) + p.gateway = "192.168.%d.1" % i + p.netmask = "255.255.255.0" + p.startip = "192.168.%d.150" % i + p.endip = "192.168.%d.220" % i + + '''add two pod guest ip ranges''' + for j in range(2): + ip = iprange() + ip.gateway = p.gateway + ip.netmask = p.netmask + ip.startip = "192.168.%d.%d" % (i, j*20) + ip.endip = "192.168.%d.%d" % (i, j*20+10) + + p.guestIpRanges.append(ip) + + '''add 10 clusters''' + for j in range(2): + c = cluster() + c.clustername = "test"+str(l)+str(i) + str(j) + c.clustertype = "CloudManaged" + c.hypervisor = "Simulator" + + '''add 10 hosts''' + for k in range(2): + h = host() + h.username = "root" + h.password = "password" + h.url = "http://Sim/%d%d%d%d" % (l, i, j, k) + c.hosts.append(h) + + '''add 2 primary storages''' + for m in range(2): + primary = primaryStorage() + primary.name = "primary"+str(l) + str(i) + str(j) + str(m) + primary.url = "nfs://localhost/path%s" % (str(l) + str(i) + + str(j) + + str(m)) + c.primaryStorages.append(primary) + + p.clusters.append(c) + + z.pods.append(p) + + '''add two secondary''' + for i in range(5): + secondary = secondaryStorage() + secondary.url = "nfs://localhost/path"+str(l) + str(i) + z.secondaryStorages.append(secondary) + + zs.zones.append(z) + + '''Add one mgt server''' + mgt = managementServer() + mgt.mgtSvrIp = "localhost" + zs.mgtSvr.append(mgt) + + '''Add a database''' + db = dbServer() + db.dbSvr = "localhost" + + zs.dbSvr = db + + '''add global configuration''' + global_settings = {'expunge.delay': '60', + 'expunge.interval': '60', + 'expunge.workers': '3', + } + for k, v in global_settings.iteritems(): + cfg = configuration() + cfg.name = k + cfg.value = v + zs.globalConfig.append(cfg) + + ''''add loggers''' + testClientLogger = logger() + testClientLogger.name = "TestClient" + testClientLogger.file = "/tmp/testclient.log" + + testCaseLogger = logger() + testCaseLogger.name = "TestCase" + testCaseLogger.file = "/tmp/testcase.log" + + zs.logger.append(testClientLogger) + zs.logger.append(testCaseLogger) + + return zs + + +def describe_setup_in_advanced_mode(): + '''sample code to generate setup configuration file''' + zs = cloudstackConfiguration() + + for l in range(1): + z = zone() + z.dns1 = "8.8.8.8" + z.dns2 = "8.8.4.4" + z.internaldns1 = "192.168.110.254" + z.internaldns2 = "192.168.110.253" + z.name = "test"+str(l) + z.networktype = 'Advanced' + z.guestcidraddress = "10.1.1.0/24" + z.vlan = "100-2000" + + pn = physical_network() + pn.name = "test-network" + pn.traffictypes = [traffictype("Guest"), traffictype("Management"), + traffictype("Public")] + + vpcprovider = provider('VpcVirtualRouter') + + nsprovider = provider('Netscaler') + nsprovider.devices.append(netscaler(hostname='10.147.40.100')) + + srxprovider = provider('JuniperSRX') + srxprovider.devices.append(srx(hostname='10.147.40.3')) + + f5provider = provider('F5BigIp') + f5provider.devices.append(bigip(hostname='10.147.40.3')) + + pn.providers.extend([vpcprovider, nsprovider, srxprovider, f5provider]) + z.physical_networks.append(pn) + + '''create 10 pods''' + for i in range(2): + p = pod() + p.name = "test" + str(l) + str(i) + p.gateway = "192.168.%d.1" % i + p.netmask = "255.255.255.0" + p.startip = "192.168.%d.200" % i + p.endip = "192.168.%d.220" % i + + '''add 10 clusters''' + for j in range(2): + c = cluster() + c.clustername = "test"+str(l)+str(i) + str(j) + c.clustertype = "CloudManaged" + c.hypervisor = "Simulator" + + '''add 10 hosts''' + for k in range(2): + h = host() + h.username = "root" + h.password = "password" + memory = 8 * 1024 * 1024 * 1024 + localstorage = 1 * 1024 * 1024 * 1024 * 1024 + #h.url = "http://sim/%d%d%d%d/cpucore=1&cpuspeed=8000&\ + # memory=%d&localstorage=%d"%(l, i, j, k, memory, + # localstorage) + h.url = "http://sim/%d%d%d%d" % (l, i, j, k) + c.hosts.append(h) + + '''add 2 primary storages''' + for m in range(2): + primary = primaryStorage() + primary.name = "primary"+str(l) + str(i) + str(j) + str(m) + #primary.url = "nfs://localhost/path%s/size=%d" % + # (str(l) + str(i) + str(j) + str(m), size) + primary.url = "nfs://localhost/path%s" % (str(l) + str(i) + + str(j) + + str(m)) + c.primaryStorages.append(primary) + + p.clusters.append(c) + + z.pods.append(p) + + '''add two secondary''' + for i in range(5): + secondary = secondaryStorage() + secondary.url = "nfs://localhost/path"+str(l) + str(i) + z.secondaryStorages.append(secondary) + + '''add default public network''' + ips = iprange() + ips.vlan = "26" + ips.startip = "172.16.26.2" + ips.endip = "172.16.26.100" + ips.gateway = "172.16.26.1" + ips.netmask = "255.255.255.0" + z.ipranges.append(ips) + + zs.zones.append(z) + + '''Add one mgt server''' + mgt = managementServer() + mgt.mgtSvrIp = "localhost" + zs.mgtSvr.append(mgt) + + '''Add a database''' + db = dbServer() + db.dbSvr = "localhost" + + zs.dbSvr = db + + '''add global configuration''' + global_settings = {'expunge.delay': '60', + 'expunge.interval': '60', + 'expunge.workers': '3', + } + for k, v in global_settings.iteritems(): + cfg = configuration() + cfg.name = k + cfg.value = v + zs.globalConfig.append(cfg) + + ''''add loggers''' + testClientLogger = logger() + testClientLogger.name = "TestClient" + testClientLogger.file = "/tmp/testclient.log" + + testCaseLogger = logger() + testCaseLogger.name = "TestCase" + testCaseLogger.file = "/tmp/testcase.log" + + zs.logger.append(testClientLogger) + zs.logger.append(testCaseLogger) + + return zs + +'''sample code to generate setup configuration file''' + + +def describe_setup_in_advancedsg_mode(): + zs = cloudstackConfiguration() + + for l in range(1): + z = zone() + z.dns1 = "8.8.8.8" + z.dns2 = "8.8.4.4" + z.internaldns1 = "192.168.110.254" + z.internaldns2 = "192.168.110.253" + z.name = "test"+str(l) + z.networktype = 'Advanced' + z.vlan = "100-2000" + z.securitygroupenabled = "true" + + pn = physical_network() + pn.name = "test-network" + pn.traffictypes = [traffictype("Guest"), traffictype("Management")] + + #If security groups are reqd + sgprovider = provider() + sgprovider.broadcastdomainrange = 'ZONE' + sgprovider.name = 'SecurityGroupProvider' + + pn.providers.append(sgprovider) + z.physical_networks.append(pn) + + '''create 10 pods''' + for i in range(2): + p = pod() + p.name = "test" + str(l) + str(i) + p.gateway = "192.168.%d.1" % i + p.netmask = "255.255.255.0" + p.startip = "192.168.%d.200" % i + p.endip = "192.168.%d.220" % i + + '''add 10 clusters''' + for j in range(2): + c = cluster() + c.clustername = "test"+str(l)+str(i) + str(j) + c.clustertype = "CloudManaged" + c.hypervisor = "Simulator" + + '''add 10 hosts''' + for k in range(2): + h = host() + h.username = "root" + h.password = "password" + memory = 8 * 1024 * 1024 * 1024 + localstorage = 1 * 1024 * 1024 * 1024 * 1024 + #h.url = "http://sim/%d%d%d%d/cpucore=1&cpuspeed=8000&\ + #memory=%d&localstorage=%d" % (l, i, j, k, memory, + #localstorage) + h.url = "http://sim/%d%d%d%d" % (l, i, j, k) + c.hosts.append(h) + + '''add 2 primary storages''' + for m in range(2): + primary = primaryStorage() + primary.name = "primary"+str(l) + str(i) + str(j) + str(m) + #primary.url = "nfs://localhost/path%s/size=%d" % \ + #(str(l) + str(i) + str(j) + str(m), size) + primary.url = "nfs://localhost/path%s" % \ + (str(l) + str(i) + str(j) + str(m)) + c.primaryStorages.append(primary) + + p.clusters.append(c) + + z.pods.append(p) + + '''add two secondary''' + for i in range(5): + secondary = secondaryStorage() + secondary.url = "nfs://localhost/path"+str(l) + str(i) + z.secondaryStorages.append(secondary) + + '''add default guest network''' + ips = iprange() + ips.vlan = "26" + ips.startip = "172.16.26.2" + ips.endip = "172.16.26.100" + ips.gateway = "172.16.26.1" + ips.netmask = "255.255.255.0" + z.ipranges.append(ips) + + zs.zones.append(z) + + '''Add one mgt server''' + mgt = managementServer() + mgt.mgtSvrIp = "localhost" + zs.mgtSvr.append(mgt) + + '''Add a database''' + db = dbServer() + db.dbSvr = "localhost" + + zs.dbSvr = db + + '''add global configuration''' + global_settings = {'expunge.delay': '60', + 'expunge.interval': '60', + 'expunge.workers': '3', + } + for k, v in global_settings.iteritems(): + cfg = configuration() + cfg.name = k + cfg.value = v + zs.globalConfig.append(cfg) + + ''''add loggers''' + testClientLogger = logger() + testClientLogger.name = "TestClient" + testClientLogger.file = "/tmp/testclient.log" + + testCaseLogger = logger() + testCaseLogger.name = "TestCase" + testCaseLogger.file = "/tmp/testcase.log" + + zs.logger.append(testClientLogger) + zs.logger.append(testCaseLogger) + + return zs + + +def generate_setup_config(config, file=None): + describe = config + if file is None: + return json.dumps(jsonHelper.jsonDump.dump(describe)) + else: + fp = open(file, 'w') + json.dump(jsonHelper.jsonDump.dump(describe), fp, indent=4) + fp.close() + + +def get_setup_config(file): + if not os.path.exists(file): + raise IOError("config file %s not found. \ +please specify a valid config file" % file) + config = cloudstackConfiguration() + configLines = [] + with open(file, 'r') as fp: + for line in fp: + ws = line.strip() + if not ws.startswith("#"): + configLines.append(ws) + config = json.loads("\n".join(configLines)) + return jsonHelper.jsonLoader(config) + +if __name__ == "__main__": + parser = OptionParser() + + parser.add_option("-i", "--input", action="store", default=None, + dest="inputfile", help="input file") + parser.add_option("-a", "--advanced", action="store_true", default=False, + dest="advanced", help="use advanced networking") + parser.add_option("-s", "--advancedsg", action="store_true", default=False, + dest="advancedsg", help="use advanced networking \ +with security groups") + parser.add_option("-o", "--output", action="store", + default="./datacenterCfg", dest="output", + help="the path where the json config file generated, \ +by default is ./datacenterCfg") + + (options, args) = parser.parse_args() + + if options.inputfile: + config = get_setup_config(options.inputfile) + if options.advanced: + config = describe_setup_in_advanced_mode() + elif options.advancedsg: + config = describe_setup_in_advancedsg_mode() + else: + config = describe_setup_in_basic_mode() + + generate_setup_config(config, options.output) diff --git a/tools/marvin/build/lib/marvin/dbConnection.py b/tools/marvin/build/lib/marvin/dbConnection.py new file mode 100644 index 00000000000..99014abfa20 --- /dev/null +++ b/tools/marvin/build/lib/marvin/dbConnection.py @@ -0,0 +1,86 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 mysql +import contextlib +from mysql import connector +from mysql.connector import errors +from contextlib import closing +import cloudstackException +import sys +import os + + +class dbConnection(object): + def __init__(self, host="localhost", port=3306, user='cloud', + passwd='cloud', db='cloud'): + self.host = host + self.port = port + self.user = str(user) # Workaround: http://bugs.mysql.com/?id=67306 + self.passwd = passwd + self.database = db + + def execute(self, sql=None, params=None): + if sql is None: + return None + + resultRow = [] + with contextlib.\ + closing(mysql.connector.connect(host=str(self.host), + port=int(self.port), + user=str(self.user), + password=str(self.passwd), + db=str(self.database))) as conn: + conn.autocommit = True + with contextlib.closing(conn.cursor(buffered=True)) as cursor: + cursor.execute(sql, params) + try: + resultRow = cursor.fetchall() + except errors.InterfaceError: + #Raised on empty result - DML + resultRow = [] + return resultRow + + def executeSqlFromFile(self, fileName=None): + if fileName is None: + raise cloudstackException.\ + InvalidParameterException("file can't not none") + + if not os.path.exists(fileName): + raise cloudstackException.\ + InvalidParameterException("%s not exists" % fileName) + + sqls = open(fileName, "r").read() + return self.execute(sqls) + +if __name__ == "__main__": + db = dbConnection() + ''' + try: + + result = db.executeSqlFromFile("/tmp/server-setup.sql") + if result is not None: + for r in result: + print r[0], r[1] + except cloudstackException.dbException, e: + print e + ''' + print db.execute("update vm_template set name='fjkd' where id=200") + for i in range(10): + result = db.execute("select job_status, created, \ +last_updated from async_job where id=%d" % i) + print result diff --git a/tools/marvin/build/lib/marvin/deployAndRun.py b/tools/marvin/build/lib/marvin/deployAndRun.py new file mode 100644 index 00000000000..8a758a10e36 --- /dev/null +++ b/tools/marvin/build/lib/marvin/deployAndRun.py @@ -0,0 +1,96 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 deployDataCenter +import TestCaseExecuteEngine +import sys +from argparse import ArgumentParser +if __name__ == "__main__": + + parser = ArgumentParser() + + parser.add_argument("-d", "--directory", dest="testCaseFolder", + help="the test case directory") + parser.add_argument("-f", "--file", dest="module", + help="run tests in the given file") + parser.add_argument("-r", "--result", dest="result", + help="test result log file", default='/tmp/t.log') + parser.add_argument("-t", "--client", dest="testcaselog", + help="test case log file", default='/tmp/r.log') + parser.add_argument("-c", "--config", action="store", + default="./datacenterCfg", dest="config", + help="the path where the json config file generated,\ + by default is ./datacenterCfg") + parser.add_argument("-l", "--load", dest="load", action="store_true", + help="only load config, do not deploy,\ + it will only run testcase") + parser.add_argument("-n", "--num", dest="number", + help="how many times you want run the test case") + + options = parser.parse_args() + + testResultLogFile = None + if options.result is not None: + testResultLogFile = options.result + + testCaseLogFile = None + if options.testcaselog is not None: + testCaseLogFile = options.testcaselog + deploy = deployDataCenter.deployDataCenters(options.config) + if options.load: + deploy.loadCfg() + else: + deploy.deploy() + iterates = 1 + if options.number is not None: + if options.number == "loop": + iterates = sys.maxint + else: + try: + iterates = int(options.number) + except: + iterates = 1 + + if options.testCaseFolder is None: + if options.module is None: + parser.print_usage() + exit(1) + else: + n = 0 + while(n < iterates): + engine = \ + TestCaseExecuteEngine.TestCaseExecuteEngine( + deploy.testClient, + deploy.getCfg( + ), + testCaseLogFile, + testResultLogFile) + engine.loadTestsFromFile(options.module) + engine.run() + n = n + 1 + else: + n = 0 + while(n < iterates): + engine = TestCaseExecuteEngine.TestCaseExecuteEngine( + deploy.testClient, + deploy.getCfg( + ), + testCaseLogFile, + testResultLogFile) + engine.loadTestsFromDir(options.testCaseFolder) + engine.run() + n = n + 1 diff --git a/tools/marvin/build/lib/marvin/deployDataCenter.py b/tools/marvin/build/lib/marvin/deployDataCenter.py new file mode 100644 index 00000000000..beed8c8eb19 --- /dev/null +++ b/tools/marvin/build/lib/marvin/deployDataCenter.py @@ -0,0 +1,625 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +"""Deploy datacenters according to a json configuration file""" +import configGenerator +import cloudstackException +import cloudstackTestClient +import logging +from cloudstackAPI import * +from os import path +from time import sleep +from optparse import OptionParser + + +class deployDataCenters(object): + + def __init__(self, cfgFile): + if not path.exists(cfgFile) \ + and not path.exists(path.abspath(cfgFile)): + raise IOError("config file %s not found. please \ +specify a valid config file" % cfgFile) + self.configFile = cfgFile + + def addHosts(self, hosts, zoneId, podId, clusterId, hypervisor): + if hosts is None: + return + for host in hosts: + hostcmd = addHost.addHostCmd() + hostcmd.clusterid = clusterId + hostcmd.cpunumber = host.cpunumer + hostcmd.cpuspeed = host.cpuspeed + hostcmd.hostmac = host.hostmac + hostcmd.hosttags = host.hosttags + hostcmd.hypervisor = host.hypervisor + hostcmd.memory = host.memory + hostcmd.password = host.password + hostcmd.podid = podId + hostcmd.url = host.url + hostcmd.username = host.username + hostcmd.zoneid = zoneId + hostcmd.hypervisor = hypervisor + self.apiClient.addHost(hostcmd) + + def addVmWareDataCenter(self, vmwareDc): + vdc = addVmwareDc.addVmwareDcCmd() + vdc.zoneid = vmwareDc.zoneid + vdc.name = vmwareDc.name + vdc.vcenter = vmwareDc.vcenter + vdc.username = vmwareDc.username + vdc.password = vmwareDc.password + self.apiClient.addVmwareDc(vdc) + + def createClusters(self, clusters, zoneId, podId, vmwareDc=None): + if clusters is None: + return + + if vmwareDc is not None: + vmwareDc.zoneid = zoneId + self.addVmWareDataCenter(vmwareDc) + + for cluster in clusters: + clustercmd = addCluster.addClusterCmd() + clustercmd.clustername = cluster.clustername + clustercmd.clustertype = cluster.clustertype + clustercmd.hypervisor = cluster.hypervisor + clustercmd.password = cluster.password + clustercmd.podid = podId + clustercmd.url = cluster.url + clustercmd.username = cluster.username + clustercmd.zoneid = zoneId + clusterresponse = self.apiClient.addCluster(clustercmd) + clusterId = clusterresponse[0].id + + if cluster.hypervisor.lower() != "vmware": + self.addHosts(cluster.hosts, zoneId, podId, clusterId, + cluster.hypervisor) + self.wait_for_host(zoneId, clusterId) + self.createPrimaryStorages(cluster.primaryStorages, zoneId, podId, + clusterId) + + def wait_for_host(self, zoneId, clusterId): + """ + Wait for the hosts in the zoneid, clusterid to be up + + 2 retries with 30s delay + """ + retry, timeout = 2, 30 + cmd = listHosts.listHostsCmd() + cmd.clusterid, cmd.zoneid = clusterId, zoneId + hosts = self.apiClient.listHosts(cmd) + while retry != 0: + for host in hosts: + if host.state != 'Up': + break + sleep(timeout) + retry = retry - 1 + + def createPrimaryStorages(self, primaryStorages, zoneId, podId, clusterId): + if primaryStorages is None: + return + for primary in primaryStorages: + primarycmd = createStoragePool.createStoragePoolCmd() + primarycmd.details = primary.details + primarycmd.name = primary.name + primarycmd.podid = podId + primarycmd.tags = primary.tags + primarycmd.url = primary.url + primarycmd.zoneid = zoneId + primarycmd.clusterid = clusterId + self.apiClient.createStoragePool(primarycmd) + + def createpods(self, pods, zoneId, networkId=None): + if pods is None: + return + for pod in pods: + createpod = createPod.createPodCmd() + createpod.name = pod.name + createpod.gateway = pod.gateway + createpod.netmask = pod.netmask + createpod.startip = pod.startip + createpod.endip = pod.endip + createpod.zoneid = zoneId + createpodResponse = self.apiClient.createPod(createpod) + podId = createpodResponse.id + + if pod.guestIpRanges is not None and networkId is not None: + self.createVlanIpRanges("Basic", pod.guestIpRanges, zoneId, + podId, networkId) + + self.createClusters(pod.clusters, zoneId, podId, + vmwareDc=pod.vmwaredc) + + def createVlanIpRanges(self, mode, ipranges, zoneId, podId=None, + networkId=None, forvirtualnetwork=None): + if ipranges is None: + return + for iprange in ipranges: + vlanipcmd = createVlanIpRange.createVlanIpRangeCmd() + vlanipcmd.account = iprange.account + vlanipcmd.domainid = iprange.domainid + vlanipcmd.endip = iprange.endip + vlanipcmd.gateway = iprange.gateway + vlanipcmd.netmask = iprange.netmask + vlanipcmd.networkid = networkId + vlanipcmd.podid = podId + vlanipcmd.startip = iprange.startip + vlanipcmd.zoneid = zoneId + vlanipcmd.vlan = iprange.vlan + if mode == "Basic": + if forvirtualnetwork: + vlanipcmd.forvirtualnetwork = "true" + else: + vlanipcmd.forvirtualnetwork = "false" + else: + vlanipcmd.forvirtualnetwork = "true" + self.apiClient.createVlanIpRange(vlanipcmd) + + def createSecondaryStorages(self, secondaryStorages, zoneId): + if secondaryStorages is None: + return + for secondary in secondaryStorages: + secondarycmd = addImageStore.addImageStoreCmd() + secondarycmd.url = secondary.url + secondarycmd.provider = secondary.provider + secondarycmd.details = [] + + if secondarycmd.provider == 'S3' \ + or secondarycmd.provider == "Swift": + for key, value in vars(secondary.details).iteritems(): + secondarycmd.details.append({ + 'key': key, + 'value': value + }) + if secondarycmd.provider == "NFS": + secondarycmd.zoneid = zoneId + self.apiClient.addImageStore(secondarycmd) + + def createCacheStorages(self, cacheStorages, zoneId): + if cacheStorages is None: + return + for cache in cacheStorages: + cachecmd = createSecondaryStagingStore.\ + createSecondaryStagingStoreCmd() + cachecmd.url = cache.url + cachecmd.provider = cache.provider + cachecmd.zoneid = zoneId + cachecmd.details = [] + + if cache.details: + for key, value in vars(cache.details).iteritems(): + cachecmd.details.append({ + 'key': key, + 'value': value + }) + self.apiClient.createSecondaryStagingStore(cachecmd) + + def createnetworks(self, networks, zoneId): + if networks is None: + return + for network in networks: + networkcmd = createNetwork.createNetworkCmd() + networkcmd.displaytext = network.displaytext + networkcmd.name = network.name + networkcmd.networkofferingid = network.networkofferingid + networkcmd.zoneid = zoneId + + ipranges = network.ipranges + if ipranges: + iprange = ipranges.pop() + networkcmd.startip = iprange.startip + networkcmd.endip = iprange.endip + networkcmd.gateway = iprange.gateway + networkcmd.netmask = iprange.netmask + + networkcmdresponse = self.apiClient.createNetwork(networkcmd) + networkId = networkcmdresponse.id + return networkId + + def createPhysicalNetwork(self, net, zoneid): + phynet = createPhysicalNetwork.createPhysicalNetworkCmd() + phynet.zoneid = zoneid + phynet.name = net.name + phynet.isolationmethods = net.isolationmethods + phynetwrk = self.apiClient.createPhysicalNetwork(phynet) + self.addTrafficTypes(phynetwrk.id, net.traffictypes) + return phynetwrk + + def updatePhysicalNetwork(self, networkid, state="Enabled", vlan=None): + upnet = updatePhysicalNetwork.updatePhysicalNetworkCmd() + upnet.id = networkid + upnet.state = state + if vlan: + upnet.vlan = vlan + return self.apiClient.updatePhysicalNetwork(upnet) + + def enableProvider(self, provider_id): + upnetprov =\ + updateNetworkServiceProvider.updateNetworkServiceProviderCmd() + upnetprov.id = provider_id + upnetprov.state = "Enabled" + self.apiClient.updateNetworkServiceProvider(upnetprov) + + def configureProviders(self, phynetwrk, providers): + """ + We will enable the virtualrouter elements for all zones. Other + providers like NetScalers, SRX, etc are explicitly added/configured + """ + + for provider in providers: + pnetprov = listNetworkServiceProviders.\ + listNetworkServiceProvidersCmd() + pnetprov.physicalnetworkid = phynetwrk.id + pnetprov.state = "Disabled" + pnetprov.name = provider.name + pnetprovres = self.apiClient.listNetworkServiceProviders(pnetprov) + + if pnetprovres and len(pnetprovres) > 0: + if provider.name == 'VirtualRouter'\ + or provider.name == 'VpcVirtualRouter': + vrprov = listVirtualRouterElements.\ + listVirtualRouterElementsCmd() + vrprov.nspid = pnetprovres[0].id + vrprovresponse = self.apiClient.\ + listVirtualRouterElements(vrprov) + vrprovid = vrprovresponse[0].id + + vrconfig = \ + configureVirtualRouterElement.\ + configureVirtualRouterElementCmd() + vrconfig.enabled = "true" + vrconfig.id = vrprovid + self.apiClient.configureVirtualRouterElement(vrconfig) + self.enableProvider(pnetprovres[0].id) + elif provider.name == 'InternalLbVm': + internallbprov = listInternalLoadBalancerElements.\ + listInternalLoadBalancerElementsCmd() + internallbprov.nspid = pnetprovres[0].id + internallbresponse = self.apiClient.\ + listInternalLoadBalancerElements(internallbprov) + internallbid = internallbresponse[0].id + + internallbconfig = \ + configureInternalLoadBalancerElement.\ + configureInternalLoadBalancerElementCmd() + internallbconfig.enabled = "true" + internallbconfig.id = internallbid + self.apiClient.\ + configureInternalLoadBalancerElement(internallbconfig) + self.enableProvider(pnetprovres[0].id) + elif provider.name == 'SecurityGroupProvider': + self.enableProvider(pnetprovres[0].id) + elif provider.name in ['Netscaler', 'JuniperSRX', 'F5BigIp']: + netprov = addNetworkServiceProvider.\ + addNetworkServiceProviderCmd() + netprov.name = provider.name + netprov.physicalnetworkid = phynetwrk.id + result = self.apiClient.addNetworkServiceProvider(netprov) + for device in provider.devices: + if provider.name == 'Netscaler': + dev = addNetscalerLoadBalancer.\ + addNetscalerLoadBalancerCmd() + dev.username = device.username + dev.password = device.password + dev.networkdevicetype = device.networkdevicetype + dev.url = configGenerator.getDeviceUrl(device) + dev.physicalnetworkid = phynetwrk.id + self.apiClient.addNetscalerLoadBalancer(dev) + elif provider.name == 'JuniperSRX': + dev = addSrxFirewall.addSrxFirewallCmd() + dev.username = device.username + dev.password = device.password + dev.networkdevicetype = device.networkdevicetype + dev.url = configGenerator.getDeviceUrl(device) + dev.physicalnetworkid = phynetwrk.id + self.apiClient.addSrxFirewall(dev) + elif provider.name == 'F5BigIp': + dev = addF5LoadBalancer.addF5LoadBalancerCmd() + dev.username = device.username + dev.password = device.password + dev.networkdevicetype = device.networkdevicetype + dev.url = configGenerator.getDeviceUrl(device) + dev.physicalnetworkid = phynetwrk.id + self.apiClient.addF5LoadBalancer(dev) + else: + raise cloudstackException.\ + InvalidParameterException("Device %s doesn't match\ + any know provider type" % device) + self.enableProvider(result.id) + + def addTrafficTypes(self, physical_network_id, traffictypes): + [self.addTrafficType(physical_network_id, traffic_type) + for traffic_type in traffictypes] + + def addTrafficType(self, physical_network_id, traffictype): + traffic_type = addTrafficType.addTrafficTypeCmd() + traffic_type.physicalnetworkid = physical_network_id + traffic_type.traffictype = traffictype.typ + traffic_type.kvmnetworklabel = traffictype.kvm\ + if traffictype.kvm is not None else None + traffic_type.xennetworklabel = traffictype.xen\ + if traffictype.xen is not None else None + traffic_type.vmwarenetworklabel = traffictype.vmware\ + if traffictype.vmware is not None else None + traffic_type.simulatorlabel = traffictype.simulator\ + if traffictype.simulator is not None else None + return self.apiClient.addTrafficType(traffic_type) + + def enableZone(self, zoneid, allocation_state="Enabled"): + zoneCmd = updateZone.updateZoneCmd() + zoneCmd.id = zoneid + zoneCmd.allocationstate = allocation_state + return self.apiClient.updateZone(zoneCmd) + + def updateZoneDetails(self, zoneid, details): + zoneCmd = updateZone.updateZoneCmd() + zoneCmd.id = zoneid + zoneCmd.details = details + return self.apiClient.updateZone(zoneCmd) + + def createZones(self, zones): + for zone in zones: + createzone = createZone.createZoneCmd() + createzone.dns1 = zone.dns1 + createzone.dns2 = zone.dns2 + createzone.internaldns1 = zone.internaldns1 + createzone.internaldns2 = zone.internaldns2 + createzone.name = zone.name + createzone.securitygroupenabled = zone.securitygroupenabled + createzone.localstorageenabled = zone.localstorageenabled + createzone.networktype = zone.networktype + if zone.securitygroupenabled != "true": + createzone.guestcidraddress = zone.guestcidraddress + + zoneresponse = self.apiClient.createZone(createzone) + zoneId = zoneresponse.id + + for pnet in zone.physical_networks: + phynetwrk = self.createPhysicalNetwork(pnet, zoneId) + self.configureProviders(phynetwrk, pnet.providers) + self.updatePhysicalNetwork(phynetwrk.id, "Enabled", + vlan=pnet.vlan) + + if zone.networktype == "Basic": + listnetworkoffering =\ + listNetworkOfferings.listNetworkOfferingsCmd() + listnetworkoffering.name =\ + "DefaultSharedNetscalerEIPandELBNetworkOffering" \ + if len(filter(lambda x: + x.typ == 'Public', + zone.physical_networks[0]. + traffictypes)) > 0 \ + else "DefaultSharedNetworkOfferingWithSGService" + if zone.networkofferingname is not None: + listnetworkoffering.name = zone.networkofferingname + + listnetworkofferingresponse = \ + self.apiClient.listNetworkOfferings(listnetworkoffering) + + guestntwrk = configGenerator.network() + guestntwrk.displaytext = "guestNetworkForBasicZone" + guestntwrk.name = "guestNetworkForBasicZone" + guestntwrk.zoneid = zoneId + guestntwrk.networkofferingid = \ + listnetworkofferingresponse[0].id + + networkid = self.createnetworks([guestntwrk], zoneId) + self.createpods(zone.pods, zoneId, networkid) + if self.isEipElbZone(zone): + self.createVlanIpRanges(zone.networktype, zone.ipranges, + zoneId, forvirtualnetwork=True) + + isPureAdvancedZone = (zone.networktype == "Advanced" + and zone.securitygroupenabled != "true") + if isPureAdvancedZone: + self.createpods(zone.pods, zoneId) + self.createVlanIpRanges(zone.networktype, zone.ipranges, + zoneId) + elif (zone.networktype == "Advanced" + and zone.securitygroupenabled == "true"): + listnetworkoffering =\ + listNetworkOfferings.listNetworkOfferingsCmd() + listnetworkoffering.name =\ + "DefaultSharedNetworkOfferingWithSGService" + if zone.networkofferingname is not None: + listnetworkoffering.name = zone.networkofferingname + + listnetworkofferingresponse = \ + self.apiClient.listNetworkOfferings(listnetworkoffering) + + networkcmd = createNetwork.createNetworkCmd() + networkcmd.displaytext = "Shared SG enabled network" + networkcmd.name = "Shared SG enabled network" + networkcmd.networkofferingid =\ + listnetworkofferingresponse[0].id + networkcmd.zoneid = zoneId + + ipranges = zone.ipranges + if ipranges: + iprange = ipranges.pop() + networkcmd.startip = iprange.startip + networkcmd.endip = iprange.endip + networkcmd.gateway = iprange.gateway + networkcmd.netmask = iprange.netmask + networkcmd.vlan = iprange.vlan + + networkcmdresponse = self.apiClient.createNetwork(networkcmd) + networkId = networkcmdresponse.id + self.createpods(zone.pods, zoneId, networkId) + + '''Note: Swift needs cache storage first''' + self.createCacheStorages(zone.cacheStorages, zoneId) + self.createSecondaryStorages(zone.secondaryStorages, zoneId) + + enabled = getattr(zone, 'enabled', 'True') + if enabled == 'True' or enabled is None: + self.enableZone(zoneId, "Enabled") + details = getattr(zone, 'details') + if details is not None: + det = [d.__dict__ for d in details] + self.updateZoneDetails(zoneId, det) + + return + + def isEipElbZone(self, zone): + if (zone.networktype == "Basic" + and len(filter(lambda x: x.typ == 'Public', + zone.physical_networks[0].traffictypes)) > 0): + return True + return False + + def registerApiKey(self): + listuser = listUsers.listUsersCmd() + listuser.account = "admin" + listuserRes = self.testClient.getApiClient().listUsers(listuser) + userId = listuserRes[0].id + apiKey = listuserRes[0].apikey + securityKey = listuserRes[0].secretkey + if apiKey is None: + registerUser = registerUserKeys.registerUserKeysCmd() + registerUser.id = userId + registerUserRes = \ + self.testClient.getApiClient().registerUserKeys(registerUser) + + apiKey = registerUserRes.apikey + securityKey = registerUserRes.secretkey + + self.config.mgtSvr[0].port = 8080 + self.config.mgtSvr[0].apiKey = apiKey + self.config.mgtSvr[0].securityKey = securityKey + return apiKey, securityKey + + def getCfg(self): + if self.config is not None: + return self.config + return None + + def loadCfg(self): + try: + self.config = configGenerator.get_setup_config(self.configFile) + except: + raise cloudstackException.InvalidParameterException( + "Failed to load config %s" % self.configFile) + + mgt = self.config.mgtSvr[0] + + loggers = self.config.logger + testClientLogFile = None + self.testCaseLogFile = None + self.testResultLogFile = None + if loggers is not None and len(loggers) > 0: + for log in loggers: + if log.name == "TestClient": + testClientLogFile = log.file + elif log.name == "TestCase": + self.testCaseLogFile = log.file + elif log.name == "TestResult": + self.testResultLogFile = log.file + + testClientLogger = None + if testClientLogFile is not None: + testClientLogger = logging.getLogger("testclient.testengine.run") + fh = logging.FileHandler(testClientLogFile) + fh.setFormatter(logging. + Formatter("%(asctime)s - %(levelname)s - %(name)s\ + - %(message)s")) + testClientLogger.addHandler(fh) + testClientLogger.setLevel(logging.INFO) + self.testClientLogger = testClientLogger + + self.testClient = \ + cloudstackTestClient.\ + cloudstackTestClient(mgt.mgtSvrIp, mgt.port, mgt.user, mgt.passwd, + mgt.apiKey, mgt.securityKey, + logging=self.testClientLogger) + if mgt.apiKey is None: + apiKey, securityKey = self.registerApiKey() + self.testClient = cloudstackTestClient.cloudstackTestClient( + mgt.mgtSvrIp, 8080, + mgt.user, mgt.passwd, + apiKey, securityKey, + logging=self.testClientLogger) + + """config database""" + dbSvr = self.config.dbSvr + if dbSvr is not None: + self.testClient.dbConfigure(dbSvr.dbSvr, dbSvr.port, dbSvr.user, + dbSvr.passwd, dbSvr.db) + + self.apiClient = self.testClient.getApiClient() + """set hypervisor""" + if mgt.hypervisor: + self.apiClient.hypervisor = mgt.hypervisor + else: + self.apiClient.hypervisor = "XenServer" # Defaults to Xenserver + + def updateConfiguration(self, globalCfg): + if globalCfg is None: + return None + + for config in globalCfg: + updateCfg = updateConfiguration.updateConfigurationCmd() + updateCfg.name = config.name + updateCfg.value = config.value + self.apiClient.updateConfiguration(updateCfg) + + def copyAttributesToCommand(self, source, command): + + map(lambda attr: setattr(command, attr, getattr(source, attr, None)), + filter(lambda attr: not attr.startswith("__") and attr not in + ["required", "isAsync"], dir(command))) + + def configureS3(self, s3): + if s3 is None: + return + + command = addS3.addS3Cmd() + self.copyAttributesToCommand(s3, command) + self.apiClient.addS3(command) + + def deploy(self): + self.loadCfg() + self.updateConfiguration(self.config.globalConfig) + self.createZones(self.config.zones) + self.configureS3(self.config.s3) + +if __name__ == "__main__": + + parser = OptionParser() + + parser.add_option("-i", "--input", action="store", + default="./datacenterCfg", dest="input", help="the path \ + where the json config file generated, by default is \ + ./datacenterCfg") + + (options, args) = parser.parse_args() + + deploy = deployDataCenters(options.input) + deploy.deploy() + + """ + create = createStoragePool.createStoragePoolCmd() + create.clusterid = 1 + create.podid = 2 + create.name = "fdffdf" + create.url = "nfs://jfkdjf/fdkjfkd" + create.zoneid = 2 + + deploy = deployDataCenters("./datacenterCfg") + deploy.loadCfg() + deploy.apiClient.createStoragePool(create) + """ diff --git a/tools/marvin/build/lib/marvin/integration/__init__.py b/tools/marvin/build/lib/marvin/integration/__init__.py new file mode 100644 index 00000000000..57823fcc162 --- /dev/null +++ b/tools/marvin/build/lib/marvin/integration/__init__.py @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + diff --git a/tools/marvin/build/lib/marvin/integration/lib/__init__.py b/tools/marvin/build/lib/marvin/integration/lib/__init__.py new file mode 100644 index 00000000000..978b68af62a --- /dev/null +++ b/tools/marvin/build/lib/marvin/integration/lib/__init__.py @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/tools/marvin/build/lib/marvin/integration/lib/base.py b/tools/marvin/build/lib/marvin/integration/lib/base.py new file mode 100644 index 00000000000..4f151378cc9 --- /dev/null +++ b/tools/marvin/build/lib/marvin/integration/lib/base.py @@ -0,0 +1,3593 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" Base class for all Cloudstack resources + -Virtual machine, Volume, Snapshot etc +""" + +import marvin +from utils import is_server_ssh_ready, random_gen +from marvin.cloudstackAPI import * +# Import System modules +import time +import hashlib +import base64 + + +class Domain: + """ Domain Life Cycle """ + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, name=None, networkdomain=None, + parentdomainid=None): + """Creates an domain""" + + cmd = createDomain.createDomainCmd() + + if "domainUUID" in services: + cmd.domainid = "-".join([services["domainUUID"], random_gen()]) + + if name: + cmd.name = "-".join([name, random_gen()]) + elif "name" in services: + cmd.name = "-".join([services["name"], random_gen()]) + + if networkdomain: + cmd.networkdomain = networkdomain + elif "networkdomain" in services: + cmd.networkdomain = services["networkdomain"] + + if parentdomainid: + cmd.parentdomainid = parentdomainid + elif "parentdomainid" in services: + cmd.parentdomainid = services["parentdomainid"] + try: + domain = apiclient.createDomain(cmd) + if domain is not None: + return Domain(domain.__dict__) + except Exception as e: + raise e + + def delete(self, apiclient, cleanup=None): + """Delete an domain""" + cmd = deleteDomain.deleteDomainCmd() + cmd.id = self.id + if cleanup: + cmd.cleanup = cleanup + apiclient.deleteDomain(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists domains""" + cmd = listDomains.listDomainsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listDomains(cmd)) + + +class Account: + """ Account Life Cycle """ + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, admin=False, domainid=None): + """Creates an account""" + cmd = createAccount.createAccountCmd() + + # 0 - User, 1 - Root Admin, 2 - Domain Admin + cmd.accounttype = 2 if (admin and domainid) else int(admin) + + cmd.email = services["email"] + cmd.firstname = services["firstname"] + cmd.lastname = services["lastname"] + + cmd.password = services["password"] + cmd.username = "-".join([services["username"], random_gen(id=apiclient.id)]) + + if "accountUUID" in services: + cmd.accountid = "-".join([services["accountUUID"],random_gen()]) + + if "userUUID" in services: + cmd.userid = "-".join([services["userUUID"],random_gen()]) + + + if domainid: + cmd.domainid = domainid + account = apiclient.createAccount(cmd) + + return Account(account.__dict__) + + def delete(self, apiclient): + """Delete an account""" + cmd = deleteAccount.deleteAccountCmd() + cmd.id = self.id + apiclient.deleteAccount(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists accounts and provides detailed account information for + listed accounts""" + + cmd = listAccounts.listAccountsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAccounts(cmd)) + + +class User: + """ User Life Cycle """ + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, account, domainid): + cmd = createUser.createUserCmd() + """Creates an user""" + + cmd.account = account + cmd.domainid = domainid + cmd.email = services["email"] + cmd.firstname = services["firstname"] + cmd.lastname = services["lastname"] + + if "userUUID" in services: + cmd.userid = "-".join([services["userUUID"],random_gen()]) + + cmd.password = services["password"] + cmd.username = "-".join([services["username"], random_gen()]) + user = apiclient.createUser(cmd) + + return User(user.__dict__) + + def delete(self, apiclient): + """Delete an account""" + cmd = deleteUser.deleteUserCmd() + cmd.id = self.id + apiclient.deleteUser(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists users and provides detailed account information for + listed users""" + + cmd = listUsers.listUsersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listUsers(cmd)) + + @classmethod + def registerUserKeys(cls, apiclient, userid): + cmd = registerUserKeys.registerUserKeysCmd() + cmd.id = userid + return apiclient.registerUserKeys(cmd) + + def update(self, apiclient, **kwargs): + """Updates the user details""" + + cmd = updateUser.updateUserCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return (apiclient.updateUser(cmd)) + + @classmethod + def update(cls, apiclient, id, **kwargs): + """Updates the user details (class method)""" + + cmd = updateUser.updateUserCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return (apiclient.updateUser(cmd)) + + @classmethod + def login(cls, apiclient, username, password, domain=None, domainid=None): + """Logins to the CloudStack""" + + cmd = login.loginCmd() + cmd.username = username + cmd.password = password + if domain: + cmd.domain = domain + if domainid: + cmd.domainId = domainid + return apiclient.login(cmd) + + +class VirtualMachine: + """Manage virtual machine lifecycle""" + + def __init__(self, items, services): + self.__dict__.update(items) + if "username" in services: + self.username = services["username"] + else: + self.username = 'root' + if "password" in services: + self.password = services["password"] + else: + self.password = 'password' + if "ssh_port" in services: + self.ssh_port = services["ssh_port"] + else: + self.ssh_port = 22 + self.ssh_client = None + # extract out the ipaddress + self.ipaddress = self.nic[0].ipaddress + + @classmethod + def ssh_access_group(cls, apiclient, cmd): + """ + Programs the security group with SSH access before deploying virtualmachine + @return: + """ + zone_list = Zone.list( + apiclient, + id=cmd.zoneid if cmd.zoneid else None, + domainid=cmd.domainid if cmd.domainid else None + ) + zone = zone_list[0] + #check if security groups settings is enabled for the zone + if zone.securitygroupsenabled: + list_security_groups = SecurityGroup.list( + apiclient, + securitygroupname="basic_sec_grp" + ) + + if not isinstance(list_security_groups, list): + basic_mode_security_group = SecurityGroup.create( + apiclient, + {"name": "basic_sec_grp"} + ) + sec_grp_services = { + "protocol": "TCP", + "startport": 22, + "endport": 22, + "cidrlist": "0.0.0.0/0" + } + #Authorize security group for above ingress rule + basic_mode_security_group.authorize(apiclient, sec_grp_services, account=cmd.account, + domainid=cmd.domainid) + else: + basic_mode_security_group = list_security_groups[0] + + if isinstance(cmd.securitygroupids, list): + cmd.securitygroupids.append(basic_mode_security_group.id) + else: + cmd.securitygroupids = [basic_mode_security_group.id] + + @classmethod + def access_ssh_over_nat(cls, apiclient, services, virtual_machine, allow_egress=False): + """ + Program NAT and PF rules to open up ssh access to deployed guest + @return: + """ + public_ip = PublicIPAddress.create( + apiclient=apiclient, + accountid=virtual_machine.account, + zoneid=virtual_machine.zoneid, + domainid=virtual_machine.domainid, + services=services + ) + FireWallRule.create( + apiclient=apiclient, + ipaddressid=public_ip.ipaddress.id, + protocol='TCP', + cidrlist=['0.0.0.0/0'], + startport=22, + endport=22 + ) + nat_rule = NATRule.create( + apiclient=apiclient, + virtual_machine=virtual_machine, + services=services, + ipaddressid=public_ip.ipaddress.id + ) + if allow_egress: + EgressFireWallRule.create( + apiclient=apiclient, + networkid=virtual_machine.nic[0].networkid, + protocol='All', + cidrlist='0.0.0.0/0' + ) + virtual_machine.ssh_ip = nat_rule.ipaddress + virtual_machine.public_ip = nat_rule.ipaddress + + @classmethod + def create(cls, apiclient, services, templateid=None, accountid=None, + domainid=None, zoneid=None, networkids=None, serviceofferingid=None, + securitygroupids=None, projectid=None, startvm=None, + diskofferingid=None, affinitygroupnames=None, affinitygroupids=None, group=None, + hostid=None, keypair=None, ipaddress=None, mode='default', method='GET'): + """Create the instance""" + + cmd = deployVirtualMachine.deployVirtualMachineCmd() + + if serviceofferingid: + cmd.serviceofferingid = serviceofferingid + elif "serviceoffering" in services: + cmd.serviceofferingid = services["serviceoffering"] + + if zoneid: + cmd.zoneid = zoneid + elif "zoneid" in services: + cmd.zoneid = services["zoneid"] + cmd.hypervisor = apiclient.hypervisor + + if "displayname" in services: + cmd.displayname = services["displayname"] + + if "name" in services: + cmd.name = services["name"] + + if accountid: + cmd.account = accountid + elif "account" in services: + cmd.account = services["account"] + + if domainid: + cmd.domainid = domainid + elif "domainid" in services: + cmd.domainid = services["domainid"] + + if networkids: + cmd.networkids = networkids + allow_egress = False + elif "networkids" in services: + cmd.networkids = services["networkids"] + allow_egress = False + else: + # When no networkids are passed, network + # is created using the "defaultOfferingWithSourceNAT" + # which has an egress policy of DENY. But guests in tests + # need access to test network connectivity + allow_egress = True + + if templateid: + cmd.templateid = templateid + elif "template" in services: + cmd.templateid = services["template"] + + if diskofferingid: + cmd.diskofferingid = diskofferingid + elif "diskoffering" in services: + cmd.diskofferingid = services["diskoffering"] + + if keypair: + cmd.keypair = keypair + elif "keypair" in services: + cmd.keypair = services["keypair"] + + if ipaddress: + cmd.ipaddress = ipaddress + elif ipaddress in services: + cmd.ipaddress = services["ipaddress"] + + if securitygroupids: + cmd.securitygroupids = [str(sg_id) for sg_id in securitygroupids] + + if "affinitygroupnames" in services: + cmd.affinitygroupnames = services["affinitygroupnames"] + elif affinitygroupnames: + cmd.affinitygroupnames = affinitygroupnames + + if affinitygroupids: + cmd.affinitygroupids = affinitygroupids + + if projectid: + cmd.projectid = projectid + + if startvm is not None: + cmd.startvm = startvm + + if hostid: + cmd.hostid = hostid + + if "userdata" in services: + cmd.userdata = base64.urlsafe_b64encode(services["userdata"]) + + if group: + cmd.group = group + + #program default access to ssh + if mode.lower() == 'basic': + cls.ssh_access_group(apiclient, cmd) + + virtual_machine = apiclient.deployVirtualMachine(cmd, method=method) + + virtual_machine.ssh_ip = virtual_machine.nic[0].ipaddress + if startvm == False: + virtual_machine.public_ip = virtual_machine.nic[0].ipaddress + return VirtualMachine(virtual_machine.__dict__, services) + + #program ssh access over NAT via PF + if mode.lower() == 'advanced': + cls.access_ssh_over_nat(apiclient, services, virtual_machine, allow_egress=allow_egress) + elif mode.lower() == 'basic': + if virtual_machine.publicip is not None: + vm_ssh_ip = virtual_machine.publicip #EIP/ELB (netscaler) enabled zone + else: + vm_ssh_ip = virtual_machine.nic[0].ipaddress #regular basic zone with security group + virtual_machine.ssh_ip = vm_ssh_ip + virtual_machine.public_ip = vm_ssh_ip + + return VirtualMachine(virtual_machine.__dict__, services) + + def start(self, apiclient): + """Start the instance""" + cmd = startVirtualMachine.startVirtualMachineCmd() + cmd.id = self.id + apiclient.startVirtualMachine(cmd) + + def stop(self, apiclient): + """Stop the instance""" + cmd = stopVirtualMachine.stopVirtualMachineCmd() + cmd.id = self.id + apiclient.stopVirtualMachine(cmd) + + def reboot(self, apiclient): + """Reboot the instance""" + cmd = rebootVirtualMachine.rebootVirtualMachineCmd() + cmd.id = self.id + apiclient.rebootVirtualMachine(cmd) + + def recover(self, apiclient): + """Recover the instance""" + cmd = recoverVirtualMachine.recoverVirtualMachineCmd() + cmd.id = self.id + apiclient.recoverVirtualMachine(cmd) + + def get_ssh_client(self, ipaddress=None, reconnect=False, port=None, keyPairFileLocation=None): + """Get SSH object of VM""" + + # If NAT Rules are not created while VM deployment in Advanced mode + # then, IP address must be passed + if ipaddress != None: + self.ssh_ip = ipaddress + if port: + self.ssh_port = port + + if keyPairFileLocation is not None: + self.password = None + + if reconnect: + self.ssh_client = is_server_ssh_ready( + self.ssh_ip, + self.ssh_port, + self.username, + self.password, + keyPairFileLocation=keyPairFileLocation + ) + self.ssh_client = self.ssh_client or is_server_ssh_ready( + self.ssh_ip, + self.ssh_port, + self.username, + self.password, + keyPairFileLocation=keyPairFileLocation + ) + return self.ssh_client + + def resetSshKey(self, apiclient, **kwargs): + """Resets SSH key""" + + cmd = resetSSHKeyForVirtualMachine.resetSSHKeyForVirtualMachineCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.resetSSHKeyForVirtualMachine(cmd)) + + def update(self, apiclient, **kwargs): + """Updates the VM data""" + + cmd = updateVirtualMachine.updateVirtualMachineCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateVirtualMachine(cmd)) + + def delete(self, apiclient): + """Destroy an Instance""" + cmd = destroyVirtualMachine.destroyVirtualMachineCmd() + cmd.id = self.id + apiclient.destroyVirtualMachine(cmd) + + def migrate(self, apiclient, hostid=None): + """migrate an Instance""" + cmd = migrateVirtualMachine.migrateVirtualMachineCmd() + cmd.virtualmachineid = self.id + if hostid: + cmd.hostid = hostid + apiclient.migrateVirtualMachine(cmd) + + def attach_volume(self, apiclient, volume): + """Attach volume to instance""" + cmd = attachVolume.attachVolumeCmd() + cmd.id = volume.id + cmd.virtualmachineid = self.id + return apiclient.attachVolume(cmd) + + def detach_volume(self, apiclient, volume): + """Detach volume to instance""" + cmd = detachVolume.detachVolumeCmd() + cmd.id = volume.id + return apiclient.detachVolume(cmd) + + def add_nic(self, apiclient, networkId): + """Add a NIC to a VM""" + cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd() + cmd.virtualmachineid = self.id + cmd.networkid = networkId + return apiclient.addNicToVirtualMachine(cmd) + + def remove_nic(self, apiclient, nicId): + """Remove a NIC to a VM""" + cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd() + cmd.nicid = nicId + cmd.virtualmachineid = self.id + return apiclient.removeNicFromVirtualMachine(cmd) + + def update_default_nic(self, apiclient, nicId): + """Set a NIC to be the default network adapter for a VM""" + cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd() + cmd.nicid = nicId + cmd.virtualmachineid = self.id + return apiclient.updateDefaultNicForVirtualMachine(cmd) + + def attach_iso(self, apiclient, iso): + """Attach ISO to instance""" + cmd = attachIso.attachIsoCmd() + cmd.id = iso.id + cmd.virtualmachineid = self.id + return apiclient.attachIso(cmd) + + def detach_iso(self, apiclient): + """Detach ISO to instance""" + cmd = detachIso.detachIsoCmd() + cmd.id = self.id + return apiclient.detachIso(cmd) + + def change_service_offering(self, apiclient, serviceOfferingId): + """Change service offering of the instance""" + cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd() + cmd.id = self.id + cmd.serviceofferingid = serviceOfferingId + return apiclient.changeServiceForVirtualMachine(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all VMs matching criteria""" + + cmd = listVirtualMachines.listVirtualMachinesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVirtualMachines(cmd)) + + def resetPassword(self, apiclient): + """Resets VM password if VM created using password enabled template""" + + cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd() + cmd.id = self.id + try: + response = apiclient.resetPasswordForVirtualMachine(cmd) + except Exception as e: + raise Exception("Reset Password failed! - %s" % e) + if response is not None: + return response.password + + def assign_virtual_machine(self, apiclient, account, domainid): + """Move a user VM to another user under same domain.""" + + cmd = assignVirtualMachine.assignVirtualMachineCmd() + cmd.virtualmachineid = self.id + cmd.account = account + cmd.domainid = domainid + try: + response = apiclient.assignVirtualMachine(cmd) + return response + except Exception as e: + raise Exception("assignVirtualMachine failed - %s" %e) + + def update_affinity_group(self, apiclient, affinitygroupids=None, + affinitygroupnames=None): + """Update affinity group of a VM""" + cmd = updateVMAffinityGroup.updateVMAffinityGroupCmd() + cmd.id = self.id + + if affinitygroupids: + cmd.affinitygroupids = affinitygroupids + + if affinitygroupnames: + cmd.affinitygroupnames = affinitygroupnames + + return apiclient.updateVMAffinityGroup(cmd) + + +class Volume: + """Manage Volume Life cycle + """ + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, zoneid=None, account=None, + domainid=None, diskofferingid=None, projectid=None): + """Create Volume""" + cmd = createVolume.createVolumeCmd() + cmd.name = services["diskname"] + + if diskofferingid: + cmd.diskofferingid = diskofferingid + elif "diskofferingid" in services: + cmd.diskofferingid = services["diskofferingid"] + + if zoneid: + cmd.zoneid = zoneid + elif "zoneid" in services: + cmd.zoneid = services["zoneid"] + + if account: + cmd.account = account + elif "account" in services: + cmd.account = services["account"] + + if domainid: + cmd.domainid = domainid + elif "domainid" in services: + cmd.domainid = services["domainid"] + + if projectid: + cmd.projectid = projectid + return Volume(apiclient.createVolume(cmd).__dict__) + + @classmethod + def create_custom_disk(cls, apiclient, services, account=None, + domainid=None, diskofferingid=None): + """Create Volume from Custom disk offering""" + cmd = createVolume.createVolumeCmd() + cmd.name = services["diskname"] + + if diskofferingid: + cmd.diskofferingid = diskofferingid + elif "customdiskofferingid" in services: + cmd.diskofferingid = services["customdiskofferingid"] + + cmd.size = services["customdisksize"] + cmd.zoneid = services["zoneid"] + + if account: + cmd.account = account + else: + cmd.account = services["account"] + + if domainid: + cmd.domainid = domainid + else: + cmd.domainid = services["domainid"] + + return Volume(apiclient.createVolume(cmd).__dict__) + + @classmethod + def create_from_snapshot(cls, apiclient, snapshot_id, services, + account=None, domainid=None): + """Create Volume from snapshot""" + cmd = createVolume.createVolumeCmd() + cmd.name = "-".join([services["diskname"], random_gen()]) + cmd.snapshotid = snapshot_id + cmd.zoneid = services["zoneid"] + cmd.size = services["size"] + if account: + cmd.account = account + else: + cmd.account = services["account"] + if domainid: + cmd.domainid = domainid + else: + cmd.domainid = services["domainid"] + return Volume(apiclient.createVolume(cmd).__dict__) + + def delete(self, apiclient): + """Delete Volume""" + cmd = deleteVolume.deleteVolumeCmd() + cmd.id = self.id + apiclient.deleteVolume(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all volumes matching criteria""" + + cmd = listVolumes.listVolumesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVolumes(cmd)) + + def resize(self, apiclient, **kwargs): + """Resize a volume""" + cmd = resizeVolume.resizeVolumeCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.resizeVolume(cmd)) + + @classmethod + def upload(cls, apiclient, services, zoneid=None, account=None, domainid=None, url=None): + """Uploads the volume to specified account""" + + cmd = uploadVolume.uploadVolumeCmd() + if zoneid: + cmd.zoneid = zoneid + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + cmd.format = services["format"] + cmd.name = services["diskname"] + if url: + cmd.url = url + else: + cmd.url = services["url"] + return Volume(apiclient.uploadVolume(cmd).__dict__) + + def wait_for_upload(self, apiclient, timeout=5, interval=60): + """Wait for upload""" + # Sleep to ensure template is in proper state before download + time.sleep(interval) + + while True: + volume_response = Volume.list( + apiclient, + id=self.id, + zoneid=self.zoneid, + ) + if isinstance(volume_response, list): + + volume = volume_response[0] + # If volume is ready, + # volume.state = Allocated + if volume.state == 'Uploaded': + break + + elif 'Uploading' in volume.state: + time.sleep(interval) + + elif 'Installing' not in volume.state: + raise Exception( + "Error in uploading volume: status - %s" % + volume.state) + elif timeout == 0: + break + + else: + time.sleep(interval) + timeout = timeout - 1 + return + + @classmethod + def migrate(cls, apiclient, **kwargs): + """Migrate a volume""" + cmd = migrateVolume.migrateVolumeCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.migrateVolume(cmd)) + +class Snapshot: + """Manage Snapshot Lifecycle + """ + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, volume_id, account=None, + domainid=None, projectid=None): + """Create Snapshot""" + cmd = createSnapshot.createSnapshotCmd() + cmd.volumeid = volume_id + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + if projectid: + cmd.projectid = projectid + return Snapshot(apiclient.createSnapshot(cmd).__dict__) + + def delete(self, apiclient): + """Delete Snapshot""" + cmd = deleteSnapshot.deleteSnapshotCmd() + cmd.id = self.id + apiclient.deleteSnapshot(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all snapshots matching criteria""" + + cmd = listSnapshots.listSnapshotsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listSnapshots(cmd)) + + +class Template: + """Manage template life cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, volumeid=None, + account=None, domainid=None, projectid=None): + """Create template from Volume""" + # Create template from Virtual machine and Volume ID + cmd = createTemplate.createTemplateCmd() + cmd.displaytext = services["displaytext"] + cmd.name = "-".join([services["name"], random_gen()]) + if "ostypeid" in services: + cmd.ostypeid = services["ostypeid"] + elif "ostype" in services: + # Find OSTypeId from Os type + sub_cmd = listOsTypes.listOsTypesCmd() + sub_cmd.description = services["ostype"] + ostypes = apiclient.listOsTypes(sub_cmd) + + if not isinstance(ostypes, list): + raise Exception( + "Unable to find Ostype id with desc: %s" % + services["ostype"]) + cmd.ostypeid = ostypes[0].id + else: + raise Exception( + "Unable to find Ostype is required for creating template") + + cmd.isfeatured = services["isfeatured"] if "isfeatured" in services else False + cmd.ispublic = services["ispublic"] if "ispublic" in services else False + cmd.isextractable = services["isextractable"] if "isextractable" in services else False + cmd.passwordenabled = services["passwordenabled"] if "passwordenabled" in services else False + + if volumeid: + cmd.volumeid = volumeid + + if account: + cmd.account = account + + if domainid: + cmd.domainid = domainid + + if projectid: + cmd.projectid = projectid + return Template(apiclient.createTemplate(cmd).__dict__) + + @classmethod + def register(cls, apiclient, services, zoneid=None, + account=None, domainid=None): + """Create template from URL""" + + # Create template from Virtual machine and Volume ID + cmd = registerTemplate.registerTemplateCmd() + cmd.displaytext = services["displaytext"] + cmd.name = "-".join([services["name"], random_gen()]) + cmd.format = services["format"] + cmd.hypervisor = apiclient.hypervisor + + if "ostypeid" in services: + cmd.ostypeid = services["ostypeid"] + elif "ostype" in services: + # Find OSTypeId from Os type + sub_cmd = listOsTypes.listOsTypesCmd() + sub_cmd.description = services["ostype"] + ostypes = apiclient.listOsTypes(sub_cmd) + + if not isinstance(ostypes, list): + raise Exception( + "Unable to find Ostype id with desc: %s" % + services["ostype"]) + cmd.ostypeid = ostypes[0].id + else: + raise Exception( + "Unable to find Ostype is required for registering template") + + cmd.url = services["url"] + + if zoneid: + cmd.zoneid = zoneid + else: + cmd.zoneid = services["zoneid"] + + cmd.isfeatured = services["isfeatured"] if "isfeatured" in services else False + cmd.ispublic = services["ispublic"] if "ispublic" in services else False + cmd.isextractable = services["isextractable"] if "isextractable" in services else False + cmd.passwordenabled = services["passwordenabled"] if "passwordenabled" in services else False + + if account: + cmd.account = account + + if domainid: + cmd.domainid = domainid + + # Register Template + template = apiclient.registerTemplate(cmd) + + if isinstance(template, list): + return Template(template[0].__dict__) + + @classmethod + def extract(cls, apiclient, id, mode, zoneid=None): + "Extract template " + + cmd = extractTemplate.extractTemplateCmd() + cmd.id = id + cmd.mode = mode + cmd.zoneid = zoneid + + return apiclient.extractTemplate(cmd) + + @classmethod + def create_from_snapshot(cls, apiclient, snapshot, services, + random_name=True): + """Create Template from snapshot""" + # Create template from Virtual machine and Snapshot ID + cmd = createTemplate.createTemplateCmd() + cmd.displaytext = services["displaytext"] + cmd.name = "-".join([ + services["name"], + random_gen() + ]) if random_name else services["name"] + + if "ostypeid" in services: + cmd.ostypeid = services["ostypeid"] + elif "ostype" in services: + # Find OSTypeId from Os type + sub_cmd = listOsTypes.listOsTypesCmd() + sub_cmd.description = services["ostype"] + ostypes = apiclient.listOsTypes(sub_cmd) + + if not isinstance(ostypes, list): + raise Exception( + "Unable to find Ostype id with desc: %s" % + services["ostype"]) + cmd.ostypeid = ostypes[0].id + else: + raise Exception( + "Unable to find Ostype is required for creating template") + + cmd.snapshotid = snapshot.id + return Template(apiclient.createTemplate(cmd).__dict__) + + def delete(self, apiclient): + """Delete Template""" + + cmd = deleteTemplate.deleteTemplateCmd() + cmd.id = self.id + apiclient.deleteTemplate(cmd) + + def download(self, apiclient, timeout=5, interval=60): + """Download Template""" + # Sleep to ensure template is in proper state before download + time.sleep(interval) + + while True: + template_response = Template.list( + apiclient, + id=self.id, + zoneid=self.zoneid, + templatefilter='self' + ) + if isinstance(template_response, list): + + template = template_response[0] + # If template is ready, + # template.status = Download Complete + # Downloading - x% Downloaded + # Error - Any other string + if template.status == 'Download Complete': + break + + elif 'Downloaded' in template.status: + time.sleep(interval) + + elif 'Installing' not in template.status: + raise Exception( + "Error in downloading template: status - %s" % + template.status) + + elif timeout == 0: + break + + else: + time.sleep(interval) + timeout = timeout - 1 + return + + def updatePermissions(self, apiclient, **kwargs): + """Updates the template permissions""" + + cmd = updateTemplatePermissions.updateTemplatePermissionsCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateTemplatePermissions(cmd)) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all templates matching criteria""" + + cmd = listTemplates.listTemplatesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listTemplates(cmd)) + + +class Iso: + """Manage ISO life cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, account=None, domainid=None, + projectid=None): + """Create an ISO""" + # Create ISO from URL + cmd = registerIso.registerIsoCmd() + cmd.displaytext = services["displaytext"] + cmd.name = services["name"] + if "ostypeid" in services: + cmd.ostypeid = services["ostypeid"] + elif "ostype" in services: + # Find OSTypeId from Os type + sub_cmd = listOsTypes.listOsTypesCmd() + sub_cmd.description = services["ostype"] + ostypes = apiclient.listOsTypes(sub_cmd) + + if not isinstance(ostypes, list): + raise Exception( + "Unable to find Ostype id with desc: %s" % + services["ostype"]) + cmd.ostypeid = ostypes[0].id + else: + raise Exception( + "Unable to find Ostype is required for creating ISO") + + cmd.url = services["url"] + cmd.zoneid = services["zoneid"] + + if "isextractable" in services: + cmd.isextractable = services["isextractable"] + if "isfeatured" in services: + cmd.isfeatured = services["isfeatured"] + if "ispublic" in services: + cmd.ispublic = services["ispublic"] + + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + if projectid: + cmd.projectid = projectid + # Register ISO + iso = apiclient.registerIso(cmd) + + if iso: + return Iso(iso[0].__dict__) + + def delete(self, apiclient): + """Delete an ISO""" + cmd = deleteIso.deleteIsoCmd() + cmd.id = self.id + apiclient.deleteIso(cmd) + return + + def download(self, apiclient, timeout=5, interval=60): + """Download an ISO""" + # Ensuring ISO is successfully downloaded + while True: + time.sleep(interval) + + cmd = listIsos.listIsosCmd() + cmd.id = self.id + iso_response = apiclient.listIsos(cmd) + + if isinstance(iso_response, list): + response = iso_response[0] + # Again initialize timeout to avoid listISO failure + timeout = 5 + # Check whether download is in progress(for Ex:10% Downloaded) + # or ISO is 'Successfully Installed' + if response.status == 'Successfully Installed': + return + elif 'Downloaded' not in response.status and \ + 'Installing' not in response.status: + raise Exception( + "Error In Downloading ISO: ISO Status - %s" % + response.status) + + elif timeout == 0: + raise Exception("ISO download Timeout Exception") + else: + timeout = timeout - 1 + return + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all available ISO files.""" + + cmd = listIsos.listIsosCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listIsos(cmd)) + + +class PublicIPAddress: + """Manage Public IP Addresses""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, accountid=None, zoneid=None, domainid=None, services=None, + networkid=None, projectid=None, vpcid=None, isportable=False): + """Associate Public IP address""" + cmd = associateIpAddress.associateIpAddressCmd() + + if accountid: + cmd.account = accountid + elif "account" in services: + cmd.account = services["account"] + + if zoneid: + cmd.zoneid = zoneid + elif "zoneid" in services: + cmd.zoneid = services["zoneid"] + + if domainid: + cmd.domainid = domainid + elif "domainid" in services: + cmd.domainid = services["domainid"] + + if isportable: + cmd.isportable = isportable + + if networkid: + cmd.networkid = networkid + + if projectid: + cmd.projectid = projectid + + if vpcid: + cmd.vpcid = vpcid + return PublicIPAddress(apiclient.associateIpAddress(cmd).__dict__) + + def delete(self, apiclient): + """Dissociate Public IP address""" + cmd = disassociateIpAddress.disassociateIpAddressCmd() + cmd.id = self.ipaddress.id + apiclient.disassociateIpAddress(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """List all Public IPs matching criteria""" + + cmd = listPublicIpAddresses.listPublicIpAddressesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listPublicIpAddresses(cmd)) + + +class NATRule: + """Manage port forwarding rule""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, virtual_machine, services, ipaddressid=None, + projectid=None, openfirewall=False, networkid=None, vpcid=None): + """Create Port forwarding rule""" + cmd = createPortForwardingRule.createPortForwardingRuleCmd() + + if ipaddressid: + cmd.ipaddressid = ipaddressid + elif "ipaddressid" in services: + cmd.ipaddressid = services["ipaddressid"] + + cmd.privateport = services["privateport"] + cmd.publicport = services["publicport"] + if "privateendport" in services: + cmd.privateendport = services["privateendport"] + if "publicendport" in services: + cmd.publicendport = services["publicendport"] + cmd.protocol = services["protocol"] + cmd.virtualmachineid = virtual_machine.id + + if projectid: + cmd.projectid = projectid + + if openfirewall: + cmd.openfirewall = True + + if networkid: + cmd.networkid = networkid + + if vpcid: + cmd.vpcid = vpcid + return NATRule(apiclient.createPortForwardingRule(cmd).__dict__) + + def delete(self, apiclient): + """Delete port forwarding""" + cmd = deletePortForwardingRule.deletePortForwardingRuleCmd() + cmd.id = self.id + apiclient.deletePortForwardingRule(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """List all NAT rules matching criteria""" + + cmd = listPortForwardingRules.listPortForwardingRulesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listPortForwardingRules(cmd)) + + +class StaticNATRule: + """Manage Static NAT rule""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, ipaddressid=None, networkid=None, vpcid=None): + """Creates static ip forwarding rule""" + + cmd = createFirewallRule.createFirewallRuleCmd() + cmd.protocol = services["protocol"] + cmd.startport = services["startport"] + + if "endport" in services: + cmd.endport = services["endport"] + + if "cidrlist" in services: + cmd.cidrlist = services["cidrlist"] + + if ipaddressid: + cmd.ipaddressid = ipaddressid + elif "ipaddressid" in services: + cmd.ipaddressid = services["ipaddressid"] + + if networkid: + cmd.networkid = networkid + + if vpcid: + cmd.vpcid = vpcid + return StaticNATRule(apiclient.createFirewallRule(cmd).__dict__) + + def delete(self, apiclient): + """Delete IP forwarding rule""" + cmd = deleteIpForwardingRule.deleteIpForwardingRuleCmd() + cmd.id = self.id + apiclient.deleteIpForwardingRule(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """List all IP forwarding rules matching criteria""" + + cmd = listIpForwardingRules.listIpForwardingRulesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listIpForwardingRules(cmd)) + + @classmethod + def enable(cls, apiclient, ipaddressid, virtualmachineid, networkid=None): + """Enables Static NAT rule""" + + cmd = enableStaticNat.enableStaticNatCmd() + cmd.ipaddressid = ipaddressid + cmd.virtualmachineid = virtualmachineid + if networkid: + cmd.networkid = networkid + apiclient.enableStaticNat(cmd) + return + + @classmethod + def disable(cls, apiclient, ipaddressid, virtualmachineid): + """Disables Static NAT rule""" + + cmd = disableStaticNat.disableStaticNatCmd() + cmd.ipaddressid = ipaddressid + apiclient.disableStaticNat(cmd) + return + + +class EgressFireWallRule: + """Manage Egress Firewall rule""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, networkid, protocol, cidrlist=None, + startport=None, endport=None): + """Create Egress Firewall Rule""" + cmd = createEgressFirewallRule.createEgressFirewallRuleCmd() + cmd.networkid = networkid + cmd.protocol = protocol + if cidrlist: + cmd.cidrlist = cidrlist + if startport: + cmd.startport = startport + if endport: + cmd.endport = endport + + return EgressFireWallRule(apiclient.createEgressFirewallRule(cmd).__dict__) + + def delete(self, apiclient): + """Delete Egress Firewall rule""" + cmd = deleteEgressFirewallRule.deleteEgressFirewallRuleCmd() + cmd.id = self.id + apiclient.deleteEgressFirewallRule(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """List all Egress Firewall Rules matching criteria""" + + cmd = listEgressFirewallRules.listEgressFirewallRulesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listEgressFirewallRules(cmd)) + + + +class FireWallRule: + """Manage Firewall rule""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, ipaddressid, protocol, cidrlist=None, + startport=None, endport=None, projectid=None, vpcid=None): + """Create Firewall Rule""" + cmd = createFirewallRule.createFirewallRuleCmd() + cmd.ipaddressid = ipaddressid + cmd.protocol = protocol + if cidrlist: + cmd.cidrlist = cidrlist + if startport: + cmd.startport = startport + if endport: + cmd.endport = endport + + if projectid: + cmd.projectid = projectid + + if vpcid: + cmd.vpcid = vpcid + + return FireWallRule(apiclient.createFirewallRule(cmd).__dict__) + + def delete(self, apiclient): + """Delete Firewall rule""" + cmd = deleteFirewallRule.deleteFirewallRuleCmd() + cmd.id = self.id + apiclient.deleteFirewallRule(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """List all Firewall Rules matching criteria""" + + cmd = listFirewallRules.listFirewallRulesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listFirewallRules(cmd)) + + +class ServiceOffering: + """Manage service offerings cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, domainid=None, **kwargs): + """Create Service offering""" + cmd = createServiceOffering.createServiceOfferingCmd() + cmd.cpunumber = services["cpunumber"] + cmd.cpuspeed = services["cpuspeed"] + cmd.displaytext = services["displaytext"] + cmd.memory = services["memory"] + cmd.name = services["name"] + if "storagetype" in services: + cmd.storagetype = services["storagetype"] + + if "systemvmtype" in services: + cmd.systemvmtype = services['systemvmtype'] + + if "issystem" in services: + cmd.issystem = services['issystem'] + + if "tags" in services: + cmd.tags = services["tags"] + + if "deploymentplanner" in services: + cmd.deploymentplanner = services["deploymentplanner"] + + # Service Offering private to that domain + if domainid: + cmd.domainid = domainid + + [setattr(cmd, k, v) for k, v in kwargs.items()] + return ServiceOffering(apiclient.createServiceOffering(cmd).__dict__) + + def delete(self, apiclient): + """Delete Service offering""" + cmd = deleteServiceOffering.deleteServiceOfferingCmd() + cmd.id = self.id + apiclient.deleteServiceOffering(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all available service offerings.""" + + cmd = listServiceOfferings.listServiceOfferingsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listServiceOfferings(cmd)) + + +class DiskOffering: + """Manage disk offerings cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, custom=False, domainid=None): + """Create Disk offering""" + cmd = createDiskOffering.createDiskOfferingCmd() + cmd.displaytext = services["displaytext"] + cmd.name = services["name"] + if custom: + cmd.customized = True + else: + cmd.disksize = services["disksize"] + + if domainid: + cmd.domainid = domainid + + if "storagetype" in services: + cmd.storagetype = services["storagetype"] + + return DiskOffering(apiclient.createDiskOffering(cmd).__dict__) + + def delete(self, apiclient): + """Delete Disk offering""" + cmd = deleteDiskOffering.deleteDiskOfferingCmd() + cmd.id = self.id + apiclient.deleteDiskOffering(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all available disk offerings.""" + + cmd = listDiskOfferings.listDiskOfferingsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listDiskOfferings(cmd)) + + +class NetworkOffering: + """Manage network offerings cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, **kwargs): + """Create network offering""" + + cmd = createNetworkOffering.createNetworkOfferingCmd() + cmd.displaytext = "-".join([services["displaytext"], random_gen()]) + cmd.name = "-".join([services["name"], random_gen()]) + cmd.guestiptype = services["guestiptype"] + cmd.supportedservices = '' + if "supportedservices" in services: + cmd.supportedservices = services["supportedservices"] + cmd.traffictype = services["traffictype"] + + if "useVpc" in services: + cmd.useVpc = services["useVpc"] + cmd.serviceproviderlist = [] + if "serviceProviderList" in services: + for service, provider in services["serviceProviderList"].items(): + cmd.serviceproviderlist.append({ + 'service': service, + 'provider': provider + }) + if "serviceCapabilityList" in services: + cmd.servicecapabilitylist = [] + for service, capability in services["serviceCapabilityList"].items(): + for ctype, value in capability.items(): + cmd.servicecapabilitylist.append({ + 'service': service, + 'capabilitytype': ctype, + 'capabilityvalue': value + }) + if "specifyVlan" in services: + cmd.specifyVlan = services["specifyVlan"] + if "specifyIpRanges" in services: + cmd.specifyIpRanges = services["specifyIpRanges"] + if "ispersistent" in services: + cmd.ispersistent = services["ispersistent"] + if "egress_policy" in services: + cmd.egressdefaultpolicy = services["egress_policy"] + + cmd.availability = 'Optional' + + [setattr(cmd, k, v) for k, v in kwargs.items()] + + return NetworkOffering(apiclient.createNetworkOffering(cmd).__dict__) + + def delete(self, apiclient): + """Delete network offering""" + cmd = deleteNetworkOffering.deleteNetworkOfferingCmd() + cmd.id = self.id + apiclient.deleteNetworkOffering(cmd) + return + + def update(self, apiclient, **kwargs): + """Lists all available network offerings.""" + + cmd = updateNetworkOffering.updateNetworkOfferingCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateNetworkOffering(cmd)) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all available network offerings.""" + + cmd = listNetworkOfferings.listNetworkOfferingsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetworkOfferings(cmd)) + + +class SnapshotPolicy: + """Manage snapshot policies""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, volumeid, services): + """Create Snapshot policy""" + cmd = createSnapshotPolicy.createSnapshotPolicyCmd() + cmd.intervaltype = services["intervaltype"] + cmd.maxsnaps = services["maxsnaps"] + cmd.schedule = services["schedule"] + cmd.timezone = services["timezone"] + cmd.volumeid = volumeid + return SnapshotPolicy(apiclient.createSnapshotPolicy(cmd).__dict__) + + def delete(self, apiclient): + """Delete Snapshot policy""" + cmd = deleteSnapshotPolicies.deleteSnapshotPoliciesCmd() + cmd.id = self.id + apiclient.deleteSnapshotPolicies(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists snapshot policies.""" + + cmd = listSnapshotPolicies.listSnapshotPoliciesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listSnapshotPolicies(cmd)) + + +class LoadBalancerRule: + """Manage Load Balancer rule""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, ipaddressid=None, accountid=None, + networkid=None, vpcid=None, projectid=None, domainid=None): + """Create Load balancing Rule""" + + cmd = createLoadBalancerRule.createLoadBalancerRuleCmd() + + if ipaddressid: + cmd.publicipid = ipaddressid + elif "ipaddressid" in services: + cmd.publicipid = services["ipaddressid"] + + if accountid: + cmd.account = accountid + elif "account" in services: + cmd.account = services["account"] + + if domainid: + cmd.domainid = domainid + + if vpcid: + cmd.vpcid = vpcid + cmd.name = services["name"] + cmd.algorithm = services["alg"] + cmd.privateport = services["privateport"] + cmd.publicport = services["publicport"] + + if "openfirewall" in services: + cmd.openfirewall = services["openfirewall"] + + if projectid: + cmd.projectid = projectid + + if networkid: + cmd.networkid = networkid + return LoadBalancerRule(apiclient.createLoadBalancerRule(cmd).__dict__) + + def delete(self, apiclient): + """Delete load balancing rule""" + cmd = deleteLoadBalancerRule.deleteLoadBalancerRuleCmd() + cmd.id = self.id + apiclient.deleteLoadBalancerRule(cmd) + return + + def assign(self, apiclient, vms): + """Assign virtual machines to load balancing rule""" + cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd() + cmd.id = self.id + cmd.virtualmachineids = [str(vm.id) for vm in vms] + apiclient.assignToLoadBalancerRule(cmd) + return + + def remove(self, apiclient, vms): + """Remove virtual machines from load balancing rule""" + cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd() + cmd.id = self.id + cmd.virtualmachineids = [str(vm.id) for vm in vms] + apiclient.removeFromLoadBalancerRule(cmd) + return + + def update(self, apiclient, algorithm=None, description=None, name=None, **kwargs): + """Updates the load balancing rule""" + cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd() + cmd.id = self.id + if algorithm: + cmd.algorithm = algorithm + if description: + cmd.description = description + if name: + cmd.name = name + + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.updateLoadBalancerRule(cmd) + + def createSticky(self, apiclient, methodname, name, description=None, param=None): + """Creates a sticky policy for the LB rule""" + + cmd = createLBStickinessPolicy.createLBStickinessPolicyCmd() + cmd.lbruleid = self.id + cmd.methodname = methodname + cmd.name = name + if description: + cmd.description = description + if param: + cmd.param = [] + for name, value in param.items(): + cmd.param.append({'name': name, 'value': value}) + return apiclient.createLBStickinessPolicy(cmd) + + def deleteSticky(self, apiclient, id): + """Deletes stickyness policy""" + + cmd = deleteLBStickinessPolicy.deleteLBStickinessPolicyCmd() + cmd.id = id + return apiclient.deleteLBStickinessPolicy(cmd) + + @classmethod + def listStickyPolicies(cls, apiclient, lbruleid, **kwargs): + """Lists stickiness policies for load balancing rule""" + + cmd = listLBStickinessPolicies.listLBStickinessPoliciesCmd() + cmd.lbruleid = lbruleid + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.listLBStickinessPolicies(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all Load balancing rules matching criteria""" + + cmd = listLoadBalancerRules.listLoadBalancerRulesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listLoadBalancerRules(cmd)) + + +class Cluster: + """Manage Cluster life cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, zoneid=None, podid=None): + """Create Cluster""" + cmd = addCluster.addClusterCmd() + cmd.clustertype = services["clustertype"] + cmd.hypervisor = apiclient.hypervisor + + if zoneid: + cmd.zoneid = zoneid + else: + cmd.zoneid = services["zoneid"] + + if podid: + cmd.podid = podid + else: + cmd.podid = services["podid"] + + if "username" in services: + cmd.username = services["username"] + if "password" in services: + cmd.password = services["password"] + if "url" in services: + cmd.url = services["url"] + if "clustername" in services: + cmd.clustername = services["clustername"] + + return Cluster(apiclient.addCluster(cmd)[0].__dict__) + + def delete(self, apiclient): + """Delete Cluster""" + cmd = deleteCluster.deleteClusterCmd() + cmd.id = self.id + apiclient.deleteCluster(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """List all Clusters matching criteria""" + + cmd = listClusters.listClustersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listClusters(cmd)) + + +class Host: + """Manage Host life cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, cluster, services, zoneid=None, podid=None): + """Create Host in cluster""" + + cmd = addHost.addHostCmd() + cmd.hypervisor = apiclient.hypervisor + cmd.url = services["url"] + cmd.clusterid = cluster.id + + if zoneid: + cmd.zoneid = zoneid + else: + cmd.zoneid = services["zoneid"] + + if podid: + cmd.podid = podid + else: + cmd.podid = services["podid"] + + if "clustertype" in services: + cmd.clustertype = services["clustertype"] + if "username" in services: + cmd.username = services["username"] + if "password" in services: + cmd.password = services["password"] + + # Add host + host = apiclient.addHost(cmd) + + if isinstance(host, list): + return Host(host[0].__dict__) + + def delete(self, apiclient): + """Delete Host""" + # Host must be in maintenance mode before deletion + cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd() + cmd.id = self.id + apiclient.prepareHostForMaintenance(cmd) + time.sleep(30) + + cmd = deleteHost.deleteHostCmd() + cmd.id = self.id + apiclient.deleteHost(cmd) + return + + def enableMaintenance(self, apiclient): + """enables maintenance mode Host""" + + cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd() + cmd.id = self.id + return apiclient.prepareHostForMaintenance(cmd) + + @classmethod + def enableMaintenance(cls, apiclient, id): + """enables maintenance mode Host""" + + cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd() + cmd.id = id + return apiclient.prepareHostForMaintenance(cmd) + + def cancelMaintenance(self, apiclient): + """Cancels maintenance mode Host""" + + cmd = cancelHostMaintenance.cancelHostMaintenanceCmd() + cmd.id = self.id + return apiclient.cancelHostMaintenance(cmd) + + @classmethod + def cancelMaintenance(cls, apiclient, id): + """Cancels maintenance mode Host""" + + cmd = cancelHostMaintenance.cancelHostMaintenanceCmd() + cmd.id = id + return apiclient.cancelHostMaintenance(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all Hosts matching criteria""" + + cmd = listHosts.listHostsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listHosts(cmd)) + + @classmethod + def listForMigration(cls, apiclient, **kwargs): + """List all Hosts for migration matching criteria""" + + cmd = findHostsForMigration.findHostsForMigrationCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.findHostsForMigration(cmd)) + + +class StoragePool: + """Manage Storage pools (Primary Storage)""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, clusterid=None, + zoneid=None, podid=None): + """Create Storage pool (Primary Storage)""" + + cmd = createStoragePool.createStoragePoolCmd() + cmd.name = services["name"] + + if podid: + cmd.podid = podid + else: + cmd.podid = services["podid"] + + cmd.url = services["url"] + if clusterid: + cmd.clusterid = clusterid + elif "clusterid" in services: + cmd.clusterid = services["clusterid"] + + if zoneid: + cmd.zoneid = zoneid + else: + cmd.zoneid = services["zoneid"] + + return StoragePool(apiclient.createStoragePool(cmd).__dict__) + + def delete(self, apiclient): + """Delete Storage pool (Primary Storage)""" + + # Storage pool must be in maintenance mode before deletion + cmd = enableStorageMaintenance.enableStorageMaintenanceCmd() + cmd.id = self.id + apiclient.enableStorageMaintenance(cmd) + time.sleep(30) + cmd = deleteStoragePool.deleteStoragePoolCmd() + cmd.id = self.id + apiclient.deleteStoragePool(cmd) + return + + def enableMaintenance(self, apiclient): + """enables maintenance mode Storage pool""" + + cmd = enableStorageMaintenance.enableStorageMaintenanceCmd() + cmd.id = self.id + return apiclient.enableStorageMaintenance(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all storage pools matching criteria""" + + cmd = listStoragePools.listStoragePoolsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listStoragePools(cmd)) + + @classmethod + def listForMigration(cls, apiclient, **kwargs): + """List all storage pools for migration matching criteria""" + + cmd = findStoragePoolsForMigration.findStoragePoolsForMigrationCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.findStoragePoolsForMigration(cmd)) + +class Network: + """Manage Network pools""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, accountid=None, domainid=None, + networkofferingid=None, projectid=None, + subdomainaccess=None, zoneid=None, + gateway=None, netmask=None, vpcid=None, aclid=None): + """Create Network for account""" + cmd = createNetwork.createNetworkCmd() + cmd.name = services["name"] + cmd.displaytext = services["displaytext"] + + if networkofferingid: + cmd.networkofferingid = networkofferingid + elif "networkoffering" in services: + cmd.networkofferingid = services["networkoffering"] + + if zoneid: + cmd.zoneid = zoneid + elif "zoneid" in services: + cmd.zoneid = services["zoneid"] + + if subdomainaccess is not None: + cmd.subdomainaccess = subdomainaccess + + if gateway: + cmd.gateway = gateway + elif "gateway" in services: + cmd.gateway = services["gateway"] + if netmask: + cmd.netmask = netmask + elif "netmask" in services: + cmd.netmask = services["netmask"] + if "startip" in services: + cmd.startip = services["startip"] + if "endip" in services: + cmd.endip = services["endip"] + if "vlan" in services: + cmd.vlan = services["vlan"] + if "acltype" in services: + cmd.acltype = services["acltype"] + + if accountid: + cmd.account = accountid + if domainid: + cmd.domainid = domainid + if projectid: + cmd.projectid = projectid + if vpcid: + cmd.vpcid = vpcid + if aclid: + cmd.aclid = aclid + return Network(apiclient.createNetwork(cmd).__dict__) + + def delete(self, apiclient): + """Delete Account""" + + cmd = deleteNetwork.deleteNetworkCmd() + cmd.id = self.id + apiclient.deleteNetwork(cmd) + + def update(self, apiclient, **kwargs): + """Updates network with parameters passed""" + + cmd = updateNetwork.updateNetworkCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateNetwork(cmd)) + + def restart(self, apiclient, cleanup=None): + """Restarts the network""" + + cmd = restartNetwork.restartNetworkCmd() + cmd.id = self.id + if cleanup: + cmd.cleanup = cleanup + return(apiclient.restartNetwork(cmd)) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all Networks matching criteria""" + + cmd = listNetworks.listNetworksCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetworks(cmd)) + + +class NetworkACL: + """Manage Network ACL lifecycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, networkid=None, protocol=None, + number=None, aclid=None, action='Allow', traffictype=None, cidrlist=[]): + """Create network ACL rules(Ingress/Egress)""" + + cmd = createNetworkACL.createNetworkACLCmd() + if "networkid" in services: + cmd.networkid = services["networkid"] + elif networkid: + cmd.networkid = networkid + + if "protocol" in services: + cmd.protocol = services["protocol"] + if services["protocol"] == 'ICMP': + cmd.icmptype = -1 + cmd.icmpcode = -1 + elif protocol: + cmd.protocol = protocol + + if "startport" in services: + cmd.startport = services["startport"] + if "endport" in services: + cmd.endport = services["endport"] + + if "cidrlist" in services: + cmd.cidrlist = services["cidrlist"] + elif cidrlist: + cmd.cidrlist = cidrlist + + if "traffictype" in services: + cmd.traffictype = services["traffictype"] + elif traffictype: + cmd.traffictype = traffictype + + if "action" in services: + cmd.action = services["action"] + elif action: + cmd.action = action + + if "number" in services: + cmd.number = services["number"] + elif number: + cmd.number = number + + if "aclid" in services: + cmd.aclid = services["aclid"] + elif aclid: + cmd.aclid = aclid + + # Defaulted to Ingress + return NetworkACL(apiclient.createNetworkACL(cmd).__dict__) + + def delete(self, apiclient): + """Delete network acl""" + + cmd = deleteNetworkACL.deleteNetworkACLCmd() + cmd.id = self.id + return apiclient.deleteNetworkACL(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List Network ACLs""" + + cmd = listNetworkACLs.listNetworkACLsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetworkACLs(cmd)) + + +class NetworkACLList: + """Manage Network ACL lists lifecycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, name=None, description=None, vpcid=None): + """Create network ACL container list""" + + cmd = createNetworkACLList.createNetworkACLListCmd() + if "name" in services: + cmd.name = services["name"] + elif name: + cmd.name = name + + if "description" in services: + cmd.description = services["description"] + elif description: + cmd.description = description + + if "vpcid" in services: + cmd.vpcid = services["vpcid"] + elif vpcid: + cmd.vpcid = vpcid + + return NetworkACLList(apiclient.createNetworkACLList(cmd).__dict__) + + def delete(self, apiclient): + """Delete network acl list""" + + cmd = deleteNetworkACLList.deleteNetworkACLListCmd() + cmd.id = self.id + return apiclient.deleteNetworkACLList(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List Network ACL lists""" + + cmd = listNetworkACLLists.listNetworkACLListsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetworkACLLists(cmd)) + + +class Vpn: + """Manage VPN life cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, publicipid, account=None, domainid=None, + projectid=None, networkid=None, vpcid=None): + """Create VPN for Public IP address""" + cmd = createRemoteAccessVpn.createRemoteAccessVpnCmd() + cmd.publicipid = publicipid + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + if projectid: + cmd.projectid = projectid + if networkid: + cmd.networkid = networkid + if vpcid: + cmd.vpcid = vpcid + return Vpn(apiclient.createRemoteAccessVpn(cmd).__dict__) + + def delete(self, apiclient): + """Delete remote VPN access""" + + cmd = deleteRemoteAccessVpn.deleteRemoteAccessVpnCmd() + cmd.publicipid = self.publicipid + apiclient.deleteRemoteAccessVpn(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all VPN matching criteria""" + + cmd = listRemoteAccessVpns.listRemoteAccessVpnsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listRemoteAccessVpns(cmd)) + + +class VpnUser: + """Manage VPN user""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, username, password, account=None, domainid=None, + projectid=None, rand_name=True): + """Create VPN user""" + cmd = addVpnUser.addVpnUserCmd() + cmd.username = "-".join([username, + random_gen()]) if rand_name else username + cmd.password = password + + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + if projectid: + cmd.projectid = projectid + return VpnUser(apiclient.addVpnUser(cmd).__dict__) + + def delete(self, apiclient, projectid=None): + """Remove VPN user""" + + cmd = removeVpnUser.removeVpnUserCmd() + cmd.username = self.username + if projectid: + cmd.projectid = projectid + else: + cmd.account = self.account + cmd.domainid = self.domainid + apiclient.removeVpnUser(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all VPN Users matching criteria""" + + cmd = listVpnUsers.listVpnUsersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVpnUsers(cmd)) + + +class Zone: + """Manage Zone""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, domainid=None): + """Create zone""" + cmd = createZone.createZoneCmd() + cmd.dns1 = services["dns1"] + cmd.internaldns1 = services["internaldns1"] + cmd.name = services["name"] + cmd.networktype = services["networktype"] + + if "dns2" in services: + cmd.dns2 = services["dns2"] + if "internaldns2" in services: + cmd.internaldns2 = services["internaldns2"] + if domainid: + cmd.domainid = domainid + + return Zone(apiclient.createZone(cmd).__dict__) + + def delete(self, apiclient): + """Delete Zone""" + + cmd = deleteZone.deleteZoneCmd() + cmd.id = self.id + apiclient.deleteZone(cmd) + + def update(self, apiclient, **kwargs): + """Update the zone""" + + cmd = updateZone.updateZoneCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.updateZone(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all Zones matching criteria""" + + cmd = listZones.listZonesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listZones(cmd)) + + +class Pod: + """Manage Pod""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services): + """Create Pod""" + cmd = createPod.createPodCmd() + cmd.gateway = services["gateway"] + cmd.netmask = services["netmask"] + cmd.name = services["name"] + cmd.startip = services["startip"] + cmd.endip = services["endip"] + cmd.zoneid = services["zoneid"] + + return Pod(apiclient.createPod(cmd).__dict__) + + def delete(self, apiclient): + """Delete Pod""" + + cmd = deletePod.deletePodCmd() + cmd.id = self.id + apiclient.deletePod(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + "Returns a default pod for specified zone" + + cmd = listPods.listPodsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.listPods(cmd) + + +class PublicIpRange: + """Manage VlanIpRange""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services): + """Create VlanIpRange""" + + cmd = createVlanIpRange.createVlanIpRangeCmd() + cmd.gateway = services["gateway"] + cmd.netmask = services["netmask"] + cmd.forvirtualnetwork = services["forvirtualnetwork"] + cmd.startip = services["startip"] + cmd.endip = services["endip"] + cmd.zoneid = services["zoneid"] + cmd.podid = services["podid"] + cmd.vlan = services["vlan"] + + return PublicIpRange(apiclient.createVlanIpRange(cmd).__dict__) + + def delete(self, apiclient): + """Delete VlanIpRange""" + + cmd = deleteVlanIpRange.deleteVlanIpRangeCmd() + cmd.id = self.vlan.id + apiclient.deleteVlanIpRange(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all VLAN IP ranges.""" + + cmd = listVlanIpRanges.listVlanIpRangesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVlanIpRanges(cmd)) + + @classmethod + def dedicate(cls, apiclient, id, account=None, domainid=None, projectid=None): + """Dedicate VLAN IP range""" + + cmd = dedicatePublicIpRange.dedicatePublicIpRangeCmd() + cmd.id = id + cmd.account = account + cmd.domainid = domainid + cmd.projectid = projectid + return PublicIpRange(apiclient.dedicatePublicIpRange(cmd).__dict__) + + def release(self, apiclient): + """Release VLAN IP range""" + + cmd = releasePublicIpRange.releasePublicIpRangeCmd() + cmd.id = self.vlan.id + return apiclient.releasePublicIpRange(cmd) + + +class PortablePublicIpRange: + """Manage portable public Ip Range""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services): + """Create portable public Ip Range""" + + cmd = createPortableIpRange.createPortableIpRangeCmd() + cmd.gateway = services["gateway"] + cmd.netmask = services["netmask"] + cmd.startip = services["startip"] + cmd.endip = services["endip"] + cmd.regionid = services["regionid"] + + if "vlan" in services: + cmd.vlan = services["vlan"] + + return PortablePublicIpRange(apiclient.createPortableIpRange(cmd).__dict__) + + def delete(self, apiclient): + """Delete portable IpRange""" + + cmd = deletePortableIpRange.deletePortableIpRangeCmd() + cmd.id = self.id + apiclient.deletePortableIpRange(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all portable public IP ranges.""" + + cmd = listPortableIpRanges.listPortableIpRangesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listPortableIpRanges(cmd)) + +class SecondaryStagingStore: + """Manage Staging Store""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, url, provider, services=None): + """Create Staging Storage""" + cmd = createSecondaryStagingStore.createSecondaryStagingStoreCmd() + cmd.url = url + cmd.provider = provider + if services: + if "zoneid" in services: + cmd.zoneid = services["zoneid"] + if "details" in services: + cmd.details = services["details"] + if "scope" in services: + cmd.scope = services["scope"] + + return SecondaryStagingStore(apiclient.createSecondaryStagingStore(cmd).__dict__) + + def delete(self, apiclient): + """Delete Staging Storage""" + cmd = deleteSecondaryStagingStore.deleteSecondaryStagingStoreCmd() + cmd.id = self.id + apiclient.deleteSecondaryStagingStore(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + cmd = listSecondaryStagingStores.listSecondaryStagingStoresCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listSecondaryStagingStores(cmd)) + + +class ImageStore: + """Manage image stores""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, url, provider, services=None): + """Add Image Store""" + cmd = addImageStore.addImageStoreCmd() + cmd.url = url + cmd.provider = provider + if services: + if "zoneid" in services: + cmd.zoneid = services["zoneid"] + if "details" in services: + cmd.details = services["details"] + if "scope" in services: + cmd.scope = services["scope"] + + return ImageStore(apiclient.addImageStore(cmd).__dict__) + + def delete(self, apiclient): + """Delete Image Store""" + cmd = deleteImageStore.deleteImageStoreCmd() + cmd.id = self.id + apiclient.deleteImageStore(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + cmd = listImageStores.listImageStoresCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listImageStores(cmd)) + + +class PhysicalNetwork: + """Manage physical network storage""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, zoneid, domainid=None): + """Create physical network""" + cmd = createPhysicalNetwork.createPhysicalNetworkCmd() + + cmd.name = services["name"] + cmd.zoneid = zoneid + if domainid: + cmd.domainid = domainid + return PhysicalNetwork(apiclient.createPhysicalNetwork(cmd).__dict__) + + def delete(self, apiclient): + """Delete Physical Network""" + + cmd = deletePhysicalNetwork.deletePhysicalNetworkCmd() + cmd.id = self.id + apiclient.deletePhysicalNetwork(cmd) + + def update(self, apiclient, **kwargs): + """Update Physical network state""" + + cmd = updatePhysicalNetwork.updatePhysicalNetworkCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.updatePhysicalNetwork(cmd) + + def addTrafficType(self, apiclient, type): + """Add Traffic type to Physical network""" + + cmd = addTrafficType.addTrafficTypeCmd() + cmd.physicalnetworkid = self.id + cmd.traffictype = type + return apiclient.addTrafficType(cmd) + + @classmethod + def dedicate(cls, apiclient, vlanrange, physicalnetworkid, account=None, domainid=None, projectid=None): + """Dedicate guest vlan range""" + + cmd = dedicateGuestVlanRange.dedicateGuestVlanRangeCmd() + cmd.vlanrange = vlanrange + cmd.physicalnetworkid = physicalnetworkid + cmd.account = account + cmd.domainid = domainid + cmd.projectid = projectid + return PhysicalNetwork(apiclient.dedicateGuestVlanRange(cmd).__dict__) + + def release(self, apiclient): + """Release guest vlan range""" + + cmd = releaseDedicatedGuestVlanRange.releaseDedicatedGuestVlanRangeCmd() + cmd.id = self.id + return apiclient.releaseDedicatedGuestVlanRange(cmd) + + @classmethod + def listDedicated(cls, apiclient, **kwargs): + """Lists all dedicated guest vlan ranges""" + + cmd = listDedicatedGuestVlanRanges.listDedicatedGuestVlanRangesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.listDedicatedGuestVlanRanges(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all physical networks""" + + cmd = listPhysicalNetworks.listPhysicalNetworksCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return map(lambda pn : PhysicalNetwork(pn.__dict__), apiclient.listPhysicalNetworks(cmd)) + + +class SecurityGroup: + """Manage Security Groups""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, account=None, domainid=None, + description=None, projectid=None): + """Create security group""" + cmd = createSecurityGroup.createSecurityGroupCmd() + + cmd.name = services["name"] + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + if description: + cmd.description = description + if projectid: + cmd.projectid = projectid + + return SecurityGroup(apiclient.createSecurityGroup(cmd).__dict__) + + def delete(self, apiclient): + """Delete Security Group""" + + cmd = deleteSecurityGroup.deleteSecurityGroupCmd() + cmd.id = self.id + apiclient.deleteSecurityGroup(cmd) + + def authorize(self, apiclient, services, + account=None, domainid=None, projectid=None): + """Authorize Ingress Rule""" + + cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd() + + if domainid: + cmd.domainid = domainid + if account: + cmd.account = account + + if projectid: + cmd.projectid = projectid + cmd.securitygroupid = self.id + cmd.protocol = services["protocol"] + + if services["protocol"] == 'ICMP': + cmd.icmptype = -1 + cmd.icmpcode = -1 + else: + cmd.startport = services["startport"] + cmd.endport = services["endport"] + + cmd.cidrlist = services["cidrlist"] + return (apiclient.authorizeSecurityGroupIngress(cmd).__dict__) + + def revoke(self, apiclient, id): + """Revoke ingress rule""" + + cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd() + cmd.id = id + return apiclient.revokeSecurityGroupIngress(cmd) + + def authorizeEgress(self, apiclient, services, account=None, domainid=None, + projectid=None, user_secgrp_list={}): + """Authorize Egress Rule""" + + cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd() + + if domainid: + cmd.domainid = domainid + if account: + cmd.account = account + + if projectid: + cmd.projectid = projectid + cmd.securitygroupid = self.id + cmd.protocol = services["protocol"] + + if services["protocol"] == 'ICMP': + cmd.icmptype = -1 + cmd.icmpcode = -1 + else: + cmd.startport = services["startport"] + cmd.endport = services["endport"] + + cmd.cidrlist = services["cidrlist"] + + cmd.usersecuritygrouplist = [] + for account, group in user_secgrp_list.items(): + cmd.usersecuritygrouplist.append({ + 'account': account, + 'group': group + }) + + return (apiclient.authorizeSecurityGroupEgress(cmd).__dict__) + + def revokeEgress(self, apiclient, id): + """Revoke Egress rule""" + + cmd = revokeSecurityGroupEgress.revokeSecurityGroupEgressCmd() + cmd.id = id + return apiclient.revokeSecurityGroupEgress(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all security groups.""" + + cmd = listSecurityGroups.listSecurityGroupsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listSecurityGroups(cmd)) + + +class Project: + """Manage Project life cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, account=None, domainid=None): + """Create project""" + + cmd = createProject.createProjectCmd() + cmd.displaytext = services["displaytext"] + cmd.name = "-".join([services["name"], random_gen()]) + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + + return Project(apiclient.createProject(cmd).__dict__) + + def delete(self, apiclient): + """Delete Project""" + + cmd = deleteProject.deleteProjectCmd() + cmd.id = self.id + apiclient.deleteProject(cmd) + + def update(self, apiclient, **kwargs): + """Updates the project""" + + cmd = updateProject.updateProjectCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.updateProject(cmd) + + def activate(self, apiclient): + """Activates the suspended project""" + + cmd = activateProject.activateProjectCmd() + cmd.id = self.id + return apiclient.activateProject(cmd) + + def suspend(self, apiclient): + """Suspend the active project""" + + cmd = suspendProject.suspendProjectCmd() + cmd.id = self.id + return apiclient.suspendProject(cmd) + + def addAccount(self, apiclient, account=None, email=None): + """Add account to project""" + + cmd = addAccountToProject.addAccountToProjectCmd() + cmd.projectid = self.id + if account: + cmd.account = account + if email: + cmd.email = email + return apiclient.addAccountToProject(cmd) + + def deleteAccount(self, apiclient, account): + """Delete account from project""" + + cmd = deleteAccountFromProject.deleteAccountFromProjectCmd() + cmd.projectid = self.id + cmd.account = account + return apiclient.deleteAccountFromProject(cmd) + + @classmethod + def listAccounts(cls, apiclient, **kwargs): + """Lists all accounts associated with projects.""" + + cmd = listProjectAccounts.listProjectAccountsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listProjectAccounts(cmd)) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists all projects.""" + + cmd = listProjects.listProjectsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listProjects(cmd)) + + +class ProjectInvitation: + """Manage project invitations""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def update(cls, apiclient, projectid, accept, account=None, token=None): + """Updates the project invitation for that account""" + + cmd = updateProjectInvitation.updateProjectInvitationCmd() + cmd.projectid = projectid + cmd.accept = accept + if account: + cmd.account = account + if token: + cmd.token = token + + return (apiclient.updateProjectInvitation(cmd).__dict__) + + def delete(self, apiclient, id): + """Deletes the project invitation""" + + cmd = deleteProjectInvitation.deleteProjectInvitationCmd() + cmd.id = id + return apiclient.deleteProjectInvitation(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists project invitations""" + + cmd = listProjectInvitations.listProjectInvitationsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listProjectInvitations(cmd)) + + +class Configurations: + """Manage Configuration""" + + @classmethod + def update(cls, apiclient, name, value=None): + """Updates the specified configuration""" + + cmd = updateConfiguration.updateConfigurationCmd() + cmd.name = name + cmd.value = value + apiclient.updateConfiguration(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists configurations""" + + cmd = listConfigurations.listConfigurationsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listConfigurations(cmd)) + + +class NetScaler: + """Manage external netscaler device""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def add(cls, apiclient, services, physicalnetworkid, username=None, password=None): + """Add external netscaler device to cloudstack""" + + cmd = addNetscalerLoadBalancer.addNetscalerLoadBalancerCmd() + cmd.physicalnetworkid = physicalnetworkid + if username: + cmd.username = username + else: + cmd.username = services["username"] + + if password: + cmd.password = password + else: + cmd.password = services["password"] + + cmd.networkdevicetype = services["networkdevicetype"] + + # Generate the URL + url = 'https://' + str(services["ipaddress"]) + '?' + url = url + 'publicinterface=' + str(services["publicinterface"]) + '&' + url = url + 'privateinterface=' + str(services["privateinterface"]) + '&' + url = url + 'numretries=' + str(services["numretries"]) + '&' + + if not services["lbdevicededicated"] and "lbdevicecapacity" in services: + url = url + 'lbdevicecapacity=' + str(services["lbdevicecapacity"]) + '&' + + url = url + 'lbdevicededicated=' + str(services["lbdevicededicated"]) + + cmd.url = url + return NetScaler(apiclient.addNetscalerLoadBalancer(cmd).__dict__) + + def delete(self, apiclient): + """Deletes a netscaler device from CloudStack""" + + cmd = deleteNetscalerLoadBalancer.deleteNetscalerLoadBalancerCmd() + cmd.lbdeviceid = self.lbdeviceid + apiclient.deleteNetscalerLoadBalancer(cmd) + return + + def configure(self, apiclient, **kwargs): + """List already registered netscaler devices""" + + cmd = configureNetscalerLoadBalancer.configureNetscalerLoadBalancerCmd() + cmd.lbdeviceid = self.lbdeviceid + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.configureNetscalerLoadBalancer(cmd)) + + @classmethod + def list(cls, apiclient, **kwargs): + """List already registered netscaler devices""" + + cmd = listNetscalerLoadBalancers.listNetscalerLoadBalancersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetscalerLoadBalancers(cmd)) + + +class NetworkServiceProvider: + """Manage network serivce providers for CloudStack""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def add(cls, apiclient, name, physicalnetworkid, servicelist): + """Adds network service provider""" + + cmd = addNetworkServiceProvider.addNetworkServiceProviderCmd() + cmd.name = name + cmd.physicalnetworkid = physicalnetworkid + cmd.servicelist = servicelist + return NetworkServiceProvider(apiclient.addNetworkServiceProvider(cmd).__dict__) + + def delete(self, apiclient): + """Deletes network service provider""" + + cmd = deleteNetworkServiceProvider.deleteNetworkServiceProviderCmd() + cmd.id = self.id + return apiclient.deleteNetworkServiceProvider(cmd) + + def update(self, apiclient, **kwargs): + """Updates network service provider""" + + cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.updateNetworkServiceProvider(cmd) + + @classmethod + def update(cls, apiclient, id, **kwargs): + """Updates network service provider""" + + cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.updateNetworkServiceProvider(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List network service providers""" + + cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetworkServiceProviders(cmd)) + + +class Router: + """Manage router life cycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def start(cls, apiclient, id): + """Starts the router""" + cmd = startRouter.startRouterCmd() + cmd.id = id + return apiclient.startRouter(cmd) + + @classmethod + def stop(cls, apiclient, id, forced=None): + """Stops the router""" + cmd = stopRouter.stopRouterCmd() + cmd.id = id + if forced: + cmd.forced = forced + return apiclient.stopRouter(cmd) + + @classmethod + def reboot(cls, apiclient, id): + """Reboots the router""" + cmd = rebootRouter.rebootRouterCmd() + cmd.id = id + return apiclient.rebootRouter(cmd) + + @classmethod + def destroy(cls, apiclient, id): + """Destroy the router""" + cmd = destroyRouter.destroyRouterCmd() + cmd.id = id + return apiclient.destroyRouter(cmd) + + @classmethod + def change_service_offering(cls, apiclient, id, serviceofferingid): + """Change service offering of the router""" + cmd = changeServiceForRouter.changeServiceForRouterCmd() + cmd.id = id + cmd.serviceofferingid = serviceofferingid + return apiclient.changeServiceForRouter(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List routers""" + + cmd = listRouters.listRoutersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listRouters(cmd)) + + +class Tag: + """Manage tags""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, resourceIds, resourceType, tags): + """Create tags""" + + cmd = createTags.createTagsCmd() + cmd.resourceIds = resourceIds + cmd.resourcetype = resourceType + cmd.tags = [] + for key, value in tags.items(): + cmd.tags.append({ + 'key': key, + 'value': value + }) + return Tag(apiclient.createTags(cmd).__dict__) + + def delete(self, apiclient, resourceIds, resourceType, tags): + """Delete tags""" + + cmd = deleteTags.deleteTagsCmd() + cmd.resourceIds = resourceIds + cmd.resourcetype = resourceType + cmd.tags = [] + for key, value in tags.items(): + cmd.tags.append({ + 'key': key, + 'value': value + }) + apiclient.deleteTags(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all tags matching the criteria""" + + cmd = listTags.listTagsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listTags(cmd)) + + +class VpcOffering: + """Manage VPC offerings""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services): + """Create vpc offering""" + + cmd = createVPCOffering.createVPCOfferingCmd() + cmd.name = "-".join([services["name"], random_gen()]) + cmd.displaytext = services["displaytext"] + cmd.supportedServices = services["supportedservices"] + return VpcOffering(apiclient.createVPCOffering(cmd).__dict__) + + def update(self, apiclient, name=None, displaytext=None, state=None): + """Updates existing VPC offering""" + + cmd = updateVPCOffering.updateVPCOfferingCmd() + cmd.id = self.id + if name: + cmd.name = name + if displaytext: + cmd.displaytext = displaytext + if state: + cmd.state = state + return apiclient.updateVPCOffering(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List the VPC offerings based on criteria specified""" + + cmd = listVPCOfferings.listVPCOfferingsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVPCOfferings(cmd)) + + def delete(self, apiclient): + """Deletes existing VPC offering""" + + cmd = deleteVPCOffering.deleteVPCOfferingCmd() + cmd.id = self.id + return apiclient.deleteVPCOffering(cmd) + + +class VPC: + """Manage Virtual Private Connection""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, vpcofferingid, + zoneid, networkDomain=None, account=None, domainid=None, **kwargs): + """Creates the virtual private connection (VPC)""" + + cmd = createVPC.createVPCCmd() + cmd.name = "-".join([services["name"], random_gen()]) + cmd.displaytext = "-".join([services["displaytext"], random_gen()]) + cmd.vpcofferingid = vpcofferingid + cmd.zoneid = zoneid + if "cidr" in services: + cmd.cidr = services["cidr"] + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + if networkDomain: + cmd.networkDomain = networkDomain + [setattr(cmd, k, v) for k, v in kwargs.items()] + return VPC(apiclient.createVPC(cmd).__dict__) + + def update(self, apiclient, name=None, displaytext=None): + """Updates VPC configurations""" + + cmd = updateVPC.updateVPCCmd() + cmd.id = self.id + if name: + cmd.name = name + if displaytext: + cmd.displaytext = displaytext + return (apiclient.updateVPC(cmd)) + + def delete(self, apiclient): + """Delete VPC network""" + + cmd = deleteVPC.deleteVPCCmd() + cmd.id = self.id + return apiclient.deleteVPC(cmd) + + def restart(self, apiclient): + """Restarts the VPC connections""" + + cmd = restartVPC.restartVPCCmd() + cmd.id = self.id + return apiclient.restartVPC(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List VPCs""" + + cmd = listVPCs.listVPCsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVPCs(cmd)) + + +class PrivateGateway: + """Manage private gateway lifecycle""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, gateway, ipaddress, netmask, vlan, vpcid, + physicalnetworkid=None): + """Create private gateway""" + + cmd = createPrivateGateway.createPrivateGatewayCmd() + cmd.gateway = gateway + cmd.ipaddress = ipaddress + cmd.netmask = netmask + cmd.vlan = vlan + cmd.vpcid = vpcid + if physicalnetworkid: + cmd.physicalnetworkid = physicalnetworkid + + return PrivateGateway(apiclient.createPrivateGateway(cmd).__dict__) + + def delete(self, apiclient): + """Delete private gateway""" + + cmd = deletePrivateGateway.deletePrivateGatewayCmd() + cmd.id = self.id + return apiclient.deletePrivateGateway(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List private gateways""" + + cmd = listPrivateGateways.listPrivateGatewaysCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listPrivateGateways(cmd)) + + +class AffinityGroup: + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, aff_grp, account=None, domainid=None): + cmd = createAffinityGroup.createAffinityGroupCmd() + cmd.name = aff_grp['name'] + cmd.displayText = aff_grp['name'] + cmd.type = aff_grp['type'] + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + return AffinityGroup(apiclient.createAffinityGroup(cmd).__dict__) + + def update(self, apiclient): + pass + + def delete(self, apiclient): + cmd = deleteAffinityGroup.deleteAffinityGroupCmd() + cmd.id = self.id + return apiclient.deleteAffinityGroup(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + cmd = listAffinityGroups.listAffinityGroupsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.listAffinityGroups(cmd) + +class StaticRoute: + """Manage static route lifecycle""" + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, cidr, gatewayid): + """Create static route""" + + cmd = createStaticRoute.createStaticRouteCmd() + cmd.cidr = cidr + cmd.gatewayid = gatewayid + return StaticRoute(apiclient.createStaticRoute(cmd).__dict__) + + def delete(self, apiclient): + """Delete static route""" + + cmd = deleteStaticRoute.deleteStaticRouteCmd() + cmd.id = self.id + return apiclient.deleteStaticRoute(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List static route""" + + cmd = listStaticRoutes.listStaticRoutesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listStaticRoutes(cmd)) + + +class VNMC: + """Manage VNMC lifecycle""" + def __init__(self, items): + self.__dict__.update(items) + + def create(cls, apiclient, hostname, username, password, physicalnetworkid): + """Registers VNMC appliance""" + + cmd = addCiscoVnmcResource.addCiscoVnmcResourceCmd() + cmd.hostname = hostname + cmd.username = username + cmd.password = password + cmd.physicalnetworkid = physicalnetworkid + return VNMC(apiclient.addCiscoVnmcResource(cmd)) + + def delete(self, apiclient): + """Removes VNMC appliance""" + + cmd = deleteCiscoVnmcResource.deleteCiscoVnmcResourceCmd() + cmd.resourceid = self.resourceid + return apiclient.deleteCiscoVnmcResource(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List VNMC appliances""" + + cmd = listCiscoVnmcResources.listCiscoVnmcResourcesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listCiscoVnmcResources(cmd)) + + +class SSHKeyPair: + """Manage SSH Key pairs""" + + def __init__(self, items, services): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, name=None, account=None, + domainid=None, projectid=None): + """Creates SSH keypair""" + cmd = createSSHKeyPair.createSSHKeyPairCmd() + cmd.name = name + if account is not None: + cmd.account = account + if domainid is not None: + cmd.domainid = domainid + if projectid is not None: + cmd.projectid = projectid + return (apiclient.createSSHKeyPair(cmd)) + + def delete(self, apiclient): + """Delete SSH key pair""" + cmd = deleteSSHKeyPair.deleteSSHKeyPairCmd() + cmd.name = self.name + apiclient.deleteSSHKeyPair(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all SSH key pairs""" + cmd = listSSHKeyPairs.listSSHKeyPairsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listSSHKeyPairs(cmd)) + + +class Capacities: + """Manage Capacities""" + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists capacities""" + + cmd = listCapacity.listCapacityCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listCapacity(cmd)) + + +class Alert: + """Manage alerts""" + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists alerts""" + + cmd = listAlerts.listAlertsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAlerts(cmd)) + + +class InstanceGroup: + """Manage VM instance groups""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, name=None, account=None, domainid=None, + projectid=None, networkid=None, rand_name=True): + """Creates instance groups""" + + cmd = createInstanceGroup.createInstanceGroupCmd() + cmd.name = "-".join([name, random_gen()]) if rand_name else name + if account is not None: + cmd.account = account + if domainid is not None: + cmd.domainid = domainid + if projectid is not None: + cmd.projectid = projectid + if networkid is not None: + cmd.networkid = networkid + return InstanceGroup(apiclient.createInstanceGroup(cmd).__dict__) + + def delete(self, apiclient): + """Delete instance group""" + cmd = deleteInstanceGroup.deleteInstanceGroupCmd() + cmd.id = self.id + apiclient.deleteInstanceGroup(cmd) + + def update(self, apiclient, **kwargs): + """Updates the instance groups""" + cmd = updateInstanceGroup.updateInstanceGroupCmd() + cmd.id = self.id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return (apiclient.updateInstanceGroup(cmd)) + + @classmethod + def list(cls, apiclient, **kwargs): + """List all instance groups""" + cmd = listInstanceGroups.listInstanceGroupsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return (apiclient.listInstanceGroups(cmd)) + + def startInstances(self, apiclient): + """Starts all instances in a VM tier""" + + cmd = startVirtualMachine.startVirtualMachineCmd() + cmd.group = self.id + return apiclient.startVirtualMachine(cmd) + + def stopInstances(self, apiclient): + """Stops all instances in a VM tier""" + + cmd = stopVirtualMachine.stopVirtualMachineCmd() + cmd.group = self.id + return apiclient.stopVirtualMachine(cmd) + + def rebootInstances(self, apiclient): + """Reboot all instances in a VM tier""" + + cmd = rebootVirtualMachine.rebootVirtualMachineCmd() + cmd.group = self.id + return apiclient.rebootVirtualMachine(cmd) + + def deleteInstances(self, apiclient): + """Stops all instances in a VM tier""" + + cmd = destroyVirtualMachine.destroyVirtualMachineCmd() + cmd.group = self.id + return apiclient.destroyVirtualMachine(cmd) + + def changeServiceOffering(self, apiclient, serviceOfferingId): + """Change service offering of the vm tier""" + + cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd() + cmd.group = self.id + cmd.serviceofferingid = serviceOfferingId + return apiclient.changeServiceForVirtualMachine(cmd) + + def recoverInstances(self, apiclient): + """Recover the instances from vm tier""" + cmd = recoverVirtualMachine.recoverVirtualMachineCmd() + cmd.group = self.id + apiclient.recoverVirtualMachine(cmd) + + +class ASA1000V: + """Manage ASA 1000v lifecycle""" + def create(cls, apiclient, hostname, insideportprofile, clusterid, physicalnetworkid): + """Registers ASA 1000v appliance""" + + cmd = addCiscoAsa1000vResource.addCiscoAsa1000vResourceCmd() + cmd.hostname = hostname + cmd.insideportprofile = insideportprofile + cmd.clusterid = clusterid + cmd.physicalnetworkid = physicalnetworkid + return ASA1000V(apiclient.addCiscoAsa1000vResource(cmd)) + + def delete(self, apiclient): + """Removes ASA 1000v appliance""" + + cmd = deleteCiscoAsa1000vResource.deleteCiscoAsa1000vResourceCmd() + cmd.resourceid = self.resourceid + return apiclient.deleteCiscoAsa1000vResource(cmd) + + @classmethod + def list(cls, apiclient, **kwargs): + """List ASA 1000v appliances""" + + cmd = listCiscoAsa1000vResources.listCiscoAsa1000vResourcesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listCiscoAsa1000vResources(cmd)) + +class VmSnapshot: + """Manage VM Snapshot life cycle""" + def __init__(self, items): + self.__dict__.update(items) + @classmethod + def create(cls,apiclient,vmid,snapshotmemory="false",name=None,description=None): + cmd = createVMSnapshot.createVMSnapshotCmd() + cmd.virtualmachineid = vmid + + if snapshotmemory: + cmd.snapshotmemory = snapshotmemory + if name: + cmd.name = name + if description: + cmd.description = description + return VmSnapshot(apiclient.createVMSnapshot(cmd).__dict__) + + @classmethod + def list(cls, apiclient, **kwargs): + cmd = listVMSnapshot.listVMSnapshotCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVMSnapshot(cmd)) + + @classmethod + def revertToSnapshot(cls, apiclient,vmsnapshotid): + cmd = revertToVMSnapshot.revertToVMSnapshotCmd() + cmd.vmsnapshotid = vmsnapshotid + + return apiclient.revertToVMSnapshot(cmd) + + @classmethod + def deleteVMSnapshot(cls,apiclient,vmsnapshotid): + cmd = deleteVMSnapshot.deleteVMSnapshotCmd() + cmd.vmsnapshotid = vmsnapshotid + + return apiclient.deleteVMSnapshot(cmd) + +class Region: + """ Regions related Api """ + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services): + cmd = addRegion.addRegionCmd() + cmd.id = services["regionid"] + cmd.endpoint = services["regionendpoint"] + cmd.name = services["regionname"] + try: + region = apiclient.addRegion(cmd) + if region is not None: + return Region(region.__dict__) + except Exception as e: + raise e + + @classmethod + def list(cls, apiclient, **kwargs): + cmd = listRegions.listRegionsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + region = apiclient.listRegions(cmd) + return region + + def update(self, apiclient, services): + cmd = updateRegion.updateRegionCmd() + cmd.id = self.id + if services["regionendpoint"]: + cmd.endpoint = services["regionendpoint"] + if services["regionname"]: + cmd.name = services["regionname"] + region = apiclient.updateRegion(cmd) + return region + + def delete(self, apiclient): + cmd = removeRegion.removeRegionCmd() + cmd.id = self.id + region = apiclient.removeRegion(cmd) + return region + + +class ApplicationLoadBalancer: + """Manage Application Load Balancers in VPC""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def create(cls, apiclient, services, name=None, sourceport=None, instanceport=22, + algorithm="roundrobin", scheme="internal", sourcenetworkid=None, networkid=None): + """Create Application Load Balancer""" + cmd = createLoadBalancer.createLoadBalancerCmd() + + if "name" in services: + cmd.name = services["name"] + elif name: + cmd.name = name + + if "sourceport" in services: + cmd.sourceport = services["sourceport"] + elif sourceport: + cmd.sourceport = sourceport + + if "instanceport" in services: + cmd.instanceport = services["instanceport"] + elif instanceport: + cmd.instanceport = instanceport + + if "algorithm" in services: + cmd.algorithm = services["algorithm"] + elif algorithm: + cmd.algorithm = algorithm + + if "scheme" in services: + cmd.scheme = services["scheme"] + elif scheme: + cmd.scheme = scheme + + if "sourceipaddressnetworkid" in services: + cmd.sourceipaddressnetworkid = services["sourceipaddressnetworkid"] + elif sourcenetworkid: + cmd.sourceipaddressnetworkid = sourcenetworkid + + if "networkid" in services: + cmd.networkid = services["networkid"] + elif networkid: + cmd.networkid = networkid + + return LoadBalancerRule(apiclient.createLoadBalancer(cmd).__dict__) + + def delete(self, apiclient): + """Delete application load balancer""" + cmd = deleteLoadBalancer.deleteLoadBalancerCmd() + cmd.id = self.id + apiclient.deleteLoadBalancerRule(cmd) + return + + def assign(self, apiclient, vms): + """Assign virtual machines to load balancing rule""" + cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd() + cmd.id = self.id + cmd.virtualmachineids = [str(vm.id) for vm in vms] + apiclient.assignToLoadBalancerRule(cmd) + return + + def remove(self, apiclient, vms): + """Remove virtual machines from load balancing rule""" + cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd() + cmd.id = self.id + cmd.virtualmachineids = [str(vm.id) for vm in vms] + apiclient.removeFromLoadBalancerRule(cmd) + return + + @classmethod + def list(cls, apiclient, **kwargs): + """List all appln load balancers""" + cmd = listLoadBalancers.listLoadBalancersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listLoadBalancerRules(cmd)) + +class Resources: + """Manage resource limits""" + + def __init__(self, items, services): + self.__dict__.update(items) + + @classmethod + def list(cls, apiclient, **kwargs): + """Lists resource limits""" + + cmd = listResourceLimits.listResourceLimitsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listResourceLimits(cmd)) + + @classmethod + def updateLimit(cls, apiclient, **kwargs): + """Updates resource limits""" + + cmd = updateResourceLimit.updateResourceLimitCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateResourceLimit(cmd)) + + @classmethod + def updateCount(cls, apiclient, **kwargs): + """Updates resource count""" + + cmd = updateResourceCount.updateResourceCountCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateResourceCount(cmd)) diff --git a/tools/marvin/build/lib/marvin/integration/lib/common.py b/tools/marvin/build/lib/marvin/integration/lib/common.py new file mode 100644 index 00000000000..164ef2052dd --- /dev/null +++ b/tools/marvin/build/lib/marvin/integration/lib/common.py @@ -0,0 +1,739 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Common functions +""" + +#Import Local Modules +from marvin.cloudstackAPI import * +from marvin.remoteSSHClient import remoteSSHClient +from utils import * +from base import * + +#Import System modules +import time + + +def is_config_suitable(apiclient, name, value): + """ + Ensure if the deployment has the expected `value` for the global setting `name' + @return: true if value is set, else false + """ + configs = Configurations.list(apiclient, name=name) + assert(configs is not None and isinstance(configs, list) and len(configs) > 0) + return configs[0].value == value + +def wait_for_cleanup(apiclient, configs=None): + """Sleeps till the cleanup configs passed""" + + # Configs list consists of the list of global configs + if not isinstance(configs, list): + return + for config in configs: + cmd = listConfigurations.listConfigurationsCmd() + cmd.name = config + cmd.listall = True + try: + config_descs = apiclient.listConfigurations(cmd) + except Exception as e: + raise Exception("Failed to fetch configurations: %s" % e) + + if not isinstance(config_descs, list): + raise Exception("List configs didn't returned a valid data") + + config_desc = config_descs[0] + # Sleep for the config_desc.value time + time.sleep(int(config_desc.value)) + return + +def add_netscaler(apiclient, zoneid, NSservice): + """ Adds Netscaler device and enables NS provider""" + + cmd = listPhysicalNetworks.listPhysicalNetworksCmd() + cmd.zoneid = zoneid + physical_networks = apiclient.listPhysicalNetworks(cmd) + if isinstance(physical_networks, list): + physical_network = physical_networks[0] + + cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd() + cmd.name = 'Netscaler' + cmd.physicalnetworkid=physical_network.id + nw_service_providers = apiclient.listNetworkServiceProviders(cmd) + + if isinstance(nw_service_providers, list): + netscaler_provider = nw_service_providers[0] + else: + cmd1 = addNetworkServiceProvider.addNetworkServiceProviderCmd() + cmd1.name = 'Netscaler' + cmd1.physicalnetworkid = physical_network.id + netscaler_provider = apiclient.addNetworkServiceProvider(cmd1) + + netscaler = NetScaler.add( + apiclient, + NSservice, + physicalnetworkid=physical_network.id + ) + if netscaler_provider.state != 'Enabled': + cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd() + cmd.id = netscaler_provider.id + cmd.state = 'Enabled' + response = apiclient.updateNetworkServiceProvider(cmd) + + return netscaler + +def get_region(apiclient, services=None): + "Returns a default region" + + cmd = listRegions.listRegionsCmd() + if services: + if "regionid" in services: + cmd.id = services["regionid"] + + regions = apiclient.listRegions(cmd) + + if isinstance(regions, list): + assert len(regions) > 0 + return regions[0] + else: + raise Exception("Failed to find specified region.") + +def get_domain(apiclient, services=None): + "Returns a default domain" + + cmd = listDomains.listDomainsCmd() + if services: + if "domainid" in services: + cmd.id = services["domainid"] + + domains = apiclient.listDomains(cmd) + + if isinstance(domains, list): + assert len(domains) > 0 + return domains[0] + else: + raise Exception("Failed to find specified domain.") + + +def get_zone(apiclient, services=None): + "Returns a default zone" + + cmd = listZones.listZonesCmd() + if services: + if "zoneid" in services: + cmd.id = services["zoneid"] + + zones = apiclient.listZones(cmd) + + if isinstance(zones, list): + assert len(zones) > 0, "There are no available zones in the deployment" + return zones[0] + else: + raise Exception("Failed to find specified zone.") + + +def get_pod(apiclient, zoneid, services=None): + "Returns a default pod for specified zone" + + cmd = listPods.listPodsCmd() + cmd.zoneid = zoneid + + if services: + if "podid" in services: + cmd.id = services["podid"] + + pods = apiclient.listPods(cmd) + + if isinstance(pods, list): + assert len(pods) > 0, "No pods found for zone %s"%zoneid + return pods[0] + else: + raise Exception("Exception: Failed to find specified pod.") + + +def get_template(apiclient, zoneid, ostype, services=None): + "Returns a template" + + cmd = listOsTypes.listOsTypesCmd() + cmd.description = ostype + ostypes = apiclient.listOsTypes(cmd) + + if isinstance(ostypes, list): + ostypeid = ostypes[0].id + else: + raise Exception( + "Failed to find OS type with description: %s" % ostype) + + cmd = listTemplates.listTemplatesCmd() + cmd.templatefilter = 'featured' + cmd.zoneid = zoneid + + if services: + if "template" in services: + cmd.id = services["template"] + + list_templates = apiclient.listTemplates(cmd) + + if isinstance(list_templates, list): + assert len(list_templates) > 0, "received empty response on template of type %s"%ostype + for template in list_templates: + if template.ostypeid == ostypeid: + return template + elif template.isready: + return template + + raise Exception("Exception: Failed to find template with OSTypeID: %s" % + ostypeid) + return + + +def download_systemplates_sec_storage(server, services): + """Download System templates on sec storage""" + + try: + # Login to management server + ssh = remoteSSHClient( + server["ipaddress"], + server["port"], + server["username"], + server["password"] + ) + except Exception: + raise Exception("SSH access failted for server with IP address: %s" % + server["ipaddess"]) + # Mount Secondary Storage on Management Server + cmds = [ + "mkdir -p %s" % services["mnt_dir"], + "mount -t nfs %s:/%s %s" % ( + services["sec_storage"], + services["path"], + services["mnt_dir"] + ), + "%s -m %s -u %s -h %s -F" % ( + services["command"], + services["mnt_dir"], + services["download_url"], + services["hypervisor"] + ) + ] + for c in cmds: + result = ssh.execute(c) + + res = str(result) + + # Unmount the Secondary storage + ssh.execute("umount %s" % (services["mnt_dir"])) + + if res.count("Successfully installed system VM template") == 1: + return + else: + raise Exception("Failed to download System Templates on Sec Storage") + return + + +def wait_for_ssvms(apiclient, zoneid, podid, interval=60): + """After setup wait for SSVMs to come Up""" + + time.sleep(interval) + timeout = 40 + while True: + list_ssvm_response = list_ssvms( + apiclient, + systemvmtype='secondarystoragevm', + zoneid=zoneid, + podid=podid + ) + ssvm = list_ssvm_response[0] + if ssvm.state != 'Running': + # Sleep to ensure SSVMs are Up and Running + time.sleep(interval) + timeout = timeout - 1 + elif ssvm.state == 'Running': + break + elif timeout == 0: + raise Exception("SSVM failed to come up") + break + + timeout = 40 + while True: + list_ssvm_response = list_ssvms( + apiclient, + systemvmtype='consoleproxy', + zoneid=zoneid, + podid=podid + ) + cpvm = list_ssvm_response[0] + if cpvm.state != 'Running': + # Sleep to ensure SSVMs are Up and Running + time.sleep(interval) + timeout = timeout - 1 + elif cpvm.state == 'Running': + break + elif timeout == 0: + raise Exception("CPVM failed to come up") + break + return + +def get_builtin_template_info(apiclient, zoneid): + """Returns hypervisor specific infor for templates""" + + list_template_response = Template.list( + apiclient, + templatefilter='featured', + zoneid=zoneid, + ) + + for b_template in list_template_response: + if b_template.templatetype == 'BUILTIN': + break + + extract_response = Template.extract(apiclient, + b_template.id, + 'HTTP_DOWNLOAD', + zoneid) + + return extract_response.url, b_template.hypervisor, b_template.format + +def download_builtin_templates(apiclient, zoneid, hypervisor, host, + linklocalip, interval=60): + """After setup wait till builtin templates are downloaded""" + + # Change IPTABLES Rules + get_process_status( + host["ipaddress"], + host["port"], + host["username"], + host["password"], + linklocalip, + "iptables -P INPUT ACCEPT" + ) + time.sleep(interval) + # Find the BUILTIN Templates for given Zone, Hypervisor + list_template_response = list_templates( + apiclient, + hypervisor=hypervisor, + zoneid=zoneid, + templatefilter='self' + ) + + if not isinstance(list_template_response, list): + raise Exception("Failed to download BUILTIN templates") + + # Ensure all BUILTIN templates are downloaded + templateid = None + for template in list_template_response: + if template.templatetype == "BUILTIN": + templateid = template.id + + # Sleep to ensure that template is in downloading state after adding + # Sec storage + time.sleep(interval) + while True: + template_response = list_templates( + apiclient, + id=templateid, + zoneid=zoneid, + templatefilter='self' + ) + template = template_response[0] + # If template is ready, + # template.status = Download Complete + # Downloading - x% Downloaded + # Error - Any other string + if template.status == 'Download Complete': + break + + elif 'Downloaded' in template.status: + time.sleep(interval) + + elif 'Installing' not in template.status: + raise Exception("ErrorInDownload") + + return + + +def update_resource_limit(apiclient, resourcetype, account=None, + domainid=None, max=None, projectid=None): + """Updates the resource limit to 'max' for given account""" + + cmd = updateResourceLimit.updateResourceLimitCmd() + cmd.resourcetype = resourcetype + if account: + cmd.account = account + if domainid: + cmd.domainid = domainid + if max: + cmd.max = max + if projectid: + cmd.projectid = projectid + apiclient.updateResourceLimit(cmd) + return + + +def list_os_types(apiclient, **kwargs): + """List all os types matching criteria""" + + cmd = listOsTypes.listOsTypesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listOsTypes(cmd)) + + +def list_routers(apiclient, **kwargs): + """List all Routers matching criteria""" + + cmd = listRouters.listRoutersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listRouters(cmd)) + + +def list_zones(apiclient, **kwargs): + """List all Zones matching criteria""" + + cmd = listZones.listZonesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listZones(cmd)) + + +def list_networks(apiclient, **kwargs): + """List all Networks matching criteria""" + + cmd = listNetworks.listNetworksCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetworks(cmd)) + + +def list_clusters(apiclient, **kwargs): + """List all Clusters matching criteria""" + + cmd = listClusters.listClustersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listClusters(cmd)) + + +def list_ssvms(apiclient, **kwargs): + """List all SSVMs matching criteria""" + + cmd = listSystemVms.listSystemVmsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listSystemVms(cmd)) + + +def list_storage_pools(apiclient, **kwargs): + """List all storage pools matching criteria""" + + cmd = listStoragePools.listStoragePoolsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listStoragePools(cmd)) + + +def list_virtual_machines(apiclient, **kwargs): + """List all VMs matching criteria""" + + cmd = listVirtualMachines.listVirtualMachinesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVirtualMachines(cmd)) + + +def list_hosts(apiclient, **kwargs): + """List all Hosts matching criteria""" + + cmd = listHosts.listHostsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listHosts(cmd)) + + +def list_configurations(apiclient, **kwargs): + """List configuration with specified name""" + + cmd = listConfigurations.listConfigurationsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listConfigurations(cmd)) + + +def list_publicIP(apiclient, **kwargs): + """List all Public IPs matching criteria""" + + cmd = listPublicIpAddresses.listPublicIpAddressesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listPublicIpAddresses(cmd)) + + +def list_nat_rules(apiclient, **kwargs): + """List all NAT rules matching criteria""" + + cmd = listPortForwardingRules.listPortForwardingRulesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listPortForwardingRules(cmd)) + + +def list_lb_rules(apiclient, **kwargs): + """List all Load balancing rules matching criteria""" + + cmd = listLoadBalancerRules.listLoadBalancerRulesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listLoadBalancerRules(cmd)) + + +def list_lb_instances(apiclient, **kwargs): + """List all Load balancing instances matching criteria""" + + cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listLoadBalancerRuleInstances(cmd)) + + +def list_firewall_rules(apiclient, **kwargs): + """List all Firewall Rules matching criteria""" + + cmd = listFirewallRules.listFirewallRulesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listFirewallRules(cmd)) + + +def list_volumes(apiclient, **kwargs): + """List all volumes matching criteria""" + + cmd = listVolumes.listVolumesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVolumes(cmd)) + + +def list_isos(apiclient, **kwargs): + """Lists all available ISO files.""" + + cmd = listIsos.listIsosCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listIsos(cmd)) + + +def list_snapshots(apiclient, **kwargs): + """List all snapshots matching criteria""" + + cmd = listSnapshots.listSnapshotsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listSnapshots(cmd)) + + +def list_templates(apiclient, **kwargs): + """List all templates matching criteria""" + + cmd = listTemplates.listTemplatesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listTemplates(cmd)) + + +def list_domains(apiclient, **kwargs): + """Lists domains""" + + cmd = listDomains.listDomainsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listDomains(cmd)) + + +def list_accounts(apiclient, **kwargs): + """Lists accounts and provides detailed account information for + listed accounts""" + + cmd = listAccounts.listAccountsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAccounts(cmd)) + + +def list_users(apiclient, **kwargs): + """Lists users and provides detailed account information for + listed users""" + + cmd = listUsers.listUsersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listUsers(cmd)) + + +def list_snapshot_policy(apiclient, **kwargs): + """Lists snapshot policies.""" + + cmd = listSnapshotPolicies.listSnapshotPoliciesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listSnapshotPolicies(cmd)) + + +def list_events(apiclient, **kwargs): + """Lists events""" + + cmd = listEvents.listEventsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listEvents(cmd)) + + +def list_disk_offering(apiclient, **kwargs): + """Lists all available disk offerings.""" + + cmd = listDiskOfferings.listDiskOfferingsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listDiskOfferings(cmd)) + + +def list_service_offering(apiclient, **kwargs): + """Lists all available service offerings.""" + + cmd = listServiceOfferings.listServiceOfferingsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listServiceOfferings(cmd)) + + +def list_vlan_ipranges(apiclient, **kwargs): + """Lists all VLAN IP ranges.""" + + cmd = listVlanIpRanges.listVlanIpRangesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVlanIpRanges(cmd)) + + +def list_usage_records(apiclient, **kwargs): + """Lists usage records for accounts""" + + cmd = listUsageRecords.listUsageRecordsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listUsageRecords(cmd)) + + +def list_nw_service_prividers(apiclient, **kwargs): + """Lists Network service providers""" + + cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetworkServiceProviders(cmd)) + + +def list_virtual_router_elements(apiclient, **kwargs): + """Lists Virtual Router elements""" + + cmd = listVirtualRouterElements.listVirtualRouterElementsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVirtualRouterElements(cmd)) + + +def list_network_offerings(apiclient, **kwargs): + """Lists network offerings""" + + cmd = listNetworkOfferings.listNetworkOfferingsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listNetworkOfferings(cmd)) + + +def list_resource_limits(apiclient, **kwargs): + """Lists resource limits""" + + cmd = listResourceLimits.listResourceLimitsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listResourceLimits(cmd)) + +def list_vpc_offerings(apiclient, **kwargs): + """ Lists VPC offerings """ + + cmd = listVPCOfferings.listVPCOfferingsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVPCOfferings(cmd)) + +def update_resource_count(apiclient, domainid, accountid=None, + projectid=None, rtype=None): + """updates the resource count + 0 - VM + 1 - Public IP + 2 - Volume + 3 - Snapshot + 4 - Template + 5 - Projects + 6 - Network + 7 - VPC + 8 - CPUs + 9 - RAM + 10 - Primary (shared) storage (Volumes) + 11 - Secondary storage (Snapshots, Templates & ISOs) + """ + + Resources.updateCount(apiclient, + domainid=domainid, + account=accountid if accountid else None, + projectid=projectid if projectid else None, + resourcetype=rtype if rtype else None + ) + return + +def find_suitable_host(apiclient, vm): + """Returns a suitable host for VM migration""" + + hosts = Host.list(apiclient, + virtualmachineid=vm.id, + listall=True) + + if isinstance(hosts, list): + assert len(hosts) > 0, "List host should return valid response" + else: + raise Exception("Exception: List host should return valid response") + return hosts[0] + +def get_resource_type(resource_id): + """Returns resource type""" + + lookup = { 0: "VM", + 1: "Public IP", + 2: "Volume", + 3: "Snapshot", + 4: "Template", + 5: "Projects", + 6: "Network", + 7: "VPC", + 8: "CPUs", + 9: "RAM", + 10: "Primary (shared) storage (Volumes)", + 11: "Secondary storage (Snapshots, Templates & ISOs)" + } + + return lookup[resource_id] + +def get_portable_ip_range_services(config): + """ Reads config values related to portable ip and fills up + services accordingly""" + + services = {} + attributeError = False + + if config.portableIpRange.startip: + services["startip"] = config.portableIpRange.startip + else: + attributeError = True + + if config.portableIpRange.endip: + services["endip"] = config.portableIpRange.endip + else: + attributeError = True + + if config.portableIpRange.netmask: + services["netmask"] = config.portableIpRange.netmask + else: + attributeError = True + + if config.portableIpRange.gateway: + services["gateway"] = config.portableIpRange.gateway + else: + attributeError = True + + if config.portableIpRange.vlan: + services["vlan"] = config.portableIpRange.vlan + + if attributeError: + services = None + + return services diff --git a/tools/marvin/build/lib/marvin/integration/lib/utils.py b/tools/marvin/build/lib/marvin/integration/lib/utils.py new file mode 100644 index 00000000000..d81e80d8025 --- /dev/null +++ b/tools/marvin/build/lib/marvin/integration/lib/utils.py @@ -0,0 +1,320 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Utilities functions +""" + +import marvin +import os +import time +import logging +import string +import random +import imaplib +import email +import socket +import urlparse +import datetime +from marvin.cloudstackAPI import * +from marvin.remoteSSHClient import remoteSSHClient + + +def restart_mgmt_server(server): + """Restarts the management server""" + + try: + # Get the SSH client + ssh = is_server_ssh_ready( + server["ipaddress"], + server["port"], + server["username"], + server["password"], + ) + result = ssh.execute("/etc/init.d/cloud-management restart") + res = str(result) + # Server Stop - OK + # Server Start - OK + if res.count("OK") != 2: + raise ("ErrorInReboot!") + except Exception as e: + raise e + return + + +def fetch_latest_mail(services, from_mail): + """Fetch mail""" + + # Login to mail server to verify email + mail = imaplib.IMAP4_SSL(services["server"]) + mail.login( + services["email"], + services["password"] + ) + mail.list() + mail.select(services["folder"]) + date = (datetime.date.today() - datetime.timedelta(1)).strftime("%d-%b-%Y") + + result, data = mail.uid( + 'search', + None, + '(SENTSINCE {date} HEADER FROM "{mail}")'.format( + date=date, + mail=from_mail + ) + ) + # Return False if email is not present + if data == []: + return False + + latest_email_uid = data[0].split()[-1] + result, data = mail.uid('fetch', latest_email_uid, '(RFC822)') + raw_email = data[0][1] + email_message = email.message_from_string(raw_email) + result = get_first_text_block(email_message) + return result + + +def get_first_text_block(email_message_instance): + """fetches first text block from the mail""" + maintype = email_message_instance.get_content_maintype() + if maintype == 'multipart': + for part in email_message_instance.get_payload(): + if part.get_content_maintype() == 'text': + return part.get_payload() + elif maintype == 'text': + return email_message_instance.get_payload() + + +def random_gen(id=None, size=6, chars=string.ascii_uppercase + string.digits): + """Generate Random Strings of variable length""" + randomstr = ''.join(random.choice(chars) for x in range(size)) + if id: + return ''.join([id, '-', randomstr]) + return randomstr + + +def cleanup_resources(api_client, resources): + """Delete resources""" + for obj in resources: + obj.delete(api_client) + + +def is_server_ssh_ready(ipaddress, port, username, password, retries=10, timeout=30, keyPairFileLocation=None): + """Return ssh handle else wait till sshd is running""" + try: + ssh = remoteSSHClient( + host=ipaddress, + port=port, + user=username, + passwd=password, + keyPairFileLocation=keyPairFileLocation, + retries=retries, + delay=timeout) + except Exception, e: + raise Exception("Failed to bring up ssh service in time. Waited %ss. Error is %s" % (retries * timeout, e)) + else: + return ssh + + +def format_volume_to_ext3(ssh_client, device="/dev/sda"): + """Format attached storage to ext3 fs""" + cmds = [ + "echo -e 'n\np\n1\n\n\nw' | fdisk %s" % device, + "mkfs.ext3 %s1" % device, + ] + for c in cmds: + ssh_client.execute(c) + + +def fetch_api_client(config_file='datacenterCfg'): + """Fetch the Cloudstack API Client""" + config = marvin.configGenerator.get_setup_config(config_file) + mgt = config.mgtSvr[0] + testClientLogger = logging.getLogger("testClient") + asyncTimeout = 3600 + return cloudstackAPIClient.CloudStackAPIClient( + marvin.cloudstackConnection.cloudConnection( + mgt.mgtSvrIp, + mgt.port, + mgt.apiKey, + mgt.securityKey, + asyncTimeout, + testClientLogger + ) + ) + +def get_host_credentials(config, hostip): + """Get login information for a host `hostip` (ipv4) from marvin's `config` + + @return the tuple username, password for the host else raise keyerror""" + for zone in config.zones: + for pod in zone.pods: + for cluster in pod.clusters: + for host in cluster.hosts: + if str(host.url).startswith('http'): + hostname = urlparse.urlsplit(str(host.url)).netloc + else: + hostname = str(host.url) + try: + if socket.getfqdn(hostip) == socket.getfqdn(hostname): + return host.username, host.password + except socket.error, e: + raise Exception("Unresolvable host %s error is %s" % (hostip, e)) + raise KeyError("Please provide the marvin configuration file with credentials to your hosts") + + +def get_process_status(hostip, port, username, password, linklocalip, process, hypervisor=None): + """Double hop and returns a process status""" + + #SSH to the machine + ssh = remoteSSHClient(hostip, port, username, password) + if str(hypervisor).lower() == 'vmware': + ssh_command = "ssh -i /var/cloudstack/management/.ssh/id_rsa -ostricthostkeychecking=no " + else: + ssh_command = "ssh -i ~/.ssh/id_rsa.cloud -ostricthostkeychecking=no " + + ssh_command = ssh_command +\ + "-oUserKnownHostsFile=/dev/null -p 3922 %s %s" % ( + linklocalip, + process) + + # Double hop into router + timeout = 5 + # Ensure the SSH login is successful + while True: + res = ssh.execute(ssh_command) + + if res[0] != "Host key verification failed.": + break + elif timeout == 0: + break + + time.sleep(5) + timeout = timeout - 1 + return res + + +def isAlmostEqual(first_digit, second_digit, range=0): + digits_equal_within_range = False + + try: + if ((first_digit - range) < second_digit < (first_digit + range)): + digits_equal_within_range = True + except Exception as e: + raise e + return digits_equal_within_range + + +def xsplit(txt, seps): + """ + Split a string in `txt` by list of delimiters in `seps` + @param txt: string to split + @param seps: list of separators + @return: list of split units + """ + default_sep = seps[0] + for sep in seps[1:]: # we skip seps[0] because that's the default separator + txt = txt.replace(sep, default_sep) + return [i.strip() for i in txt.split(default_sep)] + +def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): + """ + Checks whether a snapshot with id (not UUID) `snapshotid` is present on the nfs storage + + @param apiclient: api client connection + @param @dbconn: connection to the cloudstack db + @param config: marvin configuration file + @param zoneid: uuid of the zone on which the secondary nfs storage pool is mounted + @param snapshotid: uuid of the snapshot + @return: True if snapshot is found, False otherwise + """ + + from base import ImageStore, Snapshot + secondaryStores = ImageStore.list(apiclient, zoneid=zoneid) + + assert isinstance(secondaryStores, list), "Not a valid response for listImageStores" + assert len(secondaryStores) != 0, "No image stores found in zone %s" % zoneid + + secondaryStore = secondaryStores[0] + + if str(secondaryStore.providername).lower() != "nfs": + raise Exception( + "is_snapshot_on_nfs works only against nfs secondary storage. found %s" % str(secondaryStore.providername)) + + qresultset = dbconn.execute( + "select id from snapshots where uuid = '%s';" \ + % str(snapshotid) + ) + if len(qresultset) == 0: + raise Exception( + "No snapshot found in cloudstack with id %s" % snapshotid) + + + snapshotid = qresultset[0][0] + qresultset = dbconn.execute( + "select install_path from snapshot_store_ref where snapshot_id='%s' and store_role='Image';" % snapshotid + ) + + assert isinstance(qresultset, list), "Invalid db query response for snapshot %s" % snapshotid + + if len(qresultset) == 0: + #Snapshot does not exist + return False + + snapshotPath = qresultset[0][0] + + nfsurl = secondaryStore.url + from urllib2 import urlparse + parse_url = urlparse.urlsplit(nfsurl, scheme='nfs') + host, path = parse_url.netloc, parse_url.path + + if not config.mgtSvr: + raise Exception("Your marvin configuration does not contain mgmt server credentials") + mgtSvr, user, passwd = config.mgtSvr[0].mgtSvrIp, config.mgtSvr[0].user, config.mgtSvr[0].passwd + + try: + ssh_client = remoteSSHClient( + mgtSvr, + 22, + user, + passwd + ) + cmds = [ + "mkdir -p %s /mnt/tmp", + "mount -t %s %s%s /mnt/tmp" % ( + 'nfs', + host, + path, + ), + "test -f %s && echo 'snapshot exists'" % ( + os.path.join("/mnt/tmp", snapshotPath) + ), + ] + + for c in cmds: + result = ssh_client.execute(c) + + # Unmount the Sec Storage + cmds = [ + "cd", + "umount /mnt/tmp", + ] + for c in cmds: + ssh_client.execute(c) + except Exception as e: + raise Exception("SSH failed for management server: %s - %s" % + (config.mgtSvr[0].mgtSvrIp, e)) + return 'snapshot exists' in result diff --git a/tools/marvin/build/lib/marvin/jsonHelper.py b/tools/marvin/build/lib/marvin/jsonHelper.py new file mode 100644 index 00000000000..ae40b8dabf0 --- /dev/null +++ b/tools/marvin/build/lib/marvin/jsonHelper.py @@ -0,0 +1,381 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 cloudstackException +import json +import inspect +from cloudstackAPI import * + + +class jsonLoader(object): + '''The recursive class for building and representing objects with.''' + def __init__(self, obj): + for k in obj: + v = obj[k] + if isinstance(v, dict): + setattr(self, k, jsonLoader(v)) + elif isinstance(v, (list, tuple)): + if len(v) > 0 and isinstance(v[0], dict): + setattr(self, k, [jsonLoader(elem) for elem in v]) + else: + setattr(self, k, v) + else: + setattr(self, k, v) + + def __getattr__(self, val): + if val in self.__dict__: + return self.__dict__[val] + else: + return None + + def __repr__(self): + return '{%s}' % str(', '.join('%s : %s' % (k, repr(v)) for (k, v) + in self.__dict__.iteritems())) + + def __str__(self): + return '{%s}' % str(', '.join('%s : %s' % (k, repr(v)) for (k, v) + in self.__dict__.iteritems())) + + +class jsonDump(object): + @staticmethod + def __serialize(obj): + """Recursively walk object's hierarchy.""" + if isinstance(obj, (bool, int, long, float, basestring)): + return obj + elif isinstance(obj, dict): + obj = obj.copy() + newobj = {} + for key in obj: + if obj[key] is not None: + if (isinstance(obj[key], list) and len(obj[key]) == 0): + continue + newobj[key] = jsonDump.__serialize(obj[key]) + + return newobj + elif isinstance(obj, list): + return [jsonDump.__serialize(item) for item in obj] + elif isinstance(obj, tuple): + return tuple(jsonDump.__serialize([item for item in obj])) + elif hasattr(obj, '__dict__'): + return jsonDump.__serialize(obj.__dict__) + else: + return repr(obj) # Don't know how to handle, convert to string + + @staticmethod + def dump(obj): + return jsonDump.__serialize(obj) + + +def getclassFromName(cmd, name): + module = inspect.getmodule(cmd) + return getattr(module, name)() + + +def finalizeResultObj(result, responseName, responsecls): + responsclsLoadable = (responsecls is None + and responseName.endswith("response") + and responseName != "queryasyncjobresultresponse") + if responsclsLoadable: + '''infer the response class from the name''' + moduleName = responseName.replace("response", "") + try: + responsecls = getclassFromName(moduleName, responseName) + except: + pass + + responsNameValid = (responseName is not None + and responseName == "queryasyncjobresultresponse" + and responsecls is not None + and result.jobresult is not None) + if responsNameValid: + result.jobresult = finalizeResultObj(result.jobresult, None, + responsecls) + return result + elif responsecls is not None: + for k, v in result.__dict__.iteritems(): + if k in responsecls.__dict__: + return result + + attr = result.__dict__.keys()[0] + + value = getattr(result, attr) + if not isinstance(value, jsonLoader): + return result + + findObj = False + for k, v in value.__dict__.iteritems(): + if k in responsecls.__dict__: + findObj = True + break + if findObj: + return value + else: + return result + else: + return result + + +def getResultObj(returnObj, responsecls=None): + if len(returnObj) == 0: + return None + responseName = filter(lambda a: a != u'cloudstack-version', + returnObj.keys())[0] + + response = returnObj[responseName] + if len(response) == 0: + return None + + result = jsonLoader(response) + if result.errorcode is not None: + errMsg = "errorCode: %s, errorText:%s" % (result.errorcode, + result.errortext) + respname = responseName.replace("response", "") + raise cloudstackException.cloudstackAPIException(respname, errMsg) + + if result.count is not None: + for key in result.__dict__.iterkeys(): + if key == "count": + continue + else: + return getattr(result, key) + else: + return finalizeResultObj(result, responseName, responsecls) + +if __name__ == "__main__": + + result = '''{ "listnetworkserviceprovidersresponse" : { "count" : 1, + "networkserviceprovider" : [ { "destinationphysicalnetworkid" : "0", + "id" : "d827cae4-4998-4037-95a2-55b92b6318b1", + "name" : "VirtualRouter", + "physicalnetworkid" : "ad2948fc-1054-46c7-b1c7-61d990b86710", + "servicelist" : [ "Vpn", + "Dhcp", + "Dns", + "Gateway", + "Firewall", + "Lb", + "SourceNat", + "StaticNat", + "PortForwarding", + "UserData" + ], + "state" : "Disabled" + } ] + } }''' + nsp = getResultObj(result) + print nsp[0].id + + result = '''{ "listzonesresponse" : { + "count" : 1, + "zone" : [ { "allocationstate" : "Enabled", + "dhcpprovider" : "DhcpServer", + "dns1" : "8.8.8.8", + "dns2" : "8.8.4.4", + "id" : 1, + "internaldns1" : "192.168.110.254", + "internaldns2" : "192.168.110.253", + "name" : "test0", + "networktype" : "Basic", + "securitygroupsenabled" : true, + "zonetoken" : "5e818a11-6b00-3429-9a07-e27511d3169a" + } ] + } +}''' + zones = getResultObj(result) + print zones[0].id + res = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressResponse() + result = '''{ + "queryasyncjobresultresponse" : { + "jobid" : 10, + "jobprocstatus" : 0, + "jobresult" : { + "securitygroup" : { + "account" : "admin", + "description" : "Default Security Group", + "domain" : "ROOT", + "domainid" : 1, + "id" : 1, + "ingressrule" : [ { "account" : "a", + "endport" : 22, + "protocol" : "tcp", + "ruleid" : 1, + "securitygroupname" : "default", + "startport" : 22 + }, + { "account" : "b", + "endport" : 22, + "protocol" : "tcp", + "ruleid" : 2, + "securitygroupname" : "default", + "startport" : 22 + } + ], + "name" : "default" + } + }, + "jobresultcode" : 0, + "jobresulttype" : "object", + "jobstatus" : 1 + } +}''' + asynJob = getResultObj(result, res) + print asynJob.jobid, repr(asynJob.jobresult) + print asynJob.jobresult.ingressrule[0].account + + result = '''{ + "queryasyncjobresultresponse" : { + "errorcode" : 431, + "errortext" : +"Unable to execute API command queryasyncjobresultresponse \ +due to missing parameter jobid" + } +}''' + try: + asynJob = getResultObj(result) + except cloudstackException.cloudstackAPIException, e: + print e + + result = '{ "queryasyncjobresultresponse" : {} }' + asynJob = getResultObj(result) + print asynJob + + result = '{}' + asynJob = getResultObj(result) + print asynJob + + result = '''{ + "createzoneresponse" : { + "zone" : { + "id":1,"name":"test0","dns1":"8.8.8.8","dns2":"8.8.4.4", + "internaldns1":"192.168.110.254","internaldns2":"192.168.110.253", + "networktype":"Basic","securitygroupsenabled":true, + "allocationstate":"Enabled", + "zonetoken":"3442f287-e932-3111-960b-514d1f9c4610", + "dhcpprovider":"DhcpServer" + } + } +}''' + res = createZone.createZoneResponse() + zone = getResultObj(result, res) + print zone.id + + result = '{ "attachvolumeresponse" : {"jobid":24} }' + res = attachVolume.attachVolumeResponse() + res = getResultObj(result, res) + print res + + result = '{ "listtemplatesresponse" : { } }' + print getResultObj(result, listTemplates.listTemplatesResponse()) + + result = '''{ + "queryasyncjobresultresponse" : { + "jobid":34,"jobstatus":2,"jobprocstatus":0,"jobresultcode":530, + "jobresulttype":"object","jobresult":{ + "errorcode":431, + "errortext": +"Please provide either a volume id, or a tuple(device id, instance id)" + } + } +}''' + print getResultObj(result, listTemplates.listTemplatesResponse()) + result = '''{ + "queryasyncjobresultresponse" : { + "jobid":41,"jobstatus":1,"jobprocstatus":0, + "jobresultcode":0,"jobresulttype":"object","jobresult":{ + "virtualmachine":{ + "id":37,"name":"i-2-37-TEST", + "displayname":"i-2-37-TEST","account":"admin", + "domainid":1,"domain":"ROOT", + "created":"2011-08-25T11:13:42-0700", + "state":"Running","haenable":false,"zoneid":1, + "zonename":"test0","hostid":5, + "hostname": + "SimulatedAgent.1e629060-f547-40dd-b792-57cdc4b7d611", + "templateid":10, + "templatename":"CentOS 5.3(64-bit) no GUI (Simulator)", + "templatedisplaytext": + "CentOS 5.3(64-bit) no GUI (Simulator)", + "passwordenabled":false,"serviceofferingid":7, + "serviceofferingname":"Small Instance","cpunumber":1, + "cpuspeed":500,"memory":512,"guestosid":11, + "rootdeviceid":0,"rootdevicetype":"NetworkFilesystem", + "securitygroup":[{"id":1,"name":"default", + "description":"Default Security Group"}], + "nic":[{"id":43,"networkid":204, + "netmask":"255.255.255.0","gateway":"192.168.1.1", + "ipaddress":"192.168.1.27", + "isolationuri":"ec2://untagged", + "broadcasturi":"vlan://untagged", + "traffictype":"Guest","type":"Direct", + "isdefault":true,"macaddress":"06:56:b8:00:00:53"}], + "hypervisor":"Simulator" + } + } + } +}''' + + result = '''{ + "queryasyncjobresultresponse" : { + "accountid":"30910093-22e4-4d3c-a464-8b36b60c8001", + "userid":"cb0aeca3-42ee-47c4-838a-2cd9053441f2", + "cmd":"com.cloud.api.commands.DeployVMCmd","jobstatus":1, + "jobprocstatus":0,"jobresultcode":0,"jobresulttype":"object", + "jobresult":{ + "virtualmachine":{ + "id":"d2e4d724-e089-4e59-be8e-647674059016", + "name":"i-2-14-TEST","displayname":"i-2-14-TEST", + "account":"admin", + "domainid":"8cfafe79-81eb-445e-8608-c5b7c31fc3a5", + "domain":"ROOT","created":"2012-01-15T18:30:11+0530", + "state":"Running","haenable":false, + "zoneid":"30a397e2-1c85-40c0-8463-70278952b046", + "zonename":"Sandbox-simulator", + "hostid":"cc0105aa-a2a9-427a-8ad7-4d835483b8a9", + "hostname": + "SimulatedAgent.9fee20cc-95ca-48b1-8268-5513d6e83a1b", + "templateid":"d92570fa-bf40-44db-9dff-45cc7042604d", + "templatename":"CentOS 5.3(64-bit) no GUI (Simulator)", + "templatedisplaytext":"CentOS 5.3(64-bit) no GUI (Simulator)", + "passwordenabled":false, + "serviceofferingid":"3734d632-797b-4f1d-ac62-33f9cf70d005", + "serviceofferingname":"Sample SO","cpunumber":1,"cpuspeed":100, + "memory":128, + "guestosid":"1e36f523-23e5-4e90-869b-a1b5e9ba674d", + "rootdeviceid":0,"rootdevicetype":"NetworkFilesystem", + "nic":[{"id":"4d3ab903-f511-4dab-8a6d-c2a3b51de7e0", + "networkid":"faeb7f24-a4b9-447d-bec6-c4956c4ab0f6", + "netmask":"255.255.240.0","gateway":"10.6.240.1",' + "ipaddress":"10.6.253.89","isolationuri":"vlan://211", + "broadcasturi":"vlan://211","traffictype":"Guest", + "type":"Isolated","isdefault":true, + "macaddress":"02:00:04:74:00:09"}], + "hypervisor":"Simulator" + } + }, + "created":"2012-01-15T18:30:11+0530", + "jobid":"f4a13f28-fcd6-4d7f-b9cd-ba7eb5a5701f" + } +}''' + vm = getResultObj(result, + deployVirtualMachine.deployVirtualMachineResponse()) + print vm.jobresult.id + + cmd = deployVirtualMachine.deployVirtualMachineCmd() + responsename = cmd.__class__.__name__.replace("Cmd", "Response") + response = getclassFromName(cmd, responsename) + print response.id diff --git a/tools/marvin/build/lib/marvin/marvinPlugin.py b/tools/marvin/build/lib/marvin/marvinPlugin.py new file mode 100644 index 00000000000..aded17cca55 --- /dev/null +++ b/tools/marvin/build/lib/marvin/marvinPlugin.py @@ -0,0 +1,144 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 marvin +import sys +import logging +import nose.core +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin import deployDataCenter +from nose.plugins.base import Plugin + + +class MarvinPlugin(Plugin): + """ + Custom plugin for the cloudstackTestCases to be run using nose + """ + + name = "marvin" + + def configure(self, options, config): + if hasattr(options, self.enableOpt): + if not getattr(options, self.enableOpt): + self.enabled = False + return + else: + self.enabled = True + + self.logformat = logging.Formatter("%(asctime)s - %(levelname)s - " + + "%(name)s - %(message)s") + + if options.debug_log: + self.logger = logging.getLogger("NoseTestExecuteEngine") + self.debug_stream = logging.FileHandler(options.debug_log) + self.debug_stream.setFormatter(self.logformat) + self.logger.addHandler(self.debug_stream) + self.logger.setLevel(logging.DEBUG) + + if options.result_log: + ch = logging.StreamHandler() + ch.setLevel(logging.ERROR) + ch.setFormatter(self.logformat) + self.logger.addHandler(ch) + self.result_stream = open(options.result_log, "w") + else: + self.result_stream = sys.stdout + + deploy = deployDataCenter.deployDataCenters(options.config) + deploy.loadCfg() if options.load else deploy.deploy() + self.setClient(deploy.testClient) + self.setConfig(deploy.getCfg()) + + self.testrunner = nose.core.TextTestRunner(stream=self.result_stream, + descriptions=True, + verbosity=2, config=config) + + def options(self, parser, env): + """ + Register command line options + """ + parser.add_option("--marvin-config", action="store", + default=env.get('MARVIN_CONFIG', './datacenter.cfg'), + dest="config", + help="Marvin's configuration file where the " + + "datacenter information is specified " + + "[MARVIN_CONFIG]") + parser.add_option("--result-log", action="store", + default=env.get('RESULT_LOG', None), + dest="result_log", + help="The path to the results file where test " + + "summary will be written to [RESULT_LOG]") + parser.add_option("--client-log", action="store", + default=env.get('DEBUG_LOG', 'debug.log'), + dest="debug_log", + help="The path to the testcase debug logs " + + "[DEBUG_LOG]") + parser.add_option("--load", action="store_true", default=False, + dest="load", + help="Only load the deployment configuration given") + + Plugin.options(self, parser, env) + + def __init__(self): + self.identifier = None + Plugin.__init__(self) + + def prepareTestRunner(self, runner): + return self.testrunner + + def wantClass(self, cls): + if cls.__name__ == 'cloudstackTestCase': + return False + if issubclass(cls, cloudstackTestCase): + return True + return None + + def loadTestsFromTestCase(self, cls): + if cls.__name__ != 'cloudstackTestCase': + self.identifier = cls.__name__ + self._injectClients(cls) + + def setClient(self, client): + if client is not None: + self.testclient = client + + def setConfig(self, config): + if config is not None: + self.config = config + + def beforeTest(self, test): + testname = test.__str__().split()[0] + self.testclient.identifier = '-'.join([self.identifier, testname]) + self.logger.name = test.__str__() + + def _injectClients(self, test): + self.debug_stream. \ + setFormatter(logging. + Formatter("%(asctime)s - %(levelname)s - %(name)s" + + " - %(message)s")) + setattr(test, "debug", self.logger.debug) + setattr(test, "info", self.logger.info) + setattr(test, "warn", self.logger.warning) + setattr(test, "testClient", self.testclient) + setattr(test, "config", self.config) + if self.testclient.identifier is None: + self.testclient.identifier = self.identifier + setattr(test, "clstestclient", self.testclient) + if hasattr(test, "user"): + # when the class-level attr applied. all test runs as 'user' + self.testclient.createUserApiClient(test.UserName, test.DomainName, + test.AcctType) diff --git a/tools/marvin/build/lib/marvin/remoteSSHClient.py b/tools/marvin/build/lib/marvin/remoteSSHClient.py new file mode 100644 index 00000000000..fea9b125d19 --- /dev/null +++ b/tools/marvin/build/lib/marvin/remoteSSHClient.py @@ -0,0 +1,108 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 paramiko +import time +import cloudstackException +import contextlib +import logging +from contextlib import closing + + +class remoteSSHClient(object): + def __init__(self, host, port, user, passwd, retries=10, delay=30, + log_lvl=logging.INFO, keyPairFileLocation=None): + self.host = host + self.port = port + self.user = user + self.passwd = passwd + self.keyPairFile = keyPairFileLocation + self.ssh = paramiko.SSHClient() + self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + self.logger = logging.getLogger('sshClient') + ch = logging.StreamHandler() + ch.setLevel(log_lvl) + self.logger.addHandler(ch) + + retry_count = retries + while retry_count >= 0: + try: + if keyPairFileLocation is None: + self.ssh.connect(str(host), int(port), user, passwd) + self.logger.debug("SSH connect: %s@%s with passwd %s" % + (user, str(host), passwd)) + else: + self.ssh.connect(hostname=str(host), + port=int(port), + username=str(user), + key_filename=str(keyPairFileLocation), + look_for_keys=False + ) + self.logger.debug( + "connecting to server %s with user %s key %s" % + (str(host), user, keyPairFileLocation)) + self.logger.debug("SSH connect: %s@%s with passwd %s" % + (user, str(host), passwd)) + #except paramiko.AuthenticationException, authEx: + # raise cloudstackException. \ + # InvalidParameterException("Invalid credentials to " + # + "login to %s on port %s" % + # (str(host), port)) + except Exception as se: + if retry_count == 0: + raise cloudstackException. \ + InvalidParameterException(repr(se)) + else: + return + + retry_count = retry_count - 1 + time.sleep(delay) + + def execute(self, command): + stdin, stdout, stderr = self.ssh.exec_command(command) + output = stdout.readlines() + errors = stderr.readlines() + results = [] + if output is not None and len(output) == 0: + if errors is not None and len(errors) > 0: + for error in errors: + results.append(error.rstrip()) + + else: + for strOut in output: + results.append(strOut.rstrip()) + self.logger.debug("{Cmd: %s via Host: %s} {returns: %s}" % + (command, str(self.host), results)) + return results + + def scp(self, srcFile, destPath): + transport = paramiko.Transport((self.host, int(self.port))) + transport.connect(username=self.user, password=self.passwd) + sftp = paramiko.SFTPClient.from_transport(transport) + try: + sftp.put(srcFile, destPath) + except IOError, e: + raise e + + def close(self): + self.ssh.close() + + +if __name__ == "__main__": + with contextlib.closing(remoteSSHClient("10.223.75.10", 22, "root", + "password")) as ssh: + print ssh.execute("ls -l") diff --git a/tools/marvin/build/lib/marvin/sandbox/__init__.py b/tools/marvin/build/lib/marvin/sandbox/__init__.py new file mode 100644 index 00000000000..57823fcc162 --- /dev/null +++ b/tools/marvin/build/lib/marvin/sandbox/__init__.py @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + diff --git a/tools/marvin/build/lib/marvin/sandbox/advanced/__init__.py b/tools/marvin/build/lib/marvin/sandbox/advanced/__init__.py new file mode 100644 index 00000000000..57823fcc162 --- /dev/null +++ b/tools/marvin/build/lib/marvin/sandbox/advanced/__init__.py @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + diff --git a/tools/marvin/build/lib/marvin/sandbox/advanced/advanced_env.py b/tools/marvin/build/lib/marvin/sandbox/advanced/advanced_env.py new file mode 100644 index 00000000000..1728e61fb19 --- /dev/null +++ b/tools/marvin/build/lib/marvin/sandbox/advanced/advanced_env.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +''' +############################################################ +# Experimental state of scripts +# * Need to be reviewed +# * Only a sandbox +############################################################ +''' +import random +import marvin +from ConfigParser import SafeConfigParser +from optparse import OptionParser +from marvin.configGenerator import * + + +def getGlobalSettings(config): + for k, v in dict(config.items('globals')).iteritems(): + cfg = configuration() + cfg.name = k + cfg.value = v + yield cfg + + +def describeResources(config): + zs = cloudstackConfiguration() + + z = zone() + z.dns1 = config.get('environment', 'dns') + z.internaldns1 = config.get('environment', 'dns') + z.name = 'Sandbox-%s'%(config.get('cloudstack', 'hypervisor')) + z.networktype = 'Advanced' + z.guestcidraddress = '10.1.1.0/24' + z.securitygroupenabled = 'false' + + vpcprovider = provider() + vpcprovider.name = 'VpcVirtualRouter' + + lbprovider = provider() + lbprovider.name = 'InternalLbVm' + + pn = physical_network() + pn.name = "Sandbox-pnet" + pn.vlan = config.get('cloudstack', 'pnet.vlan') + pn.tags = ["cloud-simulator-public"] + pn.traffictypes = [traffictype("Guest"), + traffictype("Management", {"simulator" : "cloud-simulator-mgmt"}), + traffictype("Public", {"simulator":"cloud-simulator-public"})] + pn.isolationmethods = ["VLAN"] + pn.providers.append(vpcprovider) + pn.providers.append(lbprovider) + + pn2 = physical_network() + pn2.name = "Sandbox-pnet2" + pn2.vlan = config.get('cloudstack', 'pnet2.vlan') + pn2.tags = ["cloud-simulator-guest"] + pn2.traffictypes = [traffictype('Guest', {'simulator': 'cloud-simulator-guest'})] + pn2.isolationmethods = ["VLAN"] + pn2.providers.append(vpcprovider) + pn2.providers.append(lbprovider) + + z.physical_networks.append(pn) + z.physical_networks.append(pn2) + + p = pod() + p.name = 'POD0' + p.gateway = config.get('cloudstack', 'private.gateway') + p.startip = config.get('cloudstack', 'private.pod.startip') + p.endip = config.get('cloudstack', 'private.pod.endip') + p.netmask = config.get('cloudstack', 'private.netmask') + + v = iprange() + v.gateway = config.get('cloudstack', 'public.gateway') + v.startip = config.get('cloudstack', 'public.vlan.startip') + v.endip = config.get('cloudstack', 'public.vlan.endip') + v.netmask = config.get('cloudstack', 'public.netmask') + v.vlan = config.get('cloudstack', 'public.vlan') + z.ipranges.append(v) + + c = cluster() + c.clustername = 'C0' + c.hypervisor = config.get('cloudstack', 'hypervisor') + c.clustertype = 'CloudManaged' + + h = host() + h.username = 'root' + h.password = config.get('cloudstack', 'host.password') + h.url = 'http://%s'%(config.get('cloudstack', 'host')) + c.hosts.append(h) + + ps = primaryStorage() + ps.name = 'PS0' + ps.url = config.get('cloudstack', 'primary.pool') + c.primaryStorages.append(ps) + + p.clusters.append(c) + z.pods.append(p) + + secondary = secondaryStorage() + secondary.url = config.get('cloudstack', 'secondary.pool') + secondary.provider = "NFS" + z.secondaryStorages.append(secondary) + + '''Add zone''' + zs.zones.append(z) + + '''Add mgt server''' + mgt = managementServer() + mgt.mgtSvrIp = config.get('environment', 'mshost') + mgt.user = config.get('environment', 'mshost.user') + mgt.passwd = config.get('environment', 'mshost.passwd') + zs.mgtSvr.append(mgt) + + '''Add a database''' + db = dbServer() + db.dbSvr = config.get('environment', 'mysql.host') + db.user = config.get('environment', 'mysql.cloud.user') + db.passwd = config.get('environment', 'mysql.cloud.passwd') + zs.dbSvr = db + + '''Add some configuration''' + [zs.globalConfig.append(cfg) for cfg in getGlobalSettings(config)] + + ''''add loggers''' + testClientLogger = logger() + testClientLogger.name = 'TestClient' + testClientLogger.file = 'testclient.log' + + testCaseLogger = logger() + testCaseLogger.name = 'TestCase' + testCaseLogger.file = 'testcase.log' + + zs.logger.append(testClientLogger) + zs.logger.append(testCaseLogger) + return zs + + +if __name__ == '__main__': + parser = OptionParser() + parser.add_option('-i', '--input', action='store', default='setup.properties', \ + dest='input', help='file containing environment setup information') + parser.add_option('-o', '--output', action='store', default='./sandbox.cfg', \ + dest='output', help='path where environment json will be generated') + + + (opts, args) = parser.parse_args() + + cfg_parser = SafeConfigParser() + cfg_parser.read(opts.input) + + cfg = describeResources(cfg_parser) + generate_setup_config(cfg, opts.output) diff --git a/tools/marvin/build/lib/marvin/sandbox/advancedsg/__init__.py b/tools/marvin/build/lib/marvin/sandbox/advancedsg/__init__.py new file mode 100644 index 00000000000..57823fcc162 --- /dev/null +++ b/tools/marvin/build/lib/marvin/sandbox/advancedsg/__init__.py @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + diff --git a/tools/marvin/build/lib/marvin/sandbox/advancedsg/advancedsg_env.py b/tools/marvin/build/lib/marvin/sandbox/advancedsg/advancedsg_env.py new file mode 100644 index 00000000000..9cf4a0aa98f --- /dev/null +++ b/tools/marvin/build/lib/marvin/sandbox/advancedsg/advancedsg_env.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +''' +############################################################ +# Experimental state of scripts +# * Need to be reviewed +# * Only a sandbox +############################################################ +''' +import random +import marvin +from ConfigParser import SafeConfigParser +from optparse import OptionParser +from marvin.configGenerator import * + + +def getGlobalSettings(config): + for k, v in dict(config.items('globals')).iteritems(): + cfg = configuration() + cfg.name = k + cfg.value = v + yield cfg + + +def describeResources(config): + zs = cloudstackConfiguration() + + z = zone() + z.dns1 = config.get('environment', 'dns') + z.internaldns1 = config.get('environment', 'dns') + z.name = 'Sandbox-%s'%(config.get('cloudstack', 'hypervisor')) + z.networktype = 'Advanced' + z.securitygroupenabled = 'true' + + sgprovider = provider() + sgprovider.broadcastdomainrange = 'ZONE' + sgprovider.name = 'SecurityGroupProvider' + + pn = physical_network() + pn.name = "Sandbox-pnet" + pn.tags = ["cloud-simulator-pnet"] + pn.traffictypes = [traffictype("Guest"), + traffictype("Management", {"simulator" : "cloud-simulator-mgmt"})] + pn.isolationmethods = ["VLAN"] + pn.providers.append(sgprovider) + + z.physical_networks.append(pn) + + p = pod() + p.name = 'POD0' + p.gateway = config.get('cloudstack', 'private.gateway') + p.startip = config.get('cloudstack', 'private.pod.startip') + p.endip = config.get('cloudstack', 'private.pod.endip') + p.netmask = config.get('cloudstack', 'private.netmask') + + v = iprange() + v.gateway = config.get('cloudstack', 'guest.gateway') + v.startip = config.get('cloudstack', 'guest.vlan.startip') + v.endip = config.get('cloudstack', 'guest.vlan.endip') + v.netmask = config.get('cloudstack', 'guest.netmask') + v.vlan = config.get('cloudstack', 'guest.vlan') + z.ipranges.append(v) + + c = cluster() + c.clustername = 'C0' + c.hypervisor = config.get('cloudstack', 'hypervisor') + c.clustertype = 'CloudManaged' + + h = host() + h.username = 'root' + h.password = config.get('cloudstack', 'host.password') + h.url = 'http://%s'%(config.get('cloudstack', 'host')) + c.hosts.append(h) + + ps = primaryStorage() + ps.name = 'PS0' + ps.url = config.get('cloudstack', 'primary.pool') + c.primaryStorages.append(ps) + + p.clusters.append(c) + z.pods.append(p) + + secondary = secondaryStorage() + secondary.url = config.get('cloudstack', 'secondary.pool') + secondary.provider = "NFS" + z.secondaryStorages.append(secondary) + + '''Add zone''' + zs.zones.append(z) + + '''Add mgt server''' + mgt = managementServer() + mgt.mgtSvrIp = config.get('environment', 'mshost') + mgt.user = config.get('environment', 'mshost.user') + mgt.passwd = config.get('environment', 'mshost.passwd') + zs.mgtSvr.append(mgt) + + '''Add a database''' + db = dbServer() + db.dbSvr = config.get('environment', 'mysql.host') + db.user = config.get('environment', 'mysql.cloud.user') + db.passwd = config.get('environment', 'mysql.cloud.passwd') + zs.dbSvr = db + + '''Add some configuration''' + [zs.globalConfig.append(cfg) for cfg in getGlobalSettings(config)] + + ''''add loggers''' + testClientLogger = logger() + testClientLogger.name = 'TestClient' + testClientLogger.file = 'testclient.log' + + testCaseLogger = logger() + testCaseLogger.name = 'TestCase' + testCaseLogger.file = 'testcase.log' + + zs.logger.append(testClientLogger) + zs.logger.append(testCaseLogger) + return zs + + +if __name__ == '__main__': + parser = OptionParser() + parser.add_option('-i', '--input', action='store', default='setup.properties', \ + dest='input', help='file containing environment setup information') + parser.add_option('-o', '--output', action='store', default='./sandbox.cfg', \ + dest='output', help='path where environment json will be generated') + + + (opts, args) = parser.parse_args() + + cfg_parser = SafeConfigParser() + cfg_parser.read(opts.input) + + cfg = describeResources(cfg_parser) + generate_setup_config(cfg, opts.output) diff --git a/tools/marvin/build/lib/marvin/sandbox/basic/__init__.py b/tools/marvin/build/lib/marvin/sandbox/basic/__init__.py new file mode 100644 index 00000000000..57823fcc162 --- /dev/null +++ b/tools/marvin/build/lib/marvin/sandbox/basic/__init__.py @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + diff --git a/tools/marvin/build/lib/marvin/sandbox/basic/basic_env.py b/tools/marvin/build/lib/marvin/sandbox/basic/basic_env.py new file mode 100644 index 00000000000..bf106fcb8de --- /dev/null +++ b/tools/marvin/build/lib/marvin/sandbox/basic/basic_env.py @@ -0,0 +1,149 @@ +#!/usr/bin/env python +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +''' +############################################################ +# Experimental state of scripts +# * Need to be reviewed +# * Only a sandbox +############################################################ +''' +import random +import marvin +from ConfigParser import SafeConfigParser +from optparse import OptionParser +from marvin.configGenerator import * + + +def getGlobalSettings(config): + for k, v in dict(config.items('globals')).iteritems(): + cfg = configuration() + cfg.name = k + cfg.value = v + yield cfg + + +def describeResources(config): + zs = cloudstackConfiguration() + + z = zone() + z.dns1 = config.get('environment', 'dns') + z.internaldns1 = config.get('environment', 'dns') + z.name = 'Sandbox-%s'%(config.get('cloudstack', 'hypervisor')) + z.networktype = 'Basic' + z.securitygroupenabled = 'true' + + sgprovider = provider() + sgprovider.broadcastdomainrange = 'Pod' + sgprovider.name = 'SecurityGroupProvider' + + pn = physical_network() + pn.name = "Sandbox-pnet" + pn.traffictypes = [traffictype("Guest"), traffictype("Management")] + pn.isolationmethods = ["L3"] + pn.providers.append(sgprovider) + + z.physical_networks.append(pn) + + p = pod() + p.name = 'POD0' + p.gateway = config.get('cloudstack', 'private.gateway') + p.startip = config.get('cloudstack', 'private.pod.startip') + p.endip = config.get('cloudstack', 'private.pod.endip') + p.netmask = config.get('cloudstack', 'private.netmask') + + v = iprange() + v.gateway = config.get('cloudstack', 'public.gateway') + v.startip = config.get('cloudstack', 'public.vlan.startip') + v.endip = config.get('cloudstack', 'public.vlan.endip') + v.netmask = config.get('cloudstack', 'public.netmask') + p.guestIpRanges.append(v) + + c = cluster() + c.clustername = 'C0' + c.hypervisor = config.get('cloudstack', 'hypervisor') + c.clustertype = 'CloudManaged' + + h = host() + h.username = 'root' + h.password = config.get('cloudstack', 'host.password') + h.url = 'http://%s'%(config.get('cloudstack', 'host')) + c.hosts.append(h) + + ps = primaryStorage() + ps.name = 'PS0' + ps.url = config.get('cloudstack', 'primary.pool') + c.primaryStorages.append(ps) + + p.clusters.append(c) + z.pods.append(p) + + secondary = secondaryStorage() + secondary.url = config.get('cloudstack', 'secondary.pool') + secondary.provider = "NFS" + z.secondaryStorages.append(secondary) + + '''Add zone''' + zs.zones.append(z) + + '''Add mgt server''' + mgt = managementServer() + mgt.mgtSvrIp = config.get('environment', 'mshost') + mgt.user = config.get('environment', 'mshost.user') + mgt.passwd = config.get('environment', 'mshost.passwd') + zs.mgtSvr.append(mgt) + + '''Add a database''' + db = dbServer() + db.dbSvr = config.get('environment', 'mysql.host') + db.user = config.get('environment', 'mysql.cloud.user') + db.passwd = config.get('environment', 'mysql.cloud.passwd') + zs.dbSvr = db + + '''Add some configuration''' + [zs.globalConfig.append(cfg) for cfg in getGlobalSettings(config)] + + ''''add loggers''' + testClientLogger = logger() + testClientLogger.name = 'TestClient' + testClientLogger.file = '/var/log/testclient.log' + + testCaseLogger = logger() + testCaseLogger.name = 'TestCase' + testCaseLogger.file = '/var/log/testcase.log' + + zs.logger.append(testClientLogger) + zs.logger.append(testCaseLogger) + return zs + + +if __name__ == '__main__': + parser = OptionParser() + parser.add_option('-i', '--input', action='store', default='setup.properties', \ + dest='input', help='file containing environment setup information') + parser.add_option('-o', '--output', action='store', default='./sandbox.cfg', \ + dest='output', help='path where environment json will be generated') + + + (opts, args) = parser.parse_args() + + cfg_parser = SafeConfigParser() + cfg_parser.read(opts.input) + + cfg = describeResources(cfg_parser) + generate_setup_config(cfg, opts.output) diff --git a/tools/marvin/build/lib/marvin/sandbox/testSetupSuccess.py b/tools/marvin/build/lib/marvin/sandbox/testSetupSuccess.py new file mode 100644 index 00000000000..8a0034cfa9b --- /dev/null +++ b/tools/marvin/build/lib/marvin/sandbox/testSetupSuccess.py @@ -0,0 +1,81 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 marvin +import unittest +from marvin.cloudstackTestCase import * +from marvin.cloudstackAPI import * +from time import sleep as delay + +class TestSetupSuccess(cloudstackTestCase): + """ + Test to verify if the cloudstack is ready to launch tests upon + 1. Verify that system VMs are up and running in all zones + 2. Verify that built-in templates are Ready in all zones + """ + @classmethod + def setUpClass(cls): + cls.apiClient = super(TestSetupSuccess, cls).getClsTestClient().getApiClient() + + zones = listZones.listZonesCmd() + cls.zones_list = cls.apiClient.listZones(zones) + cls.retry = 50 + + def test_systemVmReady(self): + """ + system VMs need to be ready and Running for each zone in cloudstack + """ + for z in self.zones_list: + retry = self.retry + while retry != 0: + self.debug("looking for system VMs in zone: %s, %s"%(z.id, z.name)) + sysvms = listSystemVms.listSystemVmsCmd() + sysvms.zoneid = z.id + sysvms.state = 'Running' + sysvms_list = self.apiClient.listSystemVms(sysvms) + if sysvms_list is not None and len(sysvms_list) == 2: + assert len(sysvms_list) == 2 + self.debug("found %d system VMs running {%s}"%(len(sysvms_list), sysvms_list)) + break + retry = retry - 1 + delay(60) #wait a minute for retry + self.assertNotEqual(retry, 0, "system VMs not Running in zone %s"%z.name) + + def test_templateBuiltInReady(self): + """ + built-in templates CentOS to be ready + """ + for z in self.zones_list: + retry = self.retry + while retry != 0: + self.debug("Looking for at least one ready builtin template") + templates = listTemplates.listTemplatesCmd() + templates.templatefilter = 'featured' + templates.listall = 'true' + templates_list = self.apiClient.listTemplates(templates) + if templates_list is not None: + builtins = [tmpl for tmpl in templates_list if tmpl.templatetype == 'BUILTIN' and tmpl.isready == True] + if len(builtins) > 0: + self.debug("Found %d builtins ready for use %s"%(len(builtins), builtins)) + break + retry = retry - 1 + delay(60) #wait a minute for retry + self.assertNotEqual(retry, 0, "builtIn templates not ready in zone %s"%z.name) + + @classmethod + def tearDownClass(cls): + pass diff --git a/tools/marvin/build/lib/marvin/settings.py b/tools/marvin/build/lib/marvin/settings.py new file mode 100644 index 00000000000..a31e182b3dc --- /dev/null +++ b/tools/marvin/build/lib/marvin/settings.py @@ -0,0 +1,28 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Settings for the XML test runner + +# Use this setting to choose between a verbose and a non-verbose output. +TEST_OUTPUT_VERBOSE = 2. + +# If your test methods contains docstrings, you can display such docstrings +# instead of display the test name (ex: module.TestCase.test_method). +# In order to use this feature, you have to enable verbose output by setting +# TEST_OUTPUT_VERBOSE = 2. + +TEST_OUTPUT_DESCRIPTIONS = True diff --git a/tools/marvin/build/lib/marvin/testSetupSuccess.py b/tools/marvin/build/lib/marvin/testSetupSuccess.py new file mode 100644 index 00000000000..1701626a820 --- /dev/null +++ b/tools/marvin/build/lib/marvin/testSetupSuccess.py @@ -0,0 +1,98 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT 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 marvin +import unittest +from marvin.cloudstackTestCase import * +from marvin.cloudstackAPI import * +from time import sleep as delay + + +class TestSetupSuccess(cloudstackTestCase): + """ + Test to verify if the cloudstack is ready to launch tests upon + 1. Verify that system VMs are up and running in all zones + 2. Verify that built-in templates are Ready in all zones + """ + @classmethod + def setUpClass(cls): + testClient = super(TestSetupSuccess, cls).getClsTestClient() + cls.apiClient = testClient.getApiClient() + + zones = listZones.listZonesCmd() + cls.zones_list = cls.apiClient.listZones(zones) + cls.retry = 2 + + def test_systemVmReady(self): + """ + system VMs need to be ready and Running for each zone in cloudstack + """ + for z in self.zones_list: + retry = self.retry + while retry != 0: + self.debug("looking for system VMs in zone: %s, %s" % + (z.id, z.name)) + sysvms = listSystemVms.listSystemVmsCmd() + sysvms.zoneid = z.id + sysvms.state = 'Running' + sysvms_list = self.apiClient.listSystemVms(sysvms) + if sysvms_list is not None and len(sysvms_list) == 2: + assert len(sysvms_list) == 2 + self.debug("found %d system VMs running {%s}" % + (len(sysvms_list), sysvms_list)) + break + retry = retry - 1 + delay(60) # wait a minute for retry + self.assertNotEqual(retry, 0, + "system VMs not Running in zone %s" % + z.name) + + def test_templateBuiltInReady(self): + """ + built-in templates CentOS to be ready + """ + for z in self.zones_list: + retry = self.retry + while retry != 0: + self.debug("Looking for at least one ready builtin template") + templates = listTemplates.listTemplatesCmd() + templates.templatefilter = 'featured' + templates.listall = 'true' + templates_list = self.apiClient.listTemplates(templates) + if templates_list is not None: + builtins = [tmpl + for tmpl in templates_list + if tmpl.templatetype == 'BUILTIN' + and tmpl.isready] + if len(builtins) > 0: + self.debug("Found %d builtins ready for use %s" % + (len(builtins), builtins)) + break + retry = retry - 1 + delay(60) # wait a minute for retry + self.assertNotEqual(retry, 0, + "builtIn templates not ready in zone %s" % + z.name) + + def test_deployVmWithBuiltIn(self): + """ + Deploys a VM with the built-in CentOS template + """ + + @classmethod + def tearDownClass(cls): + pass diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index 58a9bf9ae99..d2bfb8f6505 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -118,7 +118,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin @Name: is_server_ssh_ready @Input: timeout: tcp connection timeout flag, others information need to be added - @Output:object for remoteSSHClient + @Output:object for SshClient Name of the function is little misnomer and is not verifying anything as such mentioned ''' @@ -129,12 +129,12 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin port=port, user=username, passwd=password, - keyPairFileLocation=keyPairFileLocation, + keyPairFiles=keyPairFileLocation, retries=retries, delay=retryinterv, timeout=timeout) except Exception, e: - raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, e)) + raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, str(e))) else: return ssh diff --git a/tools/marvin/marvin/integration/lib/utils.py.rej b/tools/marvin/marvin/integration/lib/utils.py.rej new file mode 100644 index 00000000000..acae5287eae --- /dev/null +++ b/tools/marvin/marvin/integration/lib/utils.py.rej @@ -0,0 +1,10 @@ +diff a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py (rejected hunks) +@@ -118,7 +118,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin + @Name: is_server_ssh_ready + @Input: timeout: tcp connection timeout flag, + others information need to be added +- @Output:object for remoteSSHClient ++ @Output:object for SshClient + Name of the function is little misnomer and is not + verifying anything as such mentioned + ''' diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/sshClient.py similarity index 96% rename from tools/marvin/marvin/remoteSSHClient.py rename to tools/marvin/marvin/sshClient.py index c9720e39e40..58f2602107b 100644 --- a/tools/marvin/marvin/remoteSSHClient.py +++ b/tools/marvin/marvin/sshClient.py @@ -26,7 +26,7 @@ from marvin.codes import ( from contextlib import closing -class remoteSSHClient(object): +class SshClient(object): ''' Added timeout flag for ssh connect calls.Default to 3.0 seconds ''' @@ -92,9 +92,9 @@ class remoteSSHClient(object): while self.retryCnt >= 0: try: self.logger.debug("SSH Connection: Host:%s User:%s\ - Port:%s KeyPairFile: %s" % - (self.host, self.user, str(self.port), - str(self.keyPairFiles))) + Port:%s" % + (self.host, self.user, str(self.port) + )) if self.keyPairFiles is None: self.ssh.connect(hostname=self.host, port=self.port, @@ -177,6 +177,6 @@ class remoteSSHClient(object): if __name__ == "__main__": - with contextlib.closing(remoteSSHClient("10.223.75.10", 22, "root", + with contextlib.closing(SshClient("10.223.75.10", 22, "root", "password")) as ssh: print ssh.execute("ls -l") From 65b12f45b9b26c45a148dda191783508e6838363 Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Fri, 8 Nov 2013 16:05:30 +0530 Subject: [PATCH 093/108] Revert "CLOUSTACK-5099: Utils.py-has-wrong-reference, cleaned it. As well added Uniform naming convention" This reverts commit ec00a6fb74042259ceea6add676de3f15e642d4a. --- .../test_egress_rules_host_maintenance.py | 2 +- .../component/maint/test_high_availability.py | 2 +- .../maint/test_vpc_host_maintenance.py | 2 +- test/integration/component/test_accounts.py | 2 +- .../component/test_affinity_groups.py | 2 +- .../integration/component/test_asa1000v_fw.py | 2 +- test/integration/component/test_baremetal.py | 2 +- .../component/test_deploy_vm_userdata_reg.py | 2 +- .../component/test_egress_fw_rules.py | 4 +- .../component/test_egress_rules.py | 2 +- test/integration/component/test_eip_elb.py | 18 +- .../component/test_explicit_dedication.py | 2 +- test/integration/component/test_haproxy.py | 4 +- .../component/test_implicit_planner.py | 2 +- .../component/test_netscaler_configs.py | 16 +- .../component/test_netscaler_lb.py | 20 +- .../component/test_netscaler_lb_algo.py | 32 +- .../component/test_netscaler_lb_sticky.py | 20 +- .../component/test_netscaler_nw_off.py | 2 +- .../component/test_network_offering.py | 2 +- .../integration/component/test_portable_ip.py | 6 +- .../component/test_project_configs.py | 2 +- .../component/test_project_resources.py | 2 +- .../component/test_project_usage.py | 2 +- test/integration/component/test_projects.py | 2 +- .../component/test_security_groups.py | 6 +- .../component/test_snapshot_limits.py | 2 +- test/integration/component/test_stopped_vm.py | 2 +- .../component/test_storage_motion.py | 2 +- test/integration/component/test_templates.py | 2 +- test/integration/component/test_usage.py | 2 +- .../component/test_vm_passwdenabled.py | 2 +- .../integration/component/test_vpc_network.py | 2 +- .../component/test_vpc_offerings.py | 2 +- .../integration/component/test_vpc_routers.py | 2 +- .../component/test_vpc_vm_life_cycle.py | 2 +- .../component/test_vpc_vm_life_cycle.py.rej | 10 - .../component/test_vpc_vms_deployment.py | 2 +- .../integration/smoke/test_affinity_groups.py | 2 +- test/integration/smoke/test_loadbalance.py | 4 +- test/integration/smoke/test_network.py | 10 +- test/integration/smoke/test_nic.py | 2 +- test/integration/smoke/test_pvlan.py | 2 +- .../integration/smoke/test_resource_detail.py | 2 +- test/integration/smoke/test_routers.py | 2 +- test/integration/smoke/test_ssvm.py | 2 +- test/integration/smoke/test_templates.py | 2 +- test/integration/smoke/test_volumes.py | 2 +- .../build/lib/marvin/TestCaseExecuteEngine.py | 102 - tools/marvin/build/lib/marvin/__init__.py | 18 - tools/marvin/build/lib/marvin/asyncJobMgr.py | 261 -- .../lib/marvin/cloudstackAPI/__init__.py | 18 - .../marvin/cloudstackAPI/activateProject.py | 141 - .../cloudstackAPI/addAccountToProject.py | 40 - .../marvin/cloudstackAPI/addBaremetalDhcp.py | 54 - .../marvin/cloudstackAPI/addBaremetalHost.py | 147 - .../addBaremetalPxeKickStartServer.py | 51 - .../addBaremetalPxePingServer.py | 65 - .../cloudstackAPI/addBigSwitchVnsDevice.py | 45 - .../lib/marvin/cloudstackAPI/addCluster.py | 115 - .../build/lib/marvin/cloudstackAPI/addHost.py | 145 - .../lib/marvin/cloudstackAPI/addImageStore.py | 58 - .../lib/marvin/cloudstackAPI/addIpToNic.py | 44 - .../cloudstackAPI/addLdapConfiguration.py | 39 - .../marvin/cloudstackAPI/addNetworkDevice.py | 35 - .../addNetworkServiceProvider.py | 53 - .../cloudstackAPI/addNicToVirtualMachine.py | 374 -- .../cloudstackAPI/addNiciraNvpDevice.py | 60 - .../lib/marvin/cloudstackAPI/addRegion.py | 48 - .../marvin/cloudstackAPI/addResourceDetail.py | 42 - .../build/lib/marvin/cloudstackAPI/addS3.py | 66 - .../cloudstackAPI/addSecondaryStorage.py | 52 - .../lib/marvin/cloudstackAPI/addSwift.py | 56 - .../marvin/cloudstackAPI/addTrafficMonitor.py | 49 - .../marvin/cloudstackAPI/addTrafficType.py | 55 - .../lib/marvin/cloudstackAPI/addUcsManager.py | 51 - .../lib/marvin/cloudstackAPI/addVpnUser.py | 57 - .../lib/marvin/cloudstackAPI/archiveAlerts.py | 41 - .../lib/marvin/cloudstackAPI/archiveEvents.py | 41 - .../assignToGlobalLoadBalancerRule.py | 41 - .../cloudstackAPI/assignToLoadBalancerRule.py | 39 - .../cloudstackAPI/assignVirtualMachine.py | 379 -- .../cloudstackAPI/associateIpAddress.py | 130 - .../associateUcsProfileToBlade.py | 48 - .../lib/marvin/cloudstackAPI/attachIso.py | 372 -- .../lib/marvin/cloudstackAPI/attachVolume.py | 148 - .../authorizeSecurityGroupEgress.py | 71 - .../authorizeSecurityGroupIngress.py | 71 - .../build/lib/marvin/cloudstackAPI/baseCmd.py | 20 - .../lib/marvin/cloudstackAPI/baseResponse.py | 20 - .../cloudstackAPI/cancelHostMaintenance.py | 122 - .../cloudstackAPI/cancelStorageMaintenance.py | 78 - .../cloudstackAPI/changeServiceForRouter.py | 154 - .../cloudstackAPI/changeServiceForSystemVm.py | 89 - .../changeServiceForVirtualMachine.py | 372 -- .../cloudstackAPI/cleanVMReservations.py | 33 - .../cloudstackAPI/cloudstackAPIClient.py | 2513 ------------ .../configureInternalLoadBalancerElement.py | 41 - .../configureVirtualRouterElement.py | 51 - .../build/lib/marvin/cloudstackAPI/copyIso.py | 137 - .../lib/marvin/cloudstackAPI/copyTemplate.py | 137 - .../lib/marvin/cloudstackAPI/createAccount.py | 202 - .../cloudstackAPI/createAffinityGroup.py | 57 - .../cloudstackAPI/createAutoScalePolicy.py | 60 - .../cloudstackAPI/createAutoScaleVmGroup.py | 77 - .../cloudstackAPI/createAutoScaleVmProfile.py | 70 - .../marvin/cloudstackAPI/createCondition.py | 62 - .../lib/marvin/cloudstackAPI/createCounter.py | 48 - .../cloudstackAPI/createDiskOffering.py | 97 - .../lib/marvin/cloudstackAPI/createDomain.py | 54 - .../cloudstackAPI/createEgressFirewallRule.py | 94 - .../cloudstackAPI/createFirewallRule.py | 94 - .../createGlobalLoadBalancerRule.py | 161 - .../cloudstackAPI/createInstanceGroup.py | 54 - .../createInternalLoadBalancerElement.py | 38 - .../cloudstackAPI/createIpForwardingRule.py | 97 - .../createLBHealthCheckPolicy.py | 75 - .../cloudstackAPI/createLBStickinessPolicy.py | 75 - .../cloudstackAPI/createLoadBalancer.py | 127 - .../cloudstackAPI/createLoadBalancerRule.py | 116 - .../lib/marvin/cloudstackAPI/createNetwork.py | 251 -- .../marvin/cloudstackAPI/createNetworkACL.py | 101 - .../cloudstackAPI/createNetworkACLList.py | 45 - .../cloudstackAPI/createNetworkOffering.py | 167 - .../cloudstackAPI/createPhysicalNetwork.py | 67 - .../lib/marvin/cloudstackAPI/createPod.py | 91 - .../cloudstackAPI/createPortForwardingRule.py | 109 - .../cloudstackAPI/createPortableIpRange.py | 85 - .../cloudstackAPI/createPrivateGateway.py | 86 - .../lib/marvin/cloudstackAPI/createProject.py | 148 - .../cloudstackAPI/createRemoteAccessVpn.py | 62 - .../marvin/cloudstackAPI/createSSHKeyPair.py | 44 - .../createSecondaryStagingStore.py | 58 - .../cloudstackAPI/createSecurityGroup.py | 131 - .../cloudstackAPI/createServiceOffering.py | 151 - .../marvin/cloudstackAPI/createSnapshot.py | 97 - .../cloudstackAPI/createSnapshotPolicy.py | 56 - .../marvin/cloudstackAPI/createStaticRoute.py | 80 - .../createStorageNetworkIpRange.py | 63 - .../marvin/cloudstackAPI/createStoragePool.py | 104 - .../lib/marvin/cloudstackAPI/createTags.py | 44 - .../marvin/cloudstackAPI/createTemplate.py | 161 - .../lib/marvin/cloudstackAPI/createUser.py | 87 - .../marvin/cloudstackAPI/createVMSnapshot.py | 72 - .../lib/marvin/cloudstackAPI/createVPC.py | 413 -- .../marvin/cloudstackAPI/createVPCOffering.py | 109 - .../createVirtualRouterElement.py | 50 - .../marvin/cloudstackAPI/createVlanIpRange.py | 107 - .../lib/marvin/cloudstackAPI/createVolume.py | 163 - .../cloudstackAPI/createVpnConnection.py | 75 - .../cloudstackAPI/createVpnCustomerGateway.py | 90 - .../marvin/cloudstackAPI/createVpnGateway.py | 50 - .../lib/marvin/cloudstackAPI/createZone.py | 153 - .../marvin/cloudstackAPI/dedicateCluster.py | 49 - .../cloudstackAPI/dedicateGuestVlanRange.py | 61 - .../lib/marvin/cloudstackAPI/dedicateHost.py | 49 - .../lib/marvin/cloudstackAPI/dedicatePod.py | 49 - .../cloudstackAPI/dedicatePublicIpRange.py | 84 - .../lib/marvin/cloudstackAPI/dedicateZone.py | 49 - .../lib/marvin/cloudstackAPI/deleteAccount.py | 36 - .../cloudstackAPI/deleteAccountFromProject.py | 39 - .../cloudstackAPI/deleteAffinityGroup.py | 41 - .../lib/marvin/cloudstackAPI/deleteAlerts.py | 41 - .../cloudstackAPI/deleteAutoScalePolicy.py | 36 - .../cloudstackAPI/deleteAutoScaleVmGroup.py | 36 - .../cloudstackAPI/deleteAutoScaleVmProfile.py | 36 - .../cloudstackAPI/deleteBigSwitchVnsDevice.py | 36 - .../lib/marvin/cloudstackAPI/deleteCluster.py | 36 - .../marvin/cloudstackAPI/deleteCondition.py | 36 - .../lib/marvin/cloudstackAPI/deleteCounter.py | 36 - .../cloudstackAPI/deleteDiskOffering.py | 36 - .../lib/marvin/cloudstackAPI/deleteDomain.py | 38 - .../cloudstackAPI/deleteEgressFirewallRule.py | 36 - .../lib/marvin/cloudstackAPI/deleteEvents.py | 41 - .../cloudstackAPI/deleteFirewallRule.py | 36 - .../deleteGlobalLoadBalancerRule.py | 36 - .../lib/marvin/cloudstackAPI/deleteHost.py | 40 - .../marvin/cloudstackAPI/deleteImageStore.py | 36 - .../cloudstackAPI/deleteInstanceGroup.py | 36 - .../cloudstackAPI/deleteIpForwardingRule.py | 36 - .../lib/marvin/cloudstackAPI/deleteIso.py | 38 - .../deleteLBHealthCheckPolicy.py | 36 - .../cloudstackAPI/deleteLBStickinessPolicy.py | 36 - .../cloudstackAPI/deleteLdapConfiguration.py | 36 - .../cloudstackAPI/deleteLoadBalancer.py | 36 - .../cloudstackAPI/deleteLoadBalancerRule.py | 36 - .../lib/marvin/cloudstackAPI/deleteNetwork.py | 36 - .../marvin/cloudstackAPI/deleteNetworkACL.py | 36 - .../cloudstackAPI/deleteNetworkACLList.py | 36 - .../cloudstackAPI/deleteNetworkDevice.py | 36 - .../cloudstackAPI/deleteNetworkOffering.py | 36 - .../deleteNetworkServiceProvider.py | 36 - .../cloudstackAPI/deleteNiciraNvpDevice.py | 36 - .../cloudstackAPI/deletePhysicalNetwork.py | 36 - .../lib/marvin/cloudstackAPI/deletePod.py | 36 - .../cloudstackAPI/deletePortForwardingRule.py | 36 - .../cloudstackAPI/deletePortableIpRange.py | 36 - .../cloudstackAPI/deletePrivateGateway.py | 36 - .../lib/marvin/cloudstackAPI/deleteProject.py | 36 - .../cloudstackAPI/deleteProjectInvitation.py | 36 - .../cloudstackAPI/deleteRemoteAccessVpn.py | 36 - .../marvin/cloudstackAPI/deleteSSHKeyPair.py | 42 - .../deleteSecondaryStagingStore.py | 36 - .../cloudstackAPI/deleteSecurityGroup.py | 43 - .../cloudstackAPI/deleteServiceOffering.py | 36 - .../marvin/cloudstackAPI/deleteSnapshot.py | 36 - .../cloudstackAPI/deleteSnapshotPolicies.py | 37 - .../marvin/cloudstackAPI/deleteStaticRoute.py | 36 - .../deleteStorageNetworkIpRange.py | 36 - .../marvin/cloudstackAPI/deleteStoragePool.py | 38 - .../lib/marvin/cloudstackAPI/deleteTags.py | 41 - .../marvin/cloudstackAPI/deleteTemplate.py | 38 - .../cloudstackAPI/deleteTrafficMonitor.py | 36 - .../marvin/cloudstackAPI/deleteTrafficType.py | 36 - .../lib/marvin/cloudstackAPI/deleteUser.py | 36 - .../marvin/cloudstackAPI/deleteVMSnapshot.py | 36 - .../lib/marvin/cloudstackAPI/deleteVPC.py | 36 - .../marvin/cloudstackAPI/deleteVPCOffering.py | 36 - .../marvin/cloudstackAPI/deleteVlanIpRange.py | 36 - .../lib/marvin/cloudstackAPI/deleteVolume.py | 36 - .../cloudstackAPI/deleteVpnConnection.py | 36 - .../cloudstackAPI/deleteVpnCustomerGateway.py | 36 - .../marvin/cloudstackAPI/deleteVpnGateway.py | 36 - .../lib/marvin/cloudstackAPI/deleteZone.py | 36 - .../cloudstackAPI/deployVirtualMachine.py | 421 -- .../lib/marvin/cloudstackAPI/destroyRouter.py | 151 - .../marvin/cloudstackAPI/destroySystemVm.py | 86 - .../cloudstackAPI/destroyVirtualMachine.py | 369 -- .../lib/marvin/cloudstackAPI/detachIso.py | 369 -- .../lib/marvin/cloudstackAPI/detachVolume.py | 146 - .../marvin/cloudstackAPI/disableAccount.py | 179 - .../cloudstackAPI/disableAutoScaleVmGroup.py | 60 - .../marvin/cloudstackAPI/disableStaticNat.py | 36 - .../lib/marvin/cloudstackAPI/disableUser.py | 66 - .../cloudstackAPI/disassociateIpAddress.py | 36 - .../lib/marvin/cloudstackAPI/enableAccount.py | 176 - .../cloudstackAPI/enableAutoScaleVmGroup.py | 60 - .../marvin/cloudstackAPI/enableStaticNat.py | 43 - .../cloudstackAPI/enableStorageMaintenance.py | 78 - .../lib/marvin/cloudstackAPI/enableUser.py | 66 - .../lib/marvin/cloudstackAPI/extractIso.py | 65 - .../marvin/cloudstackAPI/extractTemplate.py | 65 - .../lib/marvin/cloudstackAPI/extractVolume.py | 66 - .../cloudstackAPI/findHostsForMigration.py | 126 - .../findStoragePoolsForMigration.py | 84 - .../cloudstackAPI/generateUsageRecords.py | 41 - .../lib/marvin/cloudstackAPI/getApiLimit.py | 39 - .../cloudstackAPI/getCloudIdentifier.py | 38 - .../build/lib/marvin/cloudstackAPI/getUser.py | 66 - .../lib/marvin/cloudstackAPI/getVMPassword.py | 34 - .../marvin/cloudstackAPI/ldapCreateAccount.py | 190 - .../lib/marvin/cloudstackAPI/listAccounts.py | 192 - .../cloudstackAPI/listAffinityGroupTypes.py | 37 - .../cloudstackAPI/listAffinityGroups.py | 67 - .../lib/marvin/cloudstackAPI/listAlerts.py | 47 - .../lib/marvin/cloudstackAPI/listApis.py | 75 - .../lib/marvin/cloudstackAPI/listAsyncJobs.py | 69 - .../cloudstackAPI/listAutoScalePolicies.py | 71 - .../cloudstackAPI/listAutoScaleVmGroups.py | 83 - .../cloudstackAPI/listAutoScaleVmProfiles.py | 75 - .../marvin/cloudstackAPI/listBaremetalDhcp.py | 49 - .../cloudstackAPI/listBaremetalPxeServers.py | 45 - .../cloudstackAPI/listBigSwitchVnsDevices.py | 49 - .../marvin/cloudstackAPI/listCapabilities.py | 49 - .../lib/marvin/cloudstackAPI/listCapacity.py | 67 - .../lib/marvin/cloudstackAPI/listClusters.py | 102 - .../marvin/cloudstackAPI/listConditions.py | 69 - .../cloudstackAPI/listConfigurations.py | 59 - .../lib/marvin/cloudstackAPI/listCounters.py | 51 - .../cloudstackAPI/listDedicatedClusters.py | 55 - .../listDedicatedGuestVlanRanges.py | 67 - .../cloudstackAPI/listDedicatedHosts.py | 55 - .../marvin/cloudstackAPI/listDedicatedPods.py | 55 - .../cloudstackAPI/listDedicatedZones.py | 55 - .../cloudstackAPI/listDeploymentPlanners.py | 37 - .../marvin/cloudstackAPI/listDiskOfferings.py | 77 - .../cloudstackAPI/listDomainChildren.py | 59 - .../lib/marvin/cloudstackAPI/listDomains.py | 59 - .../cloudstackAPI/listEgressFirewallRules.py | 102 - .../marvin/cloudstackAPI/listEventTypes.py | 31 - .../lib/marvin/cloudstackAPI/listEvents.py | 85 - .../marvin/cloudstackAPI/listFirewallRules.py | 98 - .../listGlobalLoadBalancerRules.py | 161 - .../lib/marvin/cloudstackAPI/listHosts.py | 147 - .../listHypervisorCapabilities.py | 55 - .../marvin/cloudstackAPI/listHypervisors.py | 33 - .../marvin/cloudstackAPI/listImageStores.py | 63 - .../cloudstackAPI/listInstanceGroups.py | 65 - .../listInternalLoadBalancerElements.py | 47 - .../listInternalLoadBalancerVMs.py | 182 - .../cloudstackAPI/listIpForwardingRules.py | 104 - .../cloudstackAPI/listIsoPermissions.py | 42 - .../lib/marvin/cloudstackAPI/listIsos.py | 162 - .../listLBHealthCheckPolicies.py | 69 - .../cloudstackAPI/listLBStickinessPolicies.py | 71 - .../cloudstackAPI/listLdapConfigurations.py | 43 - .../lib/marvin/cloudstackAPI/listLdapUsers.py | 47 - .../listLoadBalancerRuleInstances.py | 377 -- .../cloudstackAPI/listLoadBalancerRules.py | 118 - .../marvin/cloudstackAPI/listLoadBalancers.py | 132 - .../cloudstackAPI/listNetworkACLLists.py | 51 - .../marvin/cloudstackAPI/listNetworkACLs.py | 108 - .../marvin/cloudstackAPI/listNetworkDevice.py | 41 - .../listNetworkIsolationMethods.py | 37 - .../cloudstackAPI/listNetworkOfferings.py | 166 - .../listNetworkServiceProviders.py | 55 - .../lib/marvin/cloudstackAPI/listNetworks.py | 243 -- .../listNiciraNvpDeviceNetworks.py | 208 - .../cloudstackAPI/listNiciraNvpDevices.py | 53 - .../lib/marvin/cloudstackAPI/listNics.py | 72 - .../marvin/cloudstackAPI/listOsCategories.py | 43 - .../lib/marvin/cloudstackAPI/listOsTypes.py | 47 - .../cloudstackAPI/listPhysicalNetworks.py | 61 - .../lib/marvin/cloudstackAPI/listPods.py | 88 - .../cloudstackAPI/listPortForwardingRules.py | 104 - .../cloudstackAPI/listPortableIpRanges.py | 78 - .../cloudstackAPI/listPrivateGateways.py | 89 - .../cloudstackAPI/listProjectAccounts.py | 151 - .../cloudstackAPI/listProjectInvitations.py | 67 - .../lib/marvin/cloudstackAPI/listProjects.py | 162 - .../cloudstackAPI/listPublicIpAddresses.py | 156 - .../lib/marvin/cloudstackAPI/listRegions.py | 49 - .../cloudstackAPI/listRemoteAccessVpns.py | 70 - .../cloudstackAPI/listResourceDetails.py | 71 - .../cloudstackAPI/listResourceLimits.py | 63 - .../lib/marvin/cloudstackAPI/listRouters.py | 182 - .../build/lib/marvin/cloudstackAPI/listS3s.py | 53 - .../marvin/cloudstackAPI/listSSHKeyPairs.py | 55 - .../listSecondaryStagingStores.py | 63 - .../cloudstackAPI/listSecurityGroups.py | 144 - .../cloudstackAPI/listServiceOfferings.py | 124 - .../cloudstackAPI/listSnapshotPolicies.py | 50 - .../lib/marvin/cloudstackAPI/listSnapshots.py | 118 - .../marvin/cloudstackAPI/listStaticRoutes.py | 98 - .../listStorageNetworkIpRange.py | 59 - .../marvin/cloudstackAPI/listStoragePools.py | 97 - .../cloudstackAPI/listStorageProviders.py | 42 - .../listSupportedNetworkServices.py | 71 - .../lib/marvin/cloudstackAPI/listSwifts.py | 55 - .../lib/marvin/cloudstackAPI/listSystemVms.py | 105 - .../lib/marvin/cloudstackAPI/listTags.py | 75 - .../cloudstackAPI/listTemplatePermissions.py | 42 - .../lib/marvin/cloudstackAPI/listTemplates.py | 157 - .../cloudstackAPI/listTrafficMonitors.py | 48 - .../listTrafficTypeImplementors.py | 41 - .../marvin/cloudstackAPI/listTrafficTypes.py | 52 - .../lib/marvin/cloudstackAPI/listUcsBlades.py | 48 - .../marvin/cloudstackAPI/listUcsManagers.py | 47 - .../marvin/cloudstackAPI/listUcsProfiles.py | 40 - .../marvin/cloudstackAPI/listUsageRecords.py | 101 - .../marvin/cloudstackAPI/listUsageTypes.py | 33 - .../lib/marvin/cloudstackAPI/listUsers.py | 85 - .../marvin/cloudstackAPI/listVMSnapshot.py | 89 - .../marvin/cloudstackAPI/listVPCOfferings.py | 116 - .../lib/marvin/cloudstackAPI/listVPCs.py | 426 -- .../cloudstackAPI/listVirtualMachines.py | 416 -- .../listVirtualRouterElements.py | 57 - .../marvin/cloudstackAPI/listVlanIpRanges.py | 99 - .../lib/marvin/cloudstackAPI/listVolumes.py | 172 - .../cloudstackAPI/listVpnConnections.py | 89 - .../cloudstackAPI/listVpnCustomerGateways.py | 81 - .../marvin/cloudstackAPI/listVpnGateways.py | 67 - .../lib/marvin/cloudstackAPI/listVpnUsers.py | 65 - .../lib/marvin/cloudstackAPI/listZones.py | 141 - .../lib/marvin/cloudstackAPI/lockAccount.py | 176 - .../lib/marvin/cloudstackAPI/lockUser.py | 66 - .../build/lib/marvin/cloudstackAPI/login.py | 63 - .../build/lib/marvin/cloudstackAPI/logout.py | 31 - .../markDefaultZoneForAccount.py | 179 - .../marvin/cloudstackAPI/migrateSystemVm.py | 89 - .../cloudstackAPI/migrateVirtualMachine.py | 373 -- .../migrateVirtualMachineWithVolume.py | 374 -- .../lib/marvin/cloudstackAPI/migrateVolume.py | 148 - .../prepareHostForMaintenance.py | 122 - .../marvin/cloudstackAPI/prepareTemplate.py | 134 - .../cloudstackAPI/queryAsyncJobResult.py | 56 - .../lib/marvin/cloudstackAPI/rebootRouter.py | 151 - .../marvin/cloudstackAPI/rebootSystemVm.py | 86 - .../cloudstackAPI/rebootVirtualMachine.py | 369 -- .../lib/marvin/cloudstackAPI/reconnectHost.py | 122 - .../cloudstackAPI/recoverVirtualMachine.py | 369 -- .../lib/marvin/cloudstackAPI/registerIso.py | 162 - .../cloudstackAPI/registerSSHKeyPair.py | 47 - .../marvin/cloudstackAPI/registerTemplate.py | 179 - .../marvin/cloudstackAPI/registerUserKeys.py | 36 - .../cloudstackAPI/releaseDedicatedCluster.py | 36 - .../releaseDedicatedGuestVlanRange.py | 36 - .../cloudstackAPI/releaseDedicatedHost.py | 36 - .../cloudstackAPI/releaseDedicatedPod.py | 36 - .../cloudstackAPI/releaseDedicatedZone.py | 36 - .../cloudstackAPI/releaseHostReservation.py | 36 - .../cloudstackAPI/releasePublicIpRange.py | 36 - .../removeFromGlobalLoadBalancerRule.py | 39 - .../removeFromLoadBalancerRule.py | 39 - .../marvin/cloudstackAPI/removeIpFromNic.py | 36 - .../removeNicFromVirtualMachine.py | 372 -- .../lib/marvin/cloudstackAPI/removeRegion.py | 36 - .../cloudstackAPI/removeResourceDetail.py | 41 - .../lib/marvin/cloudstackAPI/removeVpnUser.py | 42 - .../cloudstackAPI/replaceNetworkACLList.py | 40 - .../lib/marvin/cloudstackAPI/resetApiLimit.py | 41 - .../resetPasswordForVirtualMachine.py | 369 -- .../resetSSHKeyForVirtualMachine.py | 378 -- .../cloudstackAPI/resetVpnConnection.py | 76 - .../lib/marvin/cloudstackAPI/resizeVolume.py | 148 - .../marvin/cloudstackAPI/restartNetwork.py | 119 - .../lib/marvin/cloudstackAPI/restartVPC.py | 393 -- .../cloudstackAPI/restoreVirtualMachine.py | 371 -- .../marvin/cloudstackAPI/revertSnapshot.py | 91 - .../cloudstackAPI/revertToVMSnapshot.py | 369 -- .../revokeSecurityGroupEgress.py | 36 - .../revokeSecurityGroupIngress.py | 36 - .../lib/marvin/cloudstackAPI/scaleSystemVm.py | 89 - .../cloudstackAPI/scaleVirtualMachine.py | 39 - .../startInternalLoadBalancerVM.py | 151 - .../lib/marvin/cloudstackAPI/startRouter.py | 151 - .../lib/marvin/cloudstackAPI/startSystemVm.py | 86 - .../cloudstackAPI/startVirtualMachine.py | 371 -- .../stopInternalLoadBalancerVM.py | 153 - .../lib/marvin/cloudstackAPI/stopRouter.py | 153 - .../lib/marvin/cloudstackAPI/stopSystemVm.py | 88 - .../cloudstackAPI/stopVirtualMachine.py | 371 -- .../marvin/cloudstackAPI/suspendProject.py | 141 - .../lib/marvin/cloudstackAPI/updateAccount.py | 183 - .../cloudstackAPI/updateAutoScalePolicy.py | 58 - .../cloudstackAPI/updateAutoScaleVmGroup.py | 70 - .../cloudstackAPI/updateAutoScaleVmProfile.py | 64 - .../lib/marvin/cloudstackAPI/updateCluster.py | 91 - .../cloudstackAPI/updateConfiguration.py | 54 - .../updateDefaultNicForVirtualMachine.py | 372 -- .../cloudstackAPI/updateDiskOffering.py | 76 - .../lib/marvin/cloudstackAPI/updateDomain.py | 52 - .../updateGlobalLoadBalancerRule.py | 148 - .../lib/marvin/cloudstackAPI/updateHost.py | 130 - .../cloudstackAPI/updateHostPassword.py | 43 - .../updateHypervisorCapabilities.py | 51 - .../cloudstackAPI/updateInstanceGroup.py | 50 - .../lib/marvin/cloudstackAPI/updateIso.py | 149 - .../cloudstackAPI/updateIsoPermissions.py | 48 - .../cloudstackAPI/updateLoadBalancerRule.py | 97 - .../lib/marvin/cloudstackAPI/updateNetwork.py | 216 - .../cloudstackAPI/updateNetworkACLItem.py | 99 - .../cloudstackAPI/updateNetworkOffering.py | 140 - .../updateNetworkServiceProvider.py | 50 - .../cloudstackAPI/updatePhysicalNetwork.py | 60 - .../lib/marvin/cloudstackAPI/updatePod.py | 87 - .../cloudstackAPI/updatePortForwardingRule.py | 98 - .../lib/marvin/cloudstackAPI/updateProject.py | 145 - .../cloudstackAPI/updateProjectInvitation.py | 42 - .../lib/marvin/cloudstackAPI/updateRegion.py | 46 - .../cloudstackAPI/updateResourceCount.py | 52 - .../cloudstackAPI/updateResourceLimit.py | 54 - .../cloudstackAPI/updateServiceOffering.py | 113 - .../updateStorageNetworkIpRange.py | 58 - .../marvin/cloudstackAPI/updateStoragePool.py | 84 - .../marvin/cloudstackAPI/updateTemplate.py | 149 - .../updateTemplatePermissions.py | 48 - .../marvin/cloudstackAPI/updateTrafficType.py | 50 - .../lib/marvin/cloudstackAPI/updateUser.py | 82 - .../cloudstackAPI/updateVMAffinityGroup.py | 373 -- .../lib/marvin/cloudstackAPI/updateVPC.py | 398 -- .../marvin/cloudstackAPI/updateVPCOffering.py | 107 - .../cloudstackAPI/updateVirtualMachine.py | 383 -- .../lib/marvin/cloudstackAPI/updateVolume.py | 150 - .../cloudstackAPI/updateVpnCustomerGateway.py | 93 - .../lib/marvin/cloudstackAPI/updateZone.py | 154 - .../cloudstackAPI/uploadCustomCertificate.py | 43 - .../lib/marvin/cloudstackAPI/uploadVolume.py | 162 - .../build/lib/marvin/cloudstackConnection.py | 235 -- .../build/lib/marvin/cloudstackException.py | 48 - .../build/lib/marvin/cloudstackTestCase.py | 40 - .../build/lib/marvin/cloudstackTestClient.py | 201 - .../marvin/build/lib/marvin/codegenerator.py | 463 --- .../build/lib/marvin/configGenerator.py | 870 ---- tools/marvin/build/lib/marvin/dbConnection.py | 86 - tools/marvin/build/lib/marvin/deployAndRun.py | 96 - .../build/lib/marvin/deployDataCenter.py | 625 --- .../build/lib/marvin/integration/__init__.py | 18 - .../lib/marvin/integration/lib/__init__.py | 16 - .../build/lib/marvin/integration/lib/base.py | 3593 ----------------- .../lib/marvin/integration/lib/common.py | 739 ---- .../build/lib/marvin/integration/lib/utils.py | 320 -- tools/marvin/build/lib/marvin/jsonHelper.py | 381 -- tools/marvin/build/lib/marvin/marvinPlugin.py | 144 - .../build/lib/marvin/remoteSSHClient.py | 108 - .../build/lib/marvin/sandbox/__init__.py | 18 - .../lib/marvin/sandbox/advanced/__init__.py | 18 - .../marvin/sandbox/advanced/advanced_env.py | 167 - .../lib/marvin/sandbox/advancedsg/__init__.py | 18 - .../sandbox/advancedsg/advancedsg_env.py | 151 - .../lib/marvin/sandbox/basic/__init__.py | 18 - .../lib/marvin/sandbox/basic/basic_env.py | 149 - .../lib/marvin/sandbox/testSetupSuccess.py | 81 - tools/marvin/build/lib/marvin/settings.py | 28 - .../build/lib/marvin/testSetupSuccess.py | 98 - tools/marvin/marvin/integration/lib/utils.py | 6 +- .../marvin/integration/lib/utils.py.rej | 10 - .../{sshClient.py => remoteSSHClient.py} | 10 +- 498 files changed, 114 insertions(+), 51432 deletions(-) delete mode 100644 test/integration/component/test_vpc_vm_life_cycle.py.rej delete mode 100644 tools/marvin/build/lib/marvin/TestCaseExecuteEngine.py delete mode 100644 tools/marvin/build/lib/marvin/__init__.py delete mode 100644 tools/marvin/build/lib/marvin/asyncJobMgr.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/__init__.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/activateProject.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addAccountToProject.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalDhcp.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalHost.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxeKickStartServer.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxePingServer.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addBigSwitchVnsDevice.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addCluster.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addHost.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addImageStore.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addIpToNic.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addLdapConfiguration.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkDevice.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkServiceProvider.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addNicToVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addNiciraNvpDevice.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addRegion.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addResourceDetail.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addS3.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addSecondaryStorage.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addSwift.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficMonitor.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficType.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addUcsManager.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/addVpnUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/archiveAlerts.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/archiveEvents.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/assignToGlobalLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/assignToLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/assignVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/associateIpAddress.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/associateUcsProfileToBlade.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/attachIso.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/attachVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupEgress.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupIngress.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/baseCmd.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/baseResponse.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/cancelHostMaintenance.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/cancelStorageMaintenance.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForRouter.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForSystemVm.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/cleanVMReservations.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/cloudstackAPIClient.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/configureInternalLoadBalancerElement.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/configureVirtualRouterElement.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/copyIso.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/copyTemplate.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAccount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAffinityGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScalePolicy.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmProfile.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createCondition.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createCounter.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createDiskOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createDomain.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createEgressFirewallRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createFirewallRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createGlobalLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createInstanceGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createInternalLoadBalancerElement.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createIpForwardingRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createLBHealthCheckPolicy.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createLBStickinessPolicy.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancer.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createNetwork.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACL.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACLList.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPhysicalNetwork.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPod.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPortForwardingRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPortableIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createPrivateGateway.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createProject.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createRemoteAccessVpn.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSSHKeyPair.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSecondaryStagingStore.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSecurityGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createServiceOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshot.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshotPolicy.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createStaticRoute.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createStorageNetworkIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createStoragePool.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createTags.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createTemplate.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVMSnapshot.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVPC.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVPCOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVirtualRouterElement.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVlanIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVpnConnection.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVpnCustomerGateway.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createVpnGateway.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/createZone.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicateCluster.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicateGuestVlanRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicateHost.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePod.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePublicIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/dedicateZone.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccountFromProject.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAffinityGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAlerts.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScalePolicy.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmProfile.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteBigSwitchVnsDevice.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteCluster.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteCondition.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteCounter.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteDiskOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteDomain.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteEgressFirewallRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteEvents.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteFirewallRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteHost.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteImageStore.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteInstanceGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteIpForwardingRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteIso.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBHealthCheckPolicy.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBStickinessPolicy.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLdapConfiguration.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancer.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetwork.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACL.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACLList.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkDevice.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkServiceProvider.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteNiciraNvpDevice.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePhysicalNetwork.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePod.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePortForwardingRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePortableIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deletePrivateGateway.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteProject.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteProjectInvitation.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteRemoteAccessVpn.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSSHKeyPair.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecondaryStagingStore.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecurityGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteServiceOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshot.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshotPolicies.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteStaticRoute.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteStorageNetworkIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteStoragePool.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteTags.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteTemplate.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficMonitor.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficType.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVMSnapshot.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPC.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPCOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVlanIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnConnection.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnCustomerGateway.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnGateway.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deleteZone.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/deployVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/destroyRouter.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/destroySystemVm.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/destroyVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/detachIso.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/detachVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disableAccount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disableAutoScaleVmGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disableStaticNat.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disableUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/disassociateIpAddress.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableAccount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableAutoScaleVmGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableStaticNat.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableStorageMaintenance.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/enableUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/extractIso.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/extractTemplate.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/extractVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/findHostsForMigration.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/findStoragePoolsForMigration.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/generateUsageRecords.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/getApiLimit.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/getCloudIdentifier.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/getUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/getVMPassword.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/ldapCreateAccount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAccounts.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroupTypes.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroups.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAlerts.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listApis.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAsyncJobs.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScalePolicies.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmGroups.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmProfiles.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalDhcp.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalPxeServers.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listBigSwitchVnsDevices.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listCapabilities.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listCapacity.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listClusters.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listConditions.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listConfigurations.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listCounters.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedClusters.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedGuestVlanRanges.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedHosts.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedPods.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedZones.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDeploymentPlanners.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDiskOfferings.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDomainChildren.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listDomains.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listEgressFirewallRules.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listEventTypes.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listEvents.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listFirewallRules.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listGlobalLoadBalancerRules.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listHosts.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisorCapabilities.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisors.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listImageStores.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listInstanceGroups.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerElements.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerVMs.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listIpForwardingRules.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listIsoPermissions.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listIsos.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLBHealthCheckPolicies.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLBStickinessPolicies.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLdapConfigurations.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLdapUsers.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRuleInstances.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRules.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancers.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLLists.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLs.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkDevice.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkIsolationMethods.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkOfferings.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkServiceProviders.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNetworks.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDeviceNetworks.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDevices.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listNics.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listOsCategories.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listOsTypes.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPhysicalNetworks.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPods.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPortForwardingRules.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPortableIpRanges.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPrivateGateways.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listProjectAccounts.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listProjectInvitations.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listProjects.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listPublicIpAddresses.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listRegions.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listRemoteAccessVpns.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listResourceDetails.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listResourceLimits.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listRouters.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listS3s.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSSHKeyPairs.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSecondaryStagingStores.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSecurityGroups.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listServiceOfferings.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshotPolicies.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshots.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listStaticRoutes.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listStorageNetworkIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listStoragePools.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listStorageProviders.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSupportedNetworkServices.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSwifts.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listSystemVms.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTags.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTemplatePermissions.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTemplates.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficMonitors.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypeImplementors.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypes.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUcsBlades.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUcsManagers.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUcsProfiles.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUsageRecords.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUsageTypes.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listUsers.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVMSnapshot.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVPCOfferings.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVPCs.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualMachines.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualRouterElements.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVlanIpRanges.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVolumes.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVpnConnections.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVpnCustomerGateways.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVpnGateways.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listVpnUsers.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/listZones.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/lockAccount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/lockUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/login.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/logout.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/markDefaultZoneForAccount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/migrateSystemVm.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachineWithVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/migrateVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/prepareHostForMaintenance.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/prepareTemplate.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/queryAsyncJobResult.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/rebootRouter.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/rebootSystemVm.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/rebootVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/reconnectHost.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/recoverVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/registerIso.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/registerSSHKeyPair.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/registerTemplate.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/registerUserKeys.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedCluster.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedGuestVlanRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedHost.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedPod.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedZone.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releaseHostReservation.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/releasePublicIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeFromGlobalLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeFromLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeIpFromNic.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeNicFromVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeRegion.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeResourceDetail.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/removeVpnUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/replaceNetworkACLList.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resetApiLimit.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resetPasswordForVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resetSSHKeyForVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resetVpnConnection.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/resizeVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/restartNetwork.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/restartVPC.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/restoreVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/revertSnapshot.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/revertToVMSnapshot.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupEgress.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupIngress.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/scaleSystemVm.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/scaleVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/startInternalLoadBalancerVM.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/startRouter.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/startSystemVm.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/startVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/stopInternalLoadBalancerVM.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/stopRouter.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/stopSystemVm.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/stopVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/suspendProject.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateAccount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScalePolicy.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmProfile.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateCluster.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateConfiguration.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateDefaultNicForVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateDiskOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateDomain.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateGlobalLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateHost.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateHostPassword.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateHypervisorCapabilities.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateInstanceGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateIso.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateIsoPermissions.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateLoadBalancerRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateNetwork.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkACLItem.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkServiceProvider.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updatePhysicalNetwork.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updatePod.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updatePortForwardingRule.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateProject.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateProjectInvitation.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateRegion.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceCount.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceLimit.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateServiceOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateStorageNetworkIpRange.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateStoragePool.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplate.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplatePermissions.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateTrafficType.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateUser.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVMAffinityGroup.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVPC.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVPCOffering.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVirtualMachine.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateVpnCustomerGateway.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/updateZone.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/uploadCustomCertificate.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackAPI/uploadVolume.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackConnection.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackException.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackTestCase.py delete mode 100644 tools/marvin/build/lib/marvin/cloudstackTestClient.py delete mode 100644 tools/marvin/build/lib/marvin/codegenerator.py delete mode 100644 tools/marvin/build/lib/marvin/configGenerator.py delete mode 100644 tools/marvin/build/lib/marvin/dbConnection.py delete mode 100644 tools/marvin/build/lib/marvin/deployAndRun.py delete mode 100644 tools/marvin/build/lib/marvin/deployDataCenter.py delete mode 100644 tools/marvin/build/lib/marvin/integration/__init__.py delete mode 100644 tools/marvin/build/lib/marvin/integration/lib/__init__.py delete mode 100644 tools/marvin/build/lib/marvin/integration/lib/base.py delete mode 100644 tools/marvin/build/lib/marvin/integration/lib/common.py delete mode 100644 tools/marvin/build/lib/marvin/integration/lib/utils.py delete mode 100644 tools/marvin/build/lib/marvin/jsonHelper.py delete mode 100644 tools/marvin/build/lib/marvin/marvinPlugin.py delete mode 100644 tools/marvin/build/lib/marvin/remoteSSHClient.py delete mode 100644 tools/marvin/build/lib/marvin/sandbox/__init__.py delete mode 100644 tools/marvin/build/lib/marvin/sandbox/advanced/__init__.py delete mode 100644 tools/marvin/build/lib/marvin/sandbox/advanced/advanced_env.py delete mode 100644 tools/marvin/build/lib/marvin/sandbox/advancedsg/__init__.py delete mode 100644 tools/marvin/build/lib/marvin/sandbox/advancedsg/advancedsg_env.py delete mode 100644 tools/marvin/build/lib/marvin/sandbox/basic/__init__.py delete mode 100644 tools/marvin/build/lib/marvin/sandbox/basic/basic_env.py delete mode 100644 tools/marvin/build/lib/marvin/sandbox/testSetupSuccess.py delete mode 100644 tools/marvin/build/lib/marvin/settings.py delete mode 100644 tools/marvin/build/lib/marvin/testSetupSuccess.py delete mode 100644 tools/marvin/marvin/integration/lib/utils.py.rej rename tools/marvin/marvin/{sshClient.py => remoteSSHClient.py} (96%) diff --git a/test/integration/component/maint/test_egress_rules_host_maintenance.py b/test/integration/component/maint/test_egress_rules_host_maintenance.py index 2b817879c4b..6f0f768d37c 100644 --- a/test/integration/component/maint/test_egress_rules_host_maintenance.py +++ b/test/integration/component/maint/test_egress_rules_host_maintenance.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/maint/test_high_availability.py b/test/integration/component/maint/test_high_availability.py index 6ada659cd4f..7b0f78e2446 100644 --- a/test/integration/component/maint/test_high_availability.py +++ b/test/integration/component/maint/test_high_availability.py @@ -26,7 +26,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient import datetime diff --git a/test/integration/component/maint/test_vpc_host_maintenance.py b/test/integration/component/maint/test_vpc_host_maintenance.py index 57dfb4be8d0..0946cebdb7e 100644 --- a/test/integration/component/maint/test_vpc_host_maintenance.py +++ b/test/integration/component/maint/test_vpc_host_maintenance.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index 650a595936e..4c73c3acc84 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -22,7 +22,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from nose.plugins.attrib import attr from marvin.cloudstackException import cloudstackAPIException diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py index 7e4fabe5475..ae53e399df9 100644 --- a/test/integration/component/test_affinity_groups.py +++ b/test/integration/component/test_affinity_groups.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from nose.plugins.attrib import attr class Services: diff --git a/test/integration/component/test_asa1000v_fw.py b/test/integration/component/test_asa1000v_fw.py index c8a11ab1701..0d8cad09802 100644 --- a/test/integration/component/test_asa1000v_fw.py +++ b/test/integration/component/test_asa1000v_fw.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_baremetal.py b/test/integration/component/test_baremetal.py index 2439d0d2132..c6a877eca6e 100644 --- a/test/integration/component/test_baremetal.py +++ b/test/integration/component/test_baremetal.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_deploy_vm_userdata_reg.py b/test/integration/component/test_deploy_vm_userdata_reg.py index b282a860816..ca9179d77d2 100755 --- a/test/integration/component/test_deploy_vm_userdata_reg.py +++ b/test/integration/component/test_deploy_vm_userdata_reg.py @@ -23,7 +23,7 @@ from marvin.integration.lib.base import * from marvin.integration.lib.utils import * from marvin.integration.lib.common import * from nose.plugins.attrib import attr -from marvin.sshClient import SshClient +from marvin import remoteSSHClient import unittest import random import string diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py index 0aed95742ec..253cc46cab9 100644 --- a/test/integration/component/test_egress_fw_rules.py +++ b/test/integration/component/test_egress_fw_rules.py @@ -39,7 +39,7 @@ from marvin.integration.lib.common import (get_domain, from marvin.cloudstackAPI.createEgressFirewallRule import createEgressFirewallRuleCmd from marvin.cloudstackAPI.deleteEgressFirewallRule import deleteEgressFirewallRuleCmd -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import time class Services: @@ -270,7 +270,7 @@ class TestEgressFWRules(cloudstackTestCase): fd.write(expect_script) fd.close() - ssh = SshClient(host=sourceip, + ssh = remoteSSHClient(host=sourceip, port=22, user='root', passwd=self.services["host_password"]) diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py index 34995ffd1a0..f8e8e790248 100644 --- a/test/integration/component/test_egress_rules.py +++ b/test/integration/component/test_egress_rules.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_eip_elb.py b/test/integration/component/test_eip_elb.py index d639d82d9f5..42a5148762e 100644 --- a/test/integration/component/test_eip_elb.py +++ b/test/integration/component/test_eip_elb.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime @@ -314,7 +314,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -458,7 +458,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -657,7 +657,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -871,7 +871,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1138,7 +1138,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1287,7 +1287,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1366,7 +1366,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1512,7 +1512,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], diff --git a/test/integration/component/test_explicit_dedication.py b/test/integration/component/test_explicit_dedication.py index 7aefc21a1fb..bd97551b5c6 100644 --- a/test/integration/component/test_explicit_dedication.py +++ b/test/integration/component/test_explicit_dedication.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_haproxy.py b/test/integration/component/test_haproxy.py index c7340126b36..799cfa3e925 100644 --- a/test/integration/component/test_haproxy.py +++ b/test/integration/component/test_haproxy.py @@ -38,7 +38,7 @@ from marvin.integration.lib.common import (get_domain, random_gen ) from marvin.cloudstackAPI import createLBStickinessPolicy -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient class Services: @@ -383,7 +383,7 @@ class TestHAProxyStickyness(cloudstackTestCase): # If Round Robin Algorithm is chosen, # each ssh command should alternate between VMs - ssh_1 = SshClient( + ssh_1 = remoteSSHClient( ip_addr, 22, self.services["natrule"]["username"], diff --git a/test/integration/component/test_implicit_planner.py b/test/integration/component/test_implicit_planner.py index 2b656d9f2c6..f233ba9791e 100644 --- a/test/integration/component/test_implicit_planner.py +++ b/test/integration/component/test_implicit_planner.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_netscaler_configs.py b/test/integration/component/test_netscaler_configs.py index 98c47485e34..c10f6882334 100644 --- a/test/integration/component/test_netscaler_configs.py +++ b/test/integration/component/test_netscaler_configs.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime @@ -1745,7 +1745,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1891,7 +1891,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2051,7 +2051,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2249,7 +2249,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2334,7 +2334,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2396,7 +2396,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2458,7 +2458,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb.py b/test/integration/component/test_netscaler_lb.py index 5a8d6a4f6b5..4b380e904e1 100644 --- a/test/integration/component/test_netscaler_lb.py +++ b/test/integration/component/test_netscaler_lb.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime @@ -1228,7 +1228,7 @@ class TestAddMultipleVmsLb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -2104,7 +2104,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2430,7 +2430,7 @@ class TestVmWithLb(cloudstackTestCase): ) self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2523,7 +2523,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2596,7 +2596,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2709,7 +2709,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2797,7 +2797,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2880,7 +2880,7 @@ class TestVmWithLb(cloudstackTestCase): time.sleep(int(delay[0].value) + int(wait[0].value)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2936,7 +2936,7 @@ class TestVmWithLb(cloudstackTestCase): ) self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb_algo.py b/test/integration/component/test_netscaler_lb_algo.py index a5e1fe80b7b..4df7b897a5b 100644 --- a/test/integration/component/test_netscaler_lb_algo.py +++ b/test/integration/component/test_netscaler_lb_algo.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime @@ -300,7 +300,7 @@ class TestLbWithRoundRobin(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -524,7 +524,7 @@ class TestLbWithLeastConn(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -739,7 +739,7 @@ class TestLbWithSourceIp(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -912,7 +912,7 @@ class TestLbAlgoRrLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -945,7 +945,7 @@ class TestLbAlgoRrLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1115,7 +1115,7 @@ class TestLbAlgoLcRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1147,7 +1147,7 @@ class TestLbAlgoLcRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1318,7 +1318,7 @@ class TestLbAlgoRrSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1351,7 +1351,7 @@ class TestLbAlgoRrSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1526,7 +1526,7 @@ class TestLbAlgoSbRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1560,7 +1560,7 @@ class TestLbAlgoSbRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1734,7 +1734,7 @@ class TestLbAlgoSbLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1767,7 +1767,7 @@ class TestLbAlgoSbLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1939,7 +1939,7 @@ class TestLbAlgoLcSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1972,7 +1972,7 @@ class TestLbAlgoLcSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb_sticky.py b/test/integration/component/test_netscaler_lb_sticky.py index 6c27a08052a..56964a9fd9e 100644 --- a/test/integration/component/test_netscaler_lb_sticky.py +++ b/test/integration/component/test_netscaler_lb_sticky.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime @@ -267,7 +267,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -356,7 +356,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -445,7 +445,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -536,7 +536,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -627,7 +627,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -718,7 +718,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -809,7 +809,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -900,7 +900,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -991,7 +991,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = SshClient( + ssh_client = remoteSSHClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_nw_off.py b/test/integration/component/test_netscaler_nw_off.py index 3372612abab..b94d47ea164 100644 --- a/test/integration/component/test_netscaler_nw_off.py +++ b/test/integration/component/test_netscaler_nw_off.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 04777b0c2a8..335f8592ff0 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index a532b362751..917e7f2d1a9 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -23,7 +23,7 @@ from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * from netaddr import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from nose.plugins.attrib import attr @@ -808,7 +808,7 @@ class TestAssociatePublicIp(cloudstackTestCase): self.debug("Trying to SSH to ip: %s" % portableip.ipaddress.ipaddress) - SshClient( + remoteSSHClient( portableip.ipaddress.ipaddress, self.services['natrule']["publicport"], self.virtual_machine.username, @@ -1533,7 +1533,7 @@ class TestPortableIpTransferAcrossNetworks(cloudstackTestCase): self.debug("Trying to SSH to ip: %s" % portableip.ipaddress.ipaddress) - SshClient( + remoteSSHClient( portableip.ipaddress.ipaddress, self.services['natrule']["publicport"], self.virtual_machine2.username, diff --git a/test/integration/component/test_project_configs.py b/test/integration/component/test_project_configs.py index be6cf1ce279..a9654c82f57 100644 --- a/test/integration/component/test_project_configs.py +++ b/test/integration/component/test_project_configs.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index 9b9b2e6ac2e..131a9e21050 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index ba0a63c97e8..e836768591b 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index 4b82fc2639c..e4c2180dd42 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index c90ccf6ee28..5ec3ffb00d5 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient #Import System modules import time @@ -361,7 +361,7 @@ class TestDefaultSecurityGroup(cloudstackTestCase): # SSH Attempt to VM should fail with self.assertRaises(Exception): self.debug("SSH into VM: %s" % self.virtual_machine.ssh_ip) - ssh = SshClient( + ssh = remoteSSHClient.remoteSSHClient( self.virtual_machine.ssh_ip, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -656,7 +656,7 @@ class TestRevokeIngressRule(cloudstackTestCase): # SSH Attempt to VM should fail with self.assertRaises(Exception): self.debug("SSH into VM: %s" % self.virtual_machine.id) - SshClient( + remoteSSHClient.remoteSSHClient( self.virtual_machine.ssh_ip, self.virtual_machine.ssh_port, self.virtual_machine.username, diff --git a/test/integration/component/test_snapshot_limits.py b/test/integration/component/test_snapshot_limits.py index e52a893587c..2af77c3923d 100644 --- a/test/integration/component/test_snapshot_limits.py +++ b/test/integration/component/test_snapshot_limits.py @@ -21,7 +21,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import is_snapshot_on_nfs import os diff --git a/test/integration/component/test_stopped_vm.py b/test/integration/component/test_stopped_vm.py index 5a5c2981e2f..3be915166ee 100644 --- a/test/integration/component/test_stopped_vm.py +++ b/test/integration/component/test_stopped_vm.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_storage_motion.py b/test/integration/component/test_storage_motion.py index bae5acf5514..36376f373bc 100644 --- a/test/integration/component/test_storage_motion.py +++ b/test/integration/component/test_storage_motion.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_templates.py b/test/integration/component/test_templates.py index af86d32a3bd..ea4b27755ca 100644 --- a/test/integration/component/test_templates.py +++ b/test/integration/component/test_templates.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import urllib from random import random #Import System modules diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 5979a0a495c..75326f70a75 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_vm_passwdenabled.py b/test/integration/component/test_vm_passwdenabled.py index 5cfa52556f7..a6b45acc9d9 100644 --- a/test/integration/component/test_vm_passwdenabled.py +++ b/test/integration/component/test_vm_passwdenabled.py @@ -17,7 +17,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_vpc_network.py b/test/integration/component/test_vpc_network.py index 9f5e6f623f0..b9b4f0049f6 100644 --- a/test/integration/component/test_vpc_network.py +++ b/test/integration/component/test_vpc_network.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime # For more info on ddt refer to http://ddt.readthedocs.org/en/latest/api.html#module-ddt from ddt import ddt, data diff --git a/test/integration/component/test_vpc_offerings.py b/test/integration/component/test_vpc_offerings.py index 4f5802285f2..109c8d13687 100644 --- a/test/integration/component/test_vpc_offerings.py +++ b/test/integration/component/test_vpc_offerings.py @@ -26,7 +26,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_vpc_routers.py b/test/integration/component/test_vpc_routers.py index 8ed99ca3c36..9b772e41c67 100644 --- a/test/integration/component/test_vpc_routers.py +++ b/test/integration/component/test_vpc_routers.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/component/test_vpc_vm_life_cycle.py b/test/integration/component/test_vpc_vm_life_cycle.py index cc65eedff8a..5893cc35bc5 100644 --- a/test/integration/component/test_vpc_vm_life_cycle.py +++ b/test/integration/component/test_vpc_vm_life_cycle.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.codes import PASS import time diff --git a/test/integration/component/test_vpc_vm_life_cycle.py.rej b/test/integration/component/test_vpc_vm_life_cycle.py.rej deleted file mode 100644 index 98d859d3418..00000000000 --- a/test/integration/component/test_vpc_vm_life_cycle.py.rej +++ /dev/null @@ -1,10 +0,0 @@ -diff a/test/integration/component/test_vpc_vm_life_cycle.py b/test/integration/component/test_vpc_vm_life_cycle.py (rejected hunks) -@@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * - from marvin.integration.lib.utils import * - from marvin.integration.lib.base import * - from marvin.integration.lib.common import * --from marvin.remoteSSHClient import remoteSSHClient -+from marvin.sshClient import SshClient - - import time - diff --git a/test/integration/component/test_vpc_vms_deployment.py b/test/integration/component/test_vpc_vms_deployment.py index ebf3b317d2b..b01137b1ccd 100644 --- a/test/integration/component/test_vpc_vms_deployment.py +++ b/test/integration/component/test_vpc_vms_deployment.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient import datetime diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py index c96a580f199..db11adabe16 100644 --- a/test/integration/smoke/test_affinity_groups.py +++ b/test/integration/smoke/test_affinity_groups.py @@ -21,7 +21,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from nose.plugins.attrib import attr class Services: diff --git a/test/integration/smoke/test_loadbalance.py b/test/integration/smoke/test_loadbalance.py index 5f80c38303a..3e48158442a 100644 --- a/test/integration/smoke/test_loadbalance.py +++ b/test/integration/smoke/test_loadbalance.py @@ -17,7 +17,7 @@ from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * @@ -197,7 +197,7 @@ class TestLoadBalance(cloudstackTestCase): # If Round Robin Algorithm is chosen, # each ssh command should alternate between VMs - ssh_1 = SshClient( + ssh_1 = remoteSSHClient( ip_addr, self.services['lbrule']["publicport"], self.vm_1.username, diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 09d6437cd86..f2045959697 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -21,7 +21,7 @@ import marvin from marvin.cloudstackException import cloudstackAPIException from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * @@ -460,7 +460,7 @@ class TestPortForwarding(cloudstackTestCase): "SSHing into VM with IP address %s after NAT rule deletion" % self.virtual_machine.ipaddress) - SshClient( + remoteSSHClient( src_nat_ip_addr.ipaddress, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -578,7 +578,7 @@ class TestPortForwarding(cloudstackTestCase): "SSHing into VM with IP address %s after NAT rule deletion" % self.virtual_machine.ipaddress) - SshClient( + remoteSSHClient( ip_address.ipaddress.ipaddress, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -741,7 +741,7 @@ class TestRebootRouter(cloudstackTestCase): try: self.debug("SSH into VM (ID : %s ) after reboot" % self.vm_1.id) - SshClient( + remoteSSHClient( self.public_ip.ipaddress.ipaddress, self.services["natrule"]["publicport"], self.vm_1.username, @@ -883,7 +883,7 @@ class TestReleaseIP(cloudstackTestCase): # SSH Attempt though public IP should fail with self.assertRaises(Exception): - ssh_2 = SshClient( + ssh_2 = remoteSSHClient( self.ip_addr.ipaddress, self.services["natrule"]["publicport"], self.virtual_machine.username, diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py index ac95685f37a..583fc29c2c1 100644 --- a/test/integration/smoke/test_nic.py +++ b/test/integration/smoke/test_nic.py @@ -18,7 +18,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py index aeb47f953c4..0a427ba229d 100644 --- a/test/integration/smoke/test_pvlan.py +++ b/test/integration/smoke/test_pvlan.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_resource_detail.py b/test/integration/smoke/test_resource_detail.py index 00a7b5c4171..93bc2ffc1f1 100644 --- a/test/integration/smoke/test_resource_detail.py +++ b/test/integration/smoke/test_resource_detail.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index 7d324136e89..0f32e274338 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index a2b9eabc13c..9fa59a94d3f 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index e371ad436a8..9478440f77e 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 816ae03f267..b60b70e86ed 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -21,7 +21,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackException import * from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient +from marvin.remoteSSHClient import remoteSSHClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/tools/marvin/build/lib/marvin/TestCaseExecuteEngine.py b/tools/marvin/build/lib/marvin/TestCaseExecuteEngine.py deleted file mode 100644 index f5af1fe2c1e..00000000000 --- a/tools/marvin/build/lib/marvin/TestCaseExecuteEngine.py +++ /dev/null @@ -1,102 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 os -import sys -import logging -from functools import partial - - -def testCaseLogger(message, logger=None): - if logger is not None: - logger.debug(message) - - -class TestCaseExecuteEngine(object): - def __init__(self, testclient, config, testcaseLogFile=None, - testResultLogFile=None): - """ - Initialize the testcase execution engine, just the basics here - @var testcaseLogFile: client log file - @var testResultLogFile: summary report file - """ - self.testclient = testclient - self.config = config - self.logformat =\ - logging.Formatter( - "%(asctime)s - %(levelname)s - %(name)s - %(message)s") - self.loader = unittest.loader.TestLoader() - self.suite = None - - if testcaseLogFile is not None: - self.logfile = testcaseLogFile - self.logger = logging.getLogger("TestCaseExecuteEngine") - fh = logging.FileHandler(self.logfile) - fh.setFormatter(self.logformat) - self.logger.addHandler(fh) - self.logger.setLevel(logging.DEBUG) - if testResultLogFile is not None: - ch = logging.StreamHandler() - ch.setLevel(logging.ERROR) - ch.setFormatter(self.logformat) - self.logger.addHandler(ch) - fp = open(testResultLogFile, "w") - self.testResultLogFile = fp - else: - self.testResultLogFile = sys.stdout - - def loadTestsFromDir(self, testDirectory): - """ Load the test suites from a package with multiple test files """ - self.suite = self.loader.discover(testDirectory) - self.injectTestCase(self.suite) - - def loadTestsFromFile(self, file_name): - """ Load the tests from a single script/module """ - if os.path.isfile(file_name): - self.suite = self.loader.discover(os.path.dirname(file_name), - os.path.basename(file_name)) - self.injectTestCase(self.suite) - - def injectTestCase(self, testSuites): - for test in testSuites: - if isinstance(test, unittest.BaseTestSuite): - self.injectTestCase(test) - else: - #logger bears the name of the test class - testcaselogger = logging.getLogger("%s" % (test)) - fh = logging.FileHandler(self.logfile) - fh.setFormatter(self.logformat) - testcaselogger.addHandler(fh) - testcaselogger.setLevel(logging.DEBUG) - - #inject testclient and logger into each unittest - setattr(test, "testClient", self.testclient) - setattr(test, "config", self.config) - setattr(test, "debug", partial(testCaseLogger, - logger=testcaselogger)) - setattr(test.__class__, "clstestclient", self.testclient) - if hasattr(test, "user"): - # attribute when test is entirely executed as user - self.testclient.createUserApiClient(test.UserName, - test.DomainName, - test.AcctType) - - def run(self): - if self.suite: - unittest.TextTestRunner(stream=self.testResultLogFile, - verbosity=2).run(self.suite) diff --git a/tools/marvin/build/lib/marvin/__init__.py b/tools/marvin/build/lib/marvin/__init__.py deleted file mode 100644 index 7af168e20bc..00000000000 --- a/tools/marvin/build/lib/marvin/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Marvin - The cloudstack test client diff --git a/tools/marvin/build/lib/marvin/asyncJobMgr.py b/tools/marvin/build/lib/marvin/asyncJobMgr.py deleted file mode 100644 index 25818a62de5..00000000000 --- a/tools/marvin/build/lib/marvin/asyncJobMgr.py +++ /dev/null @@ -1,261 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 threading -import cloudstackException -import time -import Queue -import copy -import sys -import jsonHelper -import datetime - - -class job(object): - def __init__(self): - self.id = None - self.cmd = None - - -class jobStatus(object): - def __init__(self): - self.result = None - self.status = None - self.startTime = None - self.endTime = None - self.duration = None - self.jobId = None - self.responsecls = None - - def __str__(self): - return '{%s}' % str(', '.join('%s : %s' % (k, repr(v)) for (k, v) - in self.__dict__.iteritems())) - - -class workThread(threading.Thread): - def __init__(self, in_queue, outqueue, apiClient, db=None, lock=None): - threading.Thread.__init__(self) - self.inqueue = in_queue - self.output = outqueue - self.connection = apiClient.connection.__copy__() - self.db = None - self.lock = lock - - def queryAsynJob(self, job): - if job.jobId is None: - return job - - try: - self.lock.acquire() - result = self.connection.poll(job.jobId, job.responsecls).jobresult - except cloudstackException.cloudstackAPIException, e: - result = str(e) - finally: - self.lock.release() - - job.result = result - return job - - def executeCmd(self, job): - cmd = job.cmd - - jobstatus = jobStatus() - jobId = None - try: - self.lock.acquire() - - if cmd.isAsync == "false": - jobstatus.startTime = datetime.datetime.now() - - result = self.connection.make_request(cmd) - jobstatus.result = result - jobstatus.endTime = datetime.datetime.now() - jobstatus.duration =\ - time.mktime(jobstatus.endTime.timetuple()) - time.mktime( - jobstatus.startTime.timetuple()) - else: - result = self.connection.make_request(cmd, None, True) - if result is None: - jobstatus.status = False - else: - jobId = result.jobid - jobstatus.jobId = jobId - try: - responseName =\ - cmd.__class__.__name__.replace("Cmd", "Response") - jobstatus.responsecls =\ - jsonHelper.getclassFromName(cmd, responseName) - except: - pass - jobstatus.status = True - except cloudstackException.cloudstackAPIException, e: - jobstatus.result = str(e) - jobstatus.status = False - except: - jobstatus.status = False - jobstatus.result = sys.exc_info() - finally: - self.lock.release() - - return jobstatus - - def run(self): - while self.inqueue.qsize() > 0: - job = self.inqueue.get() - if isinstance(job, jobStatus): - jobstatus = self.queryAsynJob(job) - else: - jobstatus = self.executeCmd(job) - - self.output.put(jobstatus) - self.inqueue.task_done() - - '''release the resource''' - self.connection.close() - - -class jobThread(threading.Thread): - def __init__(self, inqueue, interval): - threading.Thread.__init__(self) - self.inqueue = inqueue - self.interval = interval - - def run(self): - while self.inqueue.qsize() > 0: - job = self.inqueue.get() - try: - job.run() - '''release the api connection''' - job.apiClient.connection.close() - except: - pass - - self.inqueue.task_done() - time.sleep(self.interval) - - -class outputDict(object): - def __init__(self): - self.lock = threading.Condition() - self.dict = {} - - -class asyncJobMgr(object): - def __init__(self, apiClient, db): - self.inqueue = Queue.Queue() - self.output = outputDict() - self.outqueue = Queue.Queue() - self.apiClient = apiClient - self.db = db - - def submitCmds(self, cmds): - if not self.inqueue.empty(): - return False - id = 0 - ids = [] - for cmd in cmds: - asyncjob = job() - asyncjob.id = id - asyncjob.cmd = cmd - self.inqueue.put(asyncjob) - id += 1 - ids.append(id) - return ids - - def updateTimeStamp(self, jobstatus): - jobId = jobstatus.jobId - if jobId is not None and self.db is not None: - result = self.db.execute( - "select job_status, created, last_updated from async_job where\ - id='%s'" % str(jobId)) - if result is not None and len(result) > 0: - if result[0][0] == 1: - jobstatus.status = True - else: - jobstatus.status = False - jobstatus.startTime = result[0][1] - jobstatus.endTime = result[0][2] - delta = jobstatus.endTime - jobstatus.startTime - jobstatus.duration = delta.total_seconds() - - def waitForComplete(self, workers=10): - self.inqueue.join() - lock = threading.Lock() - resultQueue = Queue.Queue() - '''intermediate result is stored in self.outqueue''' - for i in range(workers): - worker = workThread(self.outqueue, resultQueue, self.apiClient, - self.db, lock) - worker.start() - - self.outqueue.join() - - asyncJobResult = [] - while resultQueue.qsize() > 0: - jobstatus = resultQueue.get() - self.updateTimeStamp(jobstatus) - asyncJobResult.append(jobstatus) - - return asyncJobResult - - def submitCmdsAndWait(self, cmds, workers=10): - ''' - put commands into a queue at first, then start workers numbers - threads to execute this commands - ''' - self.submitCmds(cmds) - lock = threading.Lock() - for i in range(workers): - worker = workThread(self.inqueue, self.outqueue, self.apiClient, - self.db, lock) - worker.start() - - return self.waitForComplete(workers) - - def submitJobExecuteNtimes(self, job, ntimes=1, nums_threads=1, - interval=1): - ''' - submit one job and execute the same job ntimes, with nums_threads - of threads - ''' - inqueue1 = Queue.Queue() - lock = threading.Condition() - for i in range(ntimes): - newjob = copy.copy(job) - setattr(newjob, "apiClient", copy.copy(self.apiClient)) - setattr(newjob, "lock", lock) - inqueue1.put(newjob) - - for i in range(nums_threads): - work = jobThread(inqueue1, interval) - work.start() - inqueue1.join() - - def submitJobs(self, jobs, nums_threads=1, interval=1): - '''submit n jobs, execute them with nums_threads of threads''' - inqueue1 = Queue.Queue() - lock = threading.Condition() - - for job in jobs: - setattr(job, "apiClient", copy.copy(self.apiClient)) - setattr(job, "lock", lock) - inqueue1.put(job) - - for i in range(nums_threads): - work = jobThread(inqueue1, interval) - work.start() - inqueue1.join() diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/__init__.py b/tools/marvin/build/lib/marvin/cloudstackAPI/__init__.py deleted file mode 100644 index ad0c1e55f83..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -__all__ = ["createAccount","deleteAccount","updateAccount","disableAccount","enableAccount","lockAccount","listAccounts","markDefaultZoneForAccount","createUser","deleteUser","updateUser","listUsers","lockUser","disableUser","enableUser","getUser","createDomain","updateDomain","deleteDomain","listDomains","listDomainChildren","getCloudIdentifier","updateResourceLimit","updateResourceCount","listResourceLimits","deployVirtualMachine","destroyVirtualMachine","rebootVirtualMachine","startVirtualMachine","stopVirtualMachine","resetPasswordForVirtualMachine","resetSSHKeyForVirtualMachine","updateVirtualMachine","listVirtualMachines","getVMPassword","restoreVirtualMachine","changeServiceForVirtualMachine","scaleVirtualMachine","assignVirtualMachine","migrateVirtualMachine","migrateVirtualMachineWithVolume","recoverVirtualMachine","createSnapshot","listSnapshots","deleteSnapshot","createSnapshotPolicy","deleteSnapshotPolicies","listSnapshotPolicies","revertSnapshot","createTemplate","registerTemplate","updateTemplate","copyTemplate","deleteTemplate","listTemplates","updateTemplatePermissions","listTemplatePermissions","extractTemplate","prepareTemplate","attachIso","detachIso","listIsos","registerIso","updateIso","deleteIso","copyIso","updateIsoPermissions","listIsoPermissions","extractIso","listOsTypes","listOsCategories","createServiceOffering","deleteServiceOffering","updateServiceOffering","listServiceOfferings","createDiskOffering","updateDiskOffering","deleteDiskOffering","listDiskOfferings","createVlanIpRange","deleteVlanIpRange","listVlanIpRanges","dedicatePublicIpRange","releasePublicIpRange","dedicateGuestVlanRange","releaseDedicatedGuestVlanRange","listDedicatedGuestVlanRanges","associateIpAddress","disassociateIpAddress","listPublicIpAddresses","listPortForwardingRules","createPortForwardingRule","deletePortForwardingRule","updatePortForwardingRule","enableStaticNat","createIpForwardingRule","deleteIpForwardingRule","listIpForwardingRules","disableStaticNat","createLoadBalancerRule","deleteLoadBalancerRule","removeFromLoadBalancerRule","assignToLoadBalancerRule","createLBStickinessPolicy","deleteLBStickinessPolicy","listLoadBalancerRules","listLBStickinessPolicies","listLBHealthCheckPolicies","createLBHealthCheckPolicy","deleteLBHealthCheckPolicy","listLoadBalancerRuleInstances","updateLoadBalancerRule","createCounter","createCondition","createAutoScalePolicy","createAutoScaleVmProfile","createAutoScaleVmGroup","deleteCounter","deleteCondition","deleteAutoScalePolicy","deleteAutoScaleVmProfile","deleteAutoScaleVmGroup","listCounters","listConditions","listAutoScalePolicies","listAutoScaleVmProfiles","listAutoScaleVmGroups","enableAutoScaleVmGroup","disableAutoScaleVmGroup","updateAutoScalePolicy","updateAutoScaleVmProfile","updateAutoScaleVmGroup","startRouter","rebootRouter","stopRouter","destroyRouter","changeServiceForRouter","listRouters","listVirtualRouterElements","configureVirtualRouterElement","createVirtualRouterElement","startSystemVm","rebootSystemVm","stopSystemVm","destroySystemVm","listSystemVms","migrateSystemVm","changeServiceForSystemVm","scaleSystemVm","updateConfiguration","listConfigurations","listCapabilities","listDeploymentPlanners","cleanVMReservations","createPod","updatePod","deletePod","listPods","createZone","updateZone","deleteZone","listZones","listEvents","listEventTypes","archiveEvents","deleteEvents","listAlerts","archiveAlerts","deleteAlerts","listCapacity","addSwift","listSwifts","addS3","listS3s","addImageStore","listImageStores","deleteImageStore","createSecondaryStagingStore","listSecondaryStagingStores","deleteSecondaryStagingStore","addHost","addCluster","deleteCluster","updateCluster","reconnectHost","updateHost","deleteHost","prepareHostForMaintenance","cancelHostMaintenance","listHosts","findHostsForMigration","addSecondaryStorage","updateHostPassword","releaseHostReservation","attachVolume","uploadVolume","detachVolume","createVolume","deleteVolume","listVolumes","extractVolume","migrateVolume","resizeVolume","updateVolume","registerUserKeys","queryAsyncJobResult","listAsyncJobs","listStoragePools","listStorageProviders","createStoragePool","updateStoragePool","deleteStoragePool","listClusters","enableStorageMaintenance","cancelStorageMaintenance","findStoragePoolsForMigration","createSecurityGroup","deleteSecurityGroup","authorizeSecurityGroupIngress","revokeSecurityGroupIngress","authorizeSecurityGroupEgress","revokeSecurityGroupEgress","listSecurityGroups","createInstanceGroup","deleteInstanceGroup","updateInstanceGroup","listInstanceGroups","uploadCustomCertificate","listHypervisors","createRemoteAccessVpn","deleteRemoteAccessVpn","listRemoteAccessVpns","addVpnUser","removeVpnUser","listVpnUsers","createNetworkOffering","updateNetworkOffering","deleteNetworkOffering","listNetworkOfferings","createNetwork","deleteNetwork","listNetworks","restartNetwork","updateNetwork","addNicToVirtualMachine","removeNicFromVirtualMachine","updateDefaultNicForVirtualMachine","addIpToNic","removeIpFromNic","listNics","registerSSHKeyPair","createSSHKeyPair","deleteSSHKeyPair","listSSHKeyPairs","createProject","deleteProject","updateProject","activateProject","suspendProject","listProjects","addAccountToProject","deleteAccountFromProject","listProjectAccounts","listProjectInvitations","updateProjectInvitation","deleteProjectInvitation","createFirewallRule","deleteFirewallRule","listFirewallRules","createEgressFirewallRule","deleteEgressFirewallRule","listEgressFirewallRules","updateHypervisorCapabilities","listHypervisorCapabilities","createPhysicalNetwork","deletePhysicalNetwork","listPhysicalNetworks","updatePhysicalNetwork","listSupportedNetworkServices","addNetworkServiceProvider","deleteNetworkServiceProvider","listNetworkServiceProviders","updateNetworkServiceProvider","addTrafficType","deleteTrafficType","listTrafficTypes","updateTrafficType","listTrafficTypeImplementors","createStorageNetworkIpRange","deleteStorageNetworkIpRange","listStorageNetworkIpRange","updateStorageNetworkIpRange","addNetworkDevice","listNetworkDevice","deleteNetworkDevice","createVPC","listVPCs","deleteVPC","updateVPC","restartVPC","createVPCOffering","updateVPCOffering","deleteVPCOffering","listVPCOfferings","createPrivateGateway","listPrivateGateways","deletePrivateGateway","createNetworkACL","updateNetworkACLItem","deleteNetworkACL","listNetworkACLs","createNetworkACLList","deleteNetworkACLList","replaceNetworkACLList","listNetworkACLLists","createStaticRoute","deleteStaticRoute","listStaticRoutes","createTags","deleteTags","listTags","addResourceDetail","removeResourceDetail","listResourceDetails","createVpnCustomerGateway","createVpnGateway","createVpnConnection","deleteVpnCustomerGateway","deleteVpnGateway","deleteVpnConnection","updateVpnCustomerGateway","resetVpnConnection","listVpnCustomerGateways","listVpnGateways","listVpnConnections","generateUsageRecords","listUsageRecords","listUsageTypes","addTrafficMonitor","deleteTrafficMonitor","listTrafficMonitors","addNiciraNvpDevice","deleteNiciraNvpDevice","listNiciraNvpDevices","listNiciraNvpDeviceNetworks","addBigSwitchVnsDevice","deleteBigSwitchVnsDevice","listBigSwitchVnsDevices","listApis","getApiLimit","resetApiLimit","addRegion","updateRegion","removeRegion","listRegions","createGlobalLoadBalancerRule","deleteGlobalLoadBalancerRule","updateGlobalLoadBalancerRule","listGlobalLoadBalancerRules","assignToGlobalLoadBalancerRule","removeFromGlobalLoadBalancerRule","listVMSnapshot","createVMSnapshot","deleteVMSnapshot","revertToVMSnapshot","addBaremetalHost","addBaremetalPxeKickStartServer","addBaremetalPxePingServer","addBaremetalDhcp","listBaremetalDhcp","listBaremetalPxeServers","addUcsManager","listUcsManagers","listUcsProfiles","listUcsBlades","associateUcsProfileToBlade","createLoadBalancer","listLoadBalancers","deleteLoadBalancer","configureInternalLoadBalancerElement","createInternalLoadBalancerElement","listInternalLoadBalancerElements","createAffinityGroup","deleteAffinityGroup","listAffinityGroups","updateVMAffinityGroup","listAffinityGroupTypes","createPortableIpRange","deletePortableIpRange","listPortableIpRanges","stopInternalLoadBalancerVM","startInternalLoadBalancerVM","listInternalLoadBalancerVMs","listNetworkIsolationMethods","dedicateZone","dedicatePod","dedicateCluster","dedicateHost","releaseDedicatedZone","releaseDedicatedPod","releaseDedicatedCluster","releaseDedicatedHost","listDedicatedZones","listDedicatedPods","listDedicatedClusters","listDedicatedHosts","listLdapConfigurations","addLdapConfiguration","deleteLdapConfiguration","listLdapUsers","ldapCreateAccount","login","logout","cloudstackAPIClient"] \ No newline at end of file diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/activateProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/activateProject.py deleted file mode 100644 index cd7c7a774b6..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/activateProject.py +++ /dev/null @@ -1,141 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Activates a project""" -from baseCmd import * -from baseResponse import * -class activateProjectCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of the project to be modified""" - """Required""" - self.id = None - self.required = ["id",] - -class activateProjectResponse (baseResponse): - def __init__(self): - """the id of the project""" - self.id = None - """the account name of the project's owner""" - self.account = None - """the total number of cpu cores available to be created for this project""" - self.cpuavailable = None - """the total number of cpu cores the project can own""" - self.cpulimit = None - """the total number of cpu cores owned by project""" - self.cputotal = None - """the displaytext of the project""" - self.displaytext = None - """the domain name where the project belongs to""" - self.domain = None - """the domain id the project belongs to""" - self.domainid = None - """the total number of public ip addresses available for this project to acquire""" - self.ipavailable = None - """the total number of public ip addresses this project can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this project""" - self.iptotal = None - """the total memory (in MB) available to be created for this project""" - self.memoryavailable = None - """the total memory (in MB) the project can own""" - self.memorylimit = None - """the total memory (in MB) owned by project""" - self.memorytotal = None - """the name of the project""" - self.name = None - """the total number of networks available to be created for this project""" - self.networkavailable = None - """the total number of networks the project can own""" - self.networklimit = None - """the total number of networks owned by project""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this project""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the project can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by project""" - self.primarystoragetotal = None - """the total secondary storage space (in GiB) available to be used for this project""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the project can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by project""" - self.secondarystoragetotal = None - """the total number of snapshots available for this project""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this project""" - self.snapshotlimit = None - """the total number of snapshots stored by this project""" - self.snapshottotal = None - """the state of the project""" - self.state = None - """the total number of templates available to be created by this project""" - self.templateavailable = None - """the total number of templates which can be created by this project""" - self.templatelimit = None - """the total number of templates which have been created by this project""" - self.templatetotal = None - """the total number of virtual machines available for this project to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this project""" - self.vmlimit = None - """the total number of virtual machines running for this project""" - self.vmrunning = None - """the total number of virtual machines stopped for this project""" - self.vmstopped = None - """the total number of virtual machines deployed by this project""" - self.vmtotal = None - """the total volume available for this project""" - self.volumeavailable = None - """the total volume which can be used by this project""" - self.volumelimit = None - """the total volume being used by this project""" - self.volumetotal = None - """the total number of vpcs available to be created for this project""" - self.vpcavailable = None - """the total number of vpcs the project can own""" - self.vpclimit = None - """the total number of vpcs owned by project""" - self.vpctotal = None - """the list of resource tags associated with vm""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addAccountToProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addAccountToProject.py deleted file mode 100644 index 211c58d90ba..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addAccountToProject.py +++ /dev/null @@ -1,40 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds acoount to a project""" -from baseCmd import * -from baseResponse import * -class addAccountToProjectCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of the project to add the account to""" - """Required""" - self.projectid = None - """name of the account to be added to the project""" - self.account = None - """email to which invitation to the project is going to be sent""" - self.email = None - self.required = ["projectid",] - -class addAccountToProjectResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalDhcp.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalDhcp.py deleted file mode 100644 index fa8b095e77e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalDhcp.py +++ /dev/null @@ -1,54 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""adds a baremetal dhcp server""" -from baseCmd import * -from baseResponse import * -class addBaremetalDhcpCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Type of dhcp device""" - """Required""" - self.dhcpservertype = None - """Credentials to reach external dhcp device""" - """Required""" - self.password = None - """the Physical Network ID""" - """Required""" - self.physicalnetworkid = None - """URL of the external dhcp appliance.""" - """Required""" - self.url = None - """Credentials to reach external dhcp device""" - """Required""" - self.username = None - self.required = ["dhcpservertype","password","physicalnetworkid","url","username",] - -class addBaremetalDhcpResponse (baseResponse): - def __init__(self): - """device id of""" - self.id = None - """name of the provider""" - self.dhcpservertype = None - """the physical network to which this external dhcp device belongs to""" - self.physicalnetworkid = None - """name of the provider""" - self.provider = None - """url""" - self.url = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalHost.py deleted file mode 100644 index 6fb003e15e3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalHost.py +++ /dev/null @@ -1,147 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""add a baremetal host""" -from baseCmd import * -from baseResponse import * -class addBaremetalHostCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """hypervisor type of the host""" - """Required""" - self.hypervisor = None - """the password for the host""" - """Required""" - self.password = None - """the Pod ID for the host""" - """Required""" - self.podid = None - """the host URL""" - """Required""" - self.url = None - """the username for the host""" - """Required""" - self.username = None - """the Zone ID for the host""" - """Required""" - self.zoneid = None - """Allocation state of this Host for allocation of new resources""" - self.allocationstate = None - """the cluster ID for the host""" - self.clusterid = None - """the cluster name for the host""" - self.clustername = None - """list of tags to be added to the host""" - self.hosttags = [] - """ip address intentionally allocated to this host after provisioning""" - self.ipaddress = None - self.required = ["hypervisor","password","podid","url","username","zoneid",] - -class addBaremetalHostResponse (baseResponse): - def __init__(self): - """the ID of the host""" - self.id = None - """the cpu average load on the host""" - self.averageload = None - """capabilities of the host""" - self.capabilities = None - """the cluster ID of the host""" - self.clusterid = None - """the cluster name of the host""" - self.clustername = None - """the cluster type of the cluster that host belongs to""" - self.clustertype = None - """the amount of the host's CPU currently allocated""" - self.cpuallocated = None - """the CPU number of the host""" - self.cpunumber = None - """the CPU speed of the host""" - self.cpuspeed = None - """the amount of the host's CPU currently used""" - self.cpuused = None - """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" - self.cpuwithoverprovisioning = None - """the date and time the host was created""" - self.created = None - """true if the host is disconnected. False otherwise.""" - self.disconnected = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the host""" - self.disksizetotal = None - """events available for the host""" - self.events = None - """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" - self.hahost = None - """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" - self.hasenoughcapacity = None - """comma-separated list of tags for the host""" - self.hosttags = None - """the host hypervisor""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the IP address of the host""" - self.ipaddress = None - """true if local storage is active, false otherwise""" - self.islocalstorageactive = None - """the date and time the host was last pinged""" - self.lastpinged = None - """the management server ID of the host""" - self.managementserverid = None - """the amount of the host's memory currently allocated""" - self.memoryallocated = None - """the memory total of the host""" - self.memorytotal = None - """the amount of the host's memory currently used""" - self.memoryused = None - """the name of the host""" - self.name = None - """the incoming network traffic on the host""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the OS category ID of the host""" - self.oscategoryid = None - """the OS category name of the host""" - self.oscategoryname = None - """the Pod ID of the host""" - self.podid = None - """the Pod name of the host""" - self.podname = None - """the date and time the host was removed""" - self.removed = None - """the resource state of the host""" - self.resourcestate = None - """the state of the host""" - self.state = None - """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" - self.suitableformigration = None - """the host type""" - self.type = None - """the host version""" - self.version = None - """the Zone ID of the host""" - self.zoneid = None - """the Zone name of the host""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxeKickStartServer.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxeKickStartServer.py deleted file mode 100644 index 14a1237cc14..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxeKickStartServer.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. - - -"""add a baremetal pxe server""" -from baseCmd import * -from baseResponse import * -class addBaremetalPxeKickStartServerCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Credentials to reach external pxe device""" - """Required""" - self.password = None - """the Physical Network ID""" - """Required""" - self.physicalnetworkid = None - """type of pxe device""" - """Required""" - self.pxeservertype = None - """Tftp root directory of PXE server""" - """Required""" - self.tftpdir = None - """URL of the external pxe device""" - """Required""" - self.url = None - """Credentials to reach external pxe device""" - """Required""" - self.username = None - """Pod Id""" - self.podid = None - self.required = ["password","physicalnetworkid","pxeservertype","tftpdir","url","username",] - -class addBaremetalPxeKickStartServerResponse (baseResponse): - def __init__(self): - """Tftp root directory of PXE server""" - self.tftpdir = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxePingServer.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxePingServer.py deleted file mode 100644 index 6e3d6bf03c8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addBaremetalPxePingServer.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. - - -"""add a baremetal ping pxe server""" -from baseCmd import * -from baseResponse import * -class addBaremetalPxePingServerCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Credentials to reach external pxe device""" - """Required""" - self.password = None - """the Physical Network ID""" - """Required""" - self.physicalnetworkid = None - """Root directory on PING storage server""" - """Required""" - self.pingdir = None - """PING storage server ip""" - """Required""" - self.pingstorageserverip = None - """type of pxe device""" - """Required""" - self.pxeservertype = None - """Tftp root directory of PXE server""" - """Required""" - self.tftpdir = None - """URL of the external pxe device""" - """Required""" - self.url = None - """Credentials to reach external pxe device""" - """Required""" - self.username = None - """Password of PING storage server""" - self.pingcifspassword = None - """Username of PING storage server""" - self.pingcifsusername = None - """Pod Id""" - self.podid = None - self.required = ["password","physicalnetworkid","pingdir","pingstorageserverip","pxeservertype","tftpdir","url","username",] - -class addBaremetalPxePingServerResponse (baseResponse): - def __init__(self): - """Root directory on PING storage server""" - self.pingdir = None - """PING storage server ip""" - self.pingstorageserverip = None - """Tftp root directory of PXE server""" - self.tftpdir = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addBigSwitchVnsDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addBigSwitchVnsDevice.py deleted file mode 100644 index 77a74765932..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addBigSwitchVnsDevice.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. - - -"""Adds a BigSwitch VNS device""" -from baseCmd import * -from baseResponse import * -class addBigSwitchVnsDeviceCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Hostname of ip address of the BigSwitch VNS Controller.""" - """Required""" - self.hostname = None - """the Physical Network ID""" - """Required""" - self.physicalnetworkid = None - self.required = ["hostname","physicalnetworkid",] - -class addBigSwitchVnsDeviceResponse (baseResponse): - def __init__(self): - """device name""" - self.bigswitchdevicename = None - """the controller Ip address""" - self.hostname = None - """the physical network to which this BigSwitch Vns belongs to""" - self.physicalnetworkid = None - """name of the provider""" - self.provider = None - """device id of the BigSwitch Vns""" - self.vnsdeviceid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addCluster.py deleted file mode 100644 index 26d7f6c2d5d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addCluster.py +++ /dev/null @@ -1,115 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds a new cluster""" -from baseCmd import * -from baseResponse import * -class addClusterCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the cluster name""" - """Required""" - self.clustername = None - """type of the cluster: CloudManaged, ExternalManaged""" - """Required""" - self.clustertype = None - """hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator""" - """Required""" - self.hypervisor = None - """the Pod ID for the host""" - """Required""" - self.podid = None - """the Zone ID for the cluster""" - """Required""" - self.zoneid = None - """Allocation state of this cluster for allocation of new resources""" - self.allocationstate = None - """Name of virtual switch used for guest traffic in the cluster. This would override zone wide traffic label setting.""" - self.guestvswitchname = None - """Type of virtual switch used for guest traffic in the cluster. Allowed values are, vmwaresvs (for VMware standard vSwitch) and vmwaredvs (for VMware distributed vSwitch)""" - self.guestvswitchtype = None - """the password for the host""" - self.password = None - """Name of virtual switch used for public traffic in the cluster. This would override zone wide traffic label setting.""" - self.publicvswitchname = None - """Type of virtual switch used for public traffic in the cluster. Allowed values are, vmwaresvs (for VMware standard vSwitch) and vmwaredvs (for VMware distributed vSwitch)""" - self.publicvswitchtype = None - """the URL""" - self.url = None - """the username for the cluster""" - self.username = None - """the ipaddress of the VSM associated with this cluster""" - self.vsmipaddress = None - """the password for the VSM associated with this cluster""" - self.vsmpassword = None - """the username for the VSM associated with this cluster""" - self.vsmusername = None - self.required = ["clustername","clustertype","hypervisor","podid","zoneid",] - -class addClusterResponse (baseResponse): - def __init__(self): - """the cluster ID""" - self.id = None - """the allocation state of the cluster""" - self.allocationstate = None - """the type of the cluster""" - self.clustertype = None - """The cpu overcommit ratio of the cluster""" - self.cpuovercommitratio = None - """the hypervisor type of the cluster""" - self.hypervisortype = None - """whether this cluster is managed by cloudstack""" - self.managedstate = None - """The memory overcommit ratio of the cluster""" - self.memoryovercommitratio = None - """the cluster name""" - self.name = None - """the Pod ID of the cluster""" - self.podid = None - """the Pod name of the cluster""" - self.podname = None - """the Zone ID of the cluster""" - self.zoneid = None - """the Zone name of the cluster""" - self.zonename = None - """the capacity of the Cluster""" - self.capacity = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addHost.py deleted file mode 100644 index c1a96e084d3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addHost.py +++ /dev/null @@ -1,145 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds a new host.""" -from baseCmd import * -from baseResponse import * -class addHostCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """hypervisor type of the host""" - """Required""" - self.hypervisor = None - """the password for the host""" - """Required""" - self.password = None - """the Pod ID for the host""" - """Required""" - self.podid = None - """the host URL""" - """Required""" - self.url = None - """the username for the host""" - """Required""" - self.username = None - """the Zone ID for the host""" - """Required""" - self.zoneid = None - """Allocation state of this Host for allocation of new resources""" - self.allocationstate = None - """the cluster ID for the host""" - self.clusterid = None - """the cluster name for the host""" - self.clustername = None - """list of tags to be added to the host""" - self.hosttags = [] - self.required = ["hypervisor","password","podid","url","username","zoneid",] - -class addHostResponse (baseResponse): - def __init__(self): - """the ID of the host""" - self.id = None - """the cpu average load on the host""" - self.averageload = None - """capabilities of the host""" - self.capabilities = None - """the cluster ID of the host""" - self.clusterid = None - """the cluster name of the host""" - self.clustername = None - """the cluster type of the cluster that host belongs to""" - self.clustertype = None - """the amount of the host's CPU currently allocated""" - self.cpuallocated = None - """the CPU number of the host""" - self.cpunumber = None - """the CPU speed of the host""" - self.cpuspeed = None - """the amount of the host's CPU currently used""" - self.cpuused = None - """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" - self.cpuwithoverprovisioning = None - """the date and time the host was created""" - self.created = None - """true if the host is disconnected. False otherwise.""" - self.disconnected = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the host""" - self.disksizetotal = None - """events available for the host""" - self.events = None - """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" - self.hahost = None - """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" - self.hasenoughcapacity = None - """comma-separated list of tags for the host""" - self.hosttags = None - """the host hypervisor""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the IP address of the host""" - self.ipaddress = None - """true if local storage is active, false otherwise""" - self.islocalstorageactive = None - """the date and time the host was last pinged""" - self.lastpinged = None - """the management server ID of the host""" - self.managementserverid = None - """the amount of the host's memory currently allocated""" - self.memoryallocated = None - """the memory total of the host""" - self.memorytotal = None - """the amount of the host's memory currently used""" - self.memoryused = None - """the name of the host""" - self.name = None - """the incoming network traffic on the host""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the OS category ID of the host""" - self.oscategoryid = None - """the OS category name of the host""" - self.oscategoryname = None - """the Pod ID of the host""" - self.podid = None - """the Pod name of the host""" - self.podname = None - """the date and time the host was removed""" - self.removed = None - """the resource state of the host""" - self.resourcestate = None - """the state of the host""" - self.state = None - """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" - self.suitableformigration = None - """the host type""" - self.type = None - """the host version""" - self.version = None - """the Zone ID of the host""" - self.zoneid = None - """the Zone name of the host""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addImageStore.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addImageStore.py deleted file mode 100644 index c8ea3e2d350..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addImageStore.py +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds backup image store.""" -from baseCmd import * -from baseResponse import * -class addImageStoreCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the image store provider name""" - """Required""" - self.provider = None - """the details for the image store. Example: details[0].key=accesskey&details[0].value=s389ddssaa&details[1].key=secretkey&details[1].value=8dshfsss""" - self.details = [] - """the name for the image store""" - self.name = None - """the URL for the image store""" - self.url = None - """the Zone ID for the image store""" - self.zoneid = None - self.required = ["provider",] - -class addImageStoreResponse (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addIpToNic.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addIpToNic.py deleted file mode 100644 index 5810fe89abd..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addIpToNic.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. - - -"""Assigns secondary IP to NIC""" -from baseCmd import * -from baseResponse import * -class addIpToNicCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the nic to which you want to assign private IP""" - """Required""" - self.nicid = None - """Secondary IP Address""" - self.ipaddress = None - self.required = ["nicid",] - -class addIpToNicResponse (baseResponse): - def __init__(self): - """the ID of the secondary private IP addr""" - self.id = None - """Secondary IP address""" - self.ipaddress = None - """the ID of the network""" - self.networkid = None - """the ID of the nic""" - self.nicid = None - """the ID of the vm""" - self.virtualmachineid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addLdapConfiguration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addLdapConfiguration.py deleted file mode 100644 index 993108e7d40..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addLdapConfiguration.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Add a new Ldap Configuration""" -from baseCmd import * -from baseResponse import * -class addLdapConfigurationCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Hostname""" - """Required""" - self.hostname = None - """Port""" - """Required""" - self.port = None - self.required = ["hostname","port",] - -class addLdapConfigurationResponse (baseResponse): - def __init__(self): - """hostname""" - self.hostname = None - """port""" - self.port = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkDevice.py deleted file mode 100644 index efd5b081b7d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkDevice.py +++ /dev/null @@ -1,35 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds a network device of one of the following types: ExternalDhcp, ExternalFirewall, ExternalLoadBalancer, PxeServer""" -from baseCmd import * -from baseResponse import * -class addNetworkDeviceCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """parameters for network device""" - self.networkdeviceparameterlist = [] - """Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall""" - self.networkdevicetype = None - self.required = [] - -class addNetworkDeviceResponse (baseResponse): - def __init__(self): - """the ID of the network device""" - self.id = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkServiceProvider.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkServiceProvider.py deleted file mode 100644 index b00c20497d0..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addNetworkServiceProvider.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. - - -"""Adds a network serviceProvider to a physical network""" -from baseCmd import * -from baseResponse import * -class addNetworkServiceProviderCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the name for the physical network service provider""" - """Required""" - self.name = None - """the Physical Network ID to add the provider to""" - """Required""" - self.physicalnetworkid = None - """the destination Physical Network ID to bridge to""" - self.destinationphysicalnetworkid = None - """the list of services to be enabled for this physical network service provider""" - self.servicelist = [] - self.required = ["name","physicalnetworkid",] - -class addNetworkServiceProviderResponse (baseResponse): - def __init__(self): - """uuid of the network provider""" - self.id = None - """true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """the destination physical network""" - self.destinationphysicalnetworkid = None - """the provider name""" - self.name = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """services for this provider""" - self.servicelist = None - """state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addNicToVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addNicToVirtualMachine.py deleted file mode 100644 index 0385acc65bd..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addNicToVirtualMachine.py +++ /dev/null @@ -1,374 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds VM to specified network by creating a NIC""" -from baseCmd import * -from baseResponse import * -class addNicToVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Network ID""" - """Required""" - self.networkid = None - """Virtual Machine ID""" - """Required""" - self.virtualmachineid = None - """IP Address for the new network""" - self.ipaddress = None - self.required = ["networkid","virtualmachineid",] - -class addNicToVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addNiciraNvpDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addNiciraNvpDevice.py deleted file mode 100644 index 2a1b3b9c8b0..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addNiciraNvpDevice.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. - - -"""Adds a Nicira NVP device""" -from baseCmd import * -from baseResponse import * -class addNiciraNvpDeviceCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Hostname of ip address of the Nicira NVP Controller.""" - """Required""" - self.hostname = None - """Credentials to access the Nicira Controller API""" - """Required""" - self.password = None - """the Physical Network ID""" - """Required""" - self.physicalnetworkid = None - """The Transportzone UUID configured on the Nicira Controller""" - """Required""" - self.transportzoneuuid = None - """Credentials to access the Nicira Controller API""" - """Required""" - self.username = None - """The L3 Gateway Service UUID configured on the Nicira Controller""" - self.l3gatewayserviceuuid = None - self.required = ["hostname","password","physicalnetworkid","transportzoneuuid","username",] - -class addNiciraNvpDeviceResponse (baseResponse): - def __init__(self): - """the controller Ip address""" - self.hostname = None - """this L3 gateway service Uuid""" - self.l3gatewayserviceuuid = None - """device name""" - self.niciradevicename = None - """device id of the Nicire Nvp""" - self.nvpdeviceid = None - """the physical network to which this Nirica Nvp belongs to""" - self.physicalnetworkid = None - """name of the provider""" - self.provider = None - """the transport zone Uuid""" - self.transportzoneuuid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addRegion.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addRegion.py deleted file mode 100644 index 31dd483789c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addRegion.py +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds a Region""" -from baseCmd import * -from baseResponse import * -class addRegionCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Id of the Region""" - """Required""" - self.id = None - """Region service endpoint""" - """Required""" - self.endpoint = None - """Name of the region""" - """Required""" - self.name = None - self.required = ["id","endpoint","name",] - -class addRegionResponse (baseResponse): - def __init__(self): - """the ID of the region""" - self.id = None - """the end point of the region""" - self.endpoint = None - """true if GSLB service is enabled in the region, false otherwise""" - self.gslbserviceenabled = None - """the name of the region""" - self.name = None - """true if security groups support is enabled, false otherwise""" - self.portableipserviceenabled = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addResourceDetail.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addResourceDetail.py deleted file mode 100644 index d5f514b02d9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addResourceDetail.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. - - -"""Adds detail for the Resource.""" -from baseCmd import * -from baseResponse import * -class addResourceDetailCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Map of (key/value pairs)""" - """Required""" - self.details = [] - """resource id to create the details for""" - """Required""" - self.resourceid = None - """type of the resource""" - """Required""" - self.resourcetype = None - self.required = ["details","resourceid","resourcetype",] - -class addResourceDetailResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addS3.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addS3.py deleted file mode 100644 index 18a4eb6b95b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addS3.py +++ /dev/null @@ -1,66 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds S3""" -from baseCmd import * -from baseResponse import * -class addS3Cmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """S3 access key""" - """Required""" - self.accesskey = None - """name of the template storage bucket""" - """Required""" - self.bucket = None - """S3 secret key""" - """Required""" - self.secretkey = None - """connection timeout (milliseconds)""" - self.connectiontimeout = None - """S3 host name""" - self.endpoint = None - """maximum number of times to retry on error""" - self.maxerrorretry = None - """socket timeout (milliseconds)""" - self.sockettimeout = None - """connect to the S3 endpoint via HTTPS?""" - self.usehttps = None - self.required = ["accesskey","bucket","secretkey",] - -class addS3Response (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addSecondaryStorage.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addSecondaryStorage.py deleted file mode 100644 index 1e112ffd80c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addSecondaryStorage.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. - - -"""Adds secondary storage.""" -from baseCmd import * -from baseResponse import * -class addSecondaryStorageCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the URL for the secondary storage""" - """Required""" - self.url = None - """the Zone ID for the secondary storage""" - self.zoneid = None - self.required = ["url",] - -class addSecondaryStorageResponse (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addSwift.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addSwift.py deleted file mode 100644 index 1fe435be963..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addSwift.py +++ /dev/null @@ -1,56 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds Swift.""" -from baseCmd import * -from baseResponse import * -class addSwiftCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the URL for swift""" - """Required""" - self.url = None - """the account for swift""" - self.account = None - """key for the user for swift""" - self.key = None - """the username for swift""" - self.username = None - self.required = ["url",] - -class addSwiftResponse (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficMonitor.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficMonitor.py deleted file mode 100644 index 292e577914f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficMonitor.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. - - -"""Adds Traffic Monitor Host for Direct Network Usage""" -from baseCmd import * -from baseResponse import * -class addTrafficMonitorCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """URL of the traffic monitor Host""" - """Required""" - self.url = None - """Zone in which to add the external firewall appliance.""" - """Required""" - self.zoneid = None - """Traffic going into the listed zones will not be metered""" - self.excludezones = None - """Traffic going into the listed zones will be metered""" - self.includezones = None - self.required = ["url","zoneid",] - -class addTrafficMonitorResponse (baseResponse): - def __init__(self): - """the ID of the external firewall""" - self.id = None - """the management IP address of the external firewall""" - self.ipaddress = None - """the number of times to retry requests to the external firewall""" - self.numretries = None - """the timeout (in seconds) for requests to the external firewall""" - self.timeout = None - """the zone ID of the external firewall""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficType.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficType.py deleted file mode 100644 index 5da6f553fd0..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addTrafficType.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds traffic type to a physical network""" -from baseCmd import * -from baseResponse import * -class addTrafficTypeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the Physical Network ID""" - """Required""" - self.physicalnetworkid = None - """the trafficType to be added to the physical network""" - """Required""" - self.traffictype = None - """The network name label of the physical device dedicated to this traffic on a KVM host""" - self.kvmnetworklabel = None - """The VLAN id to be used for Management traffic by VMware host""" - self.vlan = None - """The network name label of the physical device dedicated to this traffic on a VMware host""" - self.vmwarenetworklabel = None - """The network name label of the physical device dedicated to this traffic on a XenServer host""" - self.xennetworklabel = None - self.required = ["physicalnetworkid","traffictype",] - -class addTrafficTypeResponse (baseResponse): - def __init__(self): - """id of the network provider""" - self.id = None - """The network name label of the physical device dedicated to this traffic on a KVM host""" - self.kvmnetworklabel = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """the trafficType to be added to the physical network""" - self.traffictype = None - """The network name label of the physical device dedicated to this traffic on a VMware host""" - self.vmwarenetworklabel = None - """The network name label of the physical device dedicated to this traffic on a XenServer host""" - self.xennetworklabel = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addUcsManager.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addUcsManager.py deleted file mode 100644 index 43ce10c853c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addUcsManager.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. - - -"""Adds a Ucs manager""" -from baseCmd import * -from baseResponse import * -class addUcsManagerCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the password of UCS""" - """Required""" - self.password = None - """the name of UCS url""" - """Required""" - self.url = None - """the username of UCS""" - """Required""" - self.username = None - """the Zone id for the ucs manager""" - """Required""" - self.zoneid = None - """the name of UCS manager""" - self.name = None - self.required = ["password","url","username","zoneid",] - -class addUcsManagerResponse (baseResponse): - def __init__(self): - """the ID of the ucs manager""" - self.id = None - """the name of ucs manager""" - self.name = None - """the url of ucs manager""" - self.url = None - """the zone ID of ucs manager""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/addVpnUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/addVpnUser.py deleted file mode 100644 index e5ef5862959..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/addVpnUser.py +++ /dev/null @@ -1,57 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds vpn users""" -from baseCmd import * -from baseResponse import * -class addVpnUserCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """password for the username""" - """Required""" - self.password = None - """username for the vpn user""" - """Required""" - self.username = None - """an optional account for the vpn user. Must be used with domainId.""" - self.account = None - """an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """add vpn user to the specific project""" - self.projectid = None - self.required = ["password","username",] - -class addVpnUserResponse (baseResponse): - def __init__(self): - """the vpn userID""" - self.id = None - """the account of the remote access vpn""" - self.account = None - """the domain name of the account of the remote access vpn""" - self.domain = None - """the domain id of the account of the remote access vpn""" - self.domainid = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the state of the Vpn User""" - self.state = None - """the username of the vpn user""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/archiveAlerts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/archiveAlerts.py deleted file mode 100644 index c02e1251263..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/archiveAlerts.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. - - -"""Archive one or more alerts.""" -from baseCmd import * -from baseResponse import * -class archiveAlertsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """end date range to archive alerts (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" - self.enddate = None - """the IDs of the alerts""" - self.ids = [] - """start date range to archive alerts (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" - self.startdate = None - """archive by alert type""" - self.type = None - self.required = [] - -class archiveAlertsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/archiveEvents.py b/tools/marvin/build/lib/marvin/cloudstackAPI/archiveEvents.py deleted file mode 100644 index 7a9dd572e01..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/archiveEvents.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. - - -"""Archive one or more events.""" -from baseCmd import * -from baseResponse import * -class archiveEventsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """end date range to archive events (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" - self.enddate = None - """the IDs of the events""" - self.ids = [] - """start date range to archive events (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" - self.startdate = None - """archive by event type""" - self.type = None - self.required = [] - -class archiveEventsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/assignToGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/assignToGlobalLoadBalancerRule.py deleted file mode 100644 index f0071437dbe..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/assignToGlobalLoadBalancerRule.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. - - -"""Assign load balancer rule or list of load balancer rules to a global load balancer rules.""" -from baseCmd import * -from baseResponse import * -class assignToGlobalLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the global load balancer rule""" - """Required""" - self.id = None - """the list load balancer rules that will be assigned to gloabal load balacner rule""" - """Required""" - self.loadbalancerrulelist = [] - """Map of LB rule id's and corresponding weights (between 1-100) in the GSLB rule, if not specified weight of a LB rule is defaulted to 1. Specified as 'gslblbruleweightsmap[0].loadbalancerid=UUID&gslblbruleweightsmap[0].weight=10'""" - self.gslblbruleweightsmap = [] - self.required = ["id","loadbalancerrulelist",] - -class assignToGlobalLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/assignToLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/assignToLoadBalancerRule.py deleted file mode 100644 index 56901e8e13f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/assignToLoadBalancerRule.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Assigns virtual machine or a list of virtual machines to a load balancer rule.""" -from baseCmd import * -from baseResponse import * -class assignToLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the load balancer rule""" - """Required""" - self.id = None - """the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)""" - """Required""" - self.virtualmachineids = [] - self.required = ["id","virtualmachineids",] - -class assignToLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/assignVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/assignVirtualMachine.py deleted file mode 100644 index e193c0e4b00..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/assignVirtualMachine.py +++ /dev/null @@ -1,379 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Change ownership of a VM from one account to another. This API is available for Basic zones with security groups and Advanced zones with guest networks. A root administrator can reassign a VM from any account to any other account in any domain. A domain administrator can reassign a VM to any account in the same domain.""" -from baseCmd import * -from baseResponse import * -class assignVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """account name of the new VM owner.""" - """Required""" - self.account = None - """domain id of the new VM owner.""" - """Required""" - self.domainid = None - """id of the VM to be moved""" - """Required""" - self.virtualmachineid = None - """list of new network ids in which the moved VM will participate. In case no network ids are provided the VM will be part of the default network for that zone. In case there is no network yet created for the new account the default network will be created.""" - self.networkids = [] - """list of security group ids to be applied on the virtual machine. In case no security groups are provided the VM is part of the default security group.""" - self.securitygroupids = [] - self.required = ["account","domainid","virtualmachineid",] - -class assignVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/associateIpAddress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/associateIpAddress.py deleted file mode 100644 index acf5e5f214c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/associateIpAddress.py +++ /dev/null @@ -1,130 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Acquires and associates a public IP to an account.""" -from baseCmd import * -from baseResponse import * -class associateIpAddressCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the account to associate with this IP address""" - self.account = None - """the ID of the domain to associate with this IP address""" - self.domainid = None - """should be set to true if public IP is required to be transferable across zones, if not specified defaults to false""" - self.isportable = None - """The network this ip address should be associated to.""" - self.networkid = None - """Deploy vm for the project""" - self.projectid = None - """region ID from where portable ip is to be associated.""" - self.regionid = None - """the VPC you want the ip address to be associated with""" - self.vpcid = None - """the ID of the availability zone you want to acquire an public IP address from""" - self.zoneid = None - self.required = [] - -class associateIpAddressResponse (baseResponse): - def __init__(self): - """public IP address id""" - self.id = None - """the account the public IP address is associated with""" - self.account = None - """date the public IP address was acquired""" - self.allocated = None - """the ID of the Network associated with the IP address""" - self.associatednetworkid = None - """the name of the Network associated with the IP address""" - self.associatednetworkname = None - """the domain the public IP address is associated with""" - self.domain = None - """the domain ID the public IP address is associated with""" - self.domainid = None - """the virtual network for the IP address""" - self.forvirtualnetwork = None - """public IP address""" - self.ipaddress = None - """is public IP portable across the zones""" - self.isportable = None - """true if the IP address is a source nat address, false otherwise""" - self.issourcenat = None - """true if this ip is for static nat, false otherwise""" - self.isstaticnat = None - """true if this ip is system ip (was allocated as a part of deployVm or createLbRule)""" - self.issystem = None - """the ID of the Network where ip belongs to""" - self.networkid = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value""" - self.purpose = None - """State of the ip address. Can be: Allocatin, Allocated and Releasing""" - self.state = None - """virutal machine display name the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachinedisplayname = None - """virutal machine id the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachineid = None - """virutal machine name the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachinename = None - """the ID of the VLAN associated with the IP address. This parameter is visible to ROOT admins only""" - self.vlanid = None - """the VLAN associated with the IP address""" - self.vlanname = None - """virutal machine (dnat) ip address (not null only for static nat Ip)""" - self.vmipaddress = None - """VPC the ip belongs to""" - self.vpcid = None - """the ID of the zone the public IP address belongs to""" - self.zoneid = None - """the name of the zone the public IP address belongs to""" - self.zonename = None - """the list of resource tags associated with ip address""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/associateUcsProfileToBlade.py b/tools/marvin/build/lib/marvin/cloudstackAPI/associateUcsProfileToBlade.py deleted file mode 100644 index 62d30c3293a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/associateUcsProfileToBlade.py +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""associate a profile to a blade""" -from baseCmd import * -from baseResponse import * -class associateUcsProfileToBladeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """blade id""" - """Required""" - self.bladeid = None - """profile dn""" - """Required""" - self.profiledn = None - """ucs manager id""" - """Required""" - self.ucsmanagerid = None - self.required = ["bladeid","profiledn","ucsmanagerid",] - -class associateUcsProfileToBladeResponse (baseResponse): - def __init__(self): - """ucs blade id""" - self.id = None - """ucs blade dn""" - self.bladedn = None - """cloudstack host id this blade associates to""" - self.hostid = None - """associated ucs profile dn""" - self.profiledn = None - """ucs manager id""" - self.ucsmanagerid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/attachIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/attachIso.py deleted file mode 100644 index 68159da3a25..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/attachIso.py +++ /dev/null @@ -1,372 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Attaches an ISO to a virtual machine.""" -from baseCmd import * -from baseResponse import * -class attachIsoCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the ISO file""" - """Required""" - self.id = None - """the ID of the virtual machine""" - """Required""" - self.virtualmachineid = None - self.required = ["id","virtualmachineid",] - -class attachIsoResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/attachVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/attachVolume.py deleted file mode 100644 index 7298731d506..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/attachVolume.py +++ /dev/null @@ -1,148 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Attaches a disk volume to a virtual machine.""" -from baseCmd import * -from baseResponse import * -class attachVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the disk volume""" - """Required""" - self.id = None - """the ID of the virtual machine""" - """Required""" - self.virtualmachineid = None - """the ID of the device to map the volume to within the guest OS. If no deviceId is passed in, the next available deviceId will be chosen. Possible values for a Linux OS are:* 1 - /dev/xvdb* 2 - /dev/xvdc* 4 - /dev/xvde* 5 - /dev/xvdf* 6 - /dev/xvdg* 7 - /dev/xvdh* 8 - /dev/xvdi* 9 - /dev/xvdj""" - self.deviceid = None - self.required = ["id","virtualmachineid",] - -class attachVolumeResponse (baseResponse): - def __init__(self): - """ID of the disk volume""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the date the volume was attached to a VM instance""" - self.attached = None - """the date the disk volume was created""" - self.created = None - """the boolean state of whether the volume is destroyed or not""" - self.destroyed = None - """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" - self.deviceid = None - """bytes read rate of the disk volume""" - self.diskBytesReadRate = None - """bytes write rate of the disk volume""" - self.diskBytesWriteRate = None - """io requests read rate of the disk volume""" - self.diskIopsReadRate = None - """io requests write rate of the disk volume""" - self.diskIopsWriteRate = None - """the display text of the disk offering""" - self.diskofferingdisplaytext = None - """ID of the disk offering""" - self.diskofferingid = None - """name of the disk offering""" - self.diskofferingname = None - """an optional field whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """Hypervisor the volume belongs to""" - self.hypervisor = None - """true if the volume is extractable, false otherwise""" - self.isextractable = None - """max iops of the disk volume""" - self.maxiops = None - """min iops of the disk volume""" - self.miniops = None - """name of the disk volume""" - self.name = None - """The path of the volume""" - self.path = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the display text of the service offering for root disk""" - self.serviceofferingdisplaytext = None - """ID of the service offering for root disk""" - self.serviceofferingid = None - """name of the service offering for root disk""" - self.serviceofferingname = None - """size of the disk volume""" - self.size = None - """ID of the snapshot from which this volume was created""" - self.snapshotid = None - """the state of the disk volume""" - self.state = None - """the status of the volume""" - self.status = None - """name of the primary storage hosting the disk volume""" - self.storage = None - """id of the primary storage hosting the disk volume; returned to admin user only""" - self.storageid = None - """shared or local storage""" - self.storagetype = None - """type of the disk volume (ROOT or DATADISK)""" - self.type = None - """id of the virtual machine""" - self.virtualmachineid = None - """display name of the virtual machine""" - self.vmdisplayname = None - """name of the virtual machine""" - self.vmname = None - """state of the virtual machine""" - self.vmstate = None - """ID of the availability zone""" - self.zoneid = None - """name of the availability zone""" - self.zonename = None - """the list of resource tags associated with volume""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupEgress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupEgress.py deleted file mode 100644 index 42148080a6d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupEgress.py +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Authorizes a particular egress rule for this security group""" -from baseCmd import * -from baseResponse import * -class authorizeSecurityGroupEgressCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """an optional account for the security group. Must be used with domainId.""" - self.account = None - """the cidr list associated""" - self.cidrlist = [] - """an optional domainId for the security group. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """end port for this egress rule""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """an optional project of the security group""" - self.projectid = None - """TCP is default. UDP is the other supported protocol""" - self.protocol = None - """The ID of the security group. Mutually exclusive with securityGroupName parameter""" - self.securitygroupid = None - """The name of the security group. Mutually exclusive with securityGroupName parameter""" - self.securitygroupname = None - """start port for this egress rule""" - self.startport = None - """user to security group mapping""" - self.usersecuritygrouplist = [] - self.required = [] - -class authorizeSecurityGroupEgressResponse (baseResponse): - def __init__(self): - """account owning the security group rule""" - self.account = None - """the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """the ending IP of the security group rule""" - self.endport = None - """the code for the ICMP message response""" - self.icmpcode = None - """the type of the ICMP message response""" - self.icmptype = None - """the protocol of the security group rule""" - self.protocol = None - """the id of the security group rule""" - self.ruleid = None - """security group name""" - self.securitygroupname = None - """the starting IP of the security group rule""" - self.startport = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupIngress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupIngress.py deleted file mode 100644 index 50c165027b3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/authorizeSecurityGroupIngress.py +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Authorizes a particular ingress rule for this security group""" -from baseCmd import * -from baseResponse import * -class authorizeSecurityGroupIngressCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """an optional account for the security group. Must be used with domainId.""" - self.account = None - """the cidr list associated""" - self.cidrlist = [] - """an optional domainId for the security group. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """end port for this ingress rule""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """an optional project of the security group""" - self.projectid = None - """TCP is default. UDP is the other supported protocol""" - self.protocol = None - """The ID of the security group. Mutually exclusive with securityGroupName parameter""" - self.securitygroupid = None - """The name of the security group. Mutually exclusive with securityGroupName parameter""" - self.securitygroupname = None - """start port for this ingress rule""" - self.startport = None - """user to security group mapping""" - self.usersecuritygrouplist = [] - self.required = [] - -class authorizeSecurityGroupIngressResponse (baseResponse): - def __init__(self): - """account owning the security group rule""" - self.account = None - """the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """the ending IP of the security group rule""" - self.endport = None - """the code for the ICMP message response""" - self.icmpcode = None - """the type of the ICMP message response""" - self.icmptype = None - """the protocol of the security group rule""" - self.protocol = None - """the id of the security group rule""" - self.ruleid = None - """security group name""" - self.securitygroupname = None - """the starting IP of the security group rule""" - self.startport = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/baseCmd.py b/tools/marvin/build/lib/marvin/cloudstackAPI/baseCmd.py deleted file mode 100644 index f03f42ddc6d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/baseCmd.py +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -"""Base Command""" -class baseCmd(object): - pass diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/baseResponse.py b/tools/marvin/build/lib/marvin/cloudstackAPI/baseResponse.py deleted file mode 100644 index 8c5742fe224..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/baseResponse.py +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -"""Base class for response""" -class baseResponse(object): - pass diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/cancelHostMaintenance.py b/tools/marvin/build/lib/marvin/cloudstackAPI/cancelHostMaintenance.py deleted file mode 100644 index b5b99766fbc..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/cancelHostMaintenance.py +++ /dev/null @@ -1,122 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Cancels host maintenance.""" -from baseCmd import * -from baseResponse import * -class cancelHostMaintenanceCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the host ID""" - """Required""" - self.id = None - self.required = ["id",] - -class cancelHostMaintenanceResponse (baseResponse): - def __init__(self): - """the ID of the host""" - self.id = None - """the cpu average load on the host""" - self.averageload = None - """capabilities of the host""" - self.capabilities = None - """the cluster ID of the host""" - self.clusterid = None - """the cluster name of the host""" - self.clustername = None - """the cluster type of the cluster that host belongs to""" - self.clustertype = None - """the amount of the host's CPU currently allocated""" - self.cpuallocated = None - """the CPU number of the host""" - self.cpunumber = None - """the CPU speed of the host""" - self.cpuspeed = None - """the amount of the host's CPU currently used""" - self.cpuused = None - """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" - self.cpuwithoverprovisioning = None - """the date and time the host was created""" - self.created = None - """true if the host is disconnected. False otherwise.""" - self.disconnected = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the host""" - self.disksizetotal = None - """events available for the host""" - self.events = None - """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" - self.hahost = None - """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" - self.hasenoughcapacity = None - """comma-separated list of tags for the host""" - self.hosttags = None - """the host hypervisor""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the IP address of the host""" - self.ipaddress = None - """true if local storage is active, false otherwise""" - self.islocalstorageactive = None - """the date and time the host was last pinged""" - self.lastpinged = None - """the management server ID of the host""" - self.managementserverid = None - """the amount of the host's memory currently allocated""" - self.memoryallocated = None - """the memory total of the host""" - self.memorytotal = None - """the amount of the host's memory currently used""" - self.memoryused = None - """the name of the host""" - self.name = None - """the incoming network traffic on the host""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the OS category ID of the host""" - self.oscategoryid = None - """the OS category name of the host""" - self.oscategoryname = None - """the Pod ID of the host""" - self.podid = None - """the Pod name of the host""" - self.podname = None - """the date and time the host was removed""" - self.removed = None - """the resource state of the host""" - self.resourcestate = None - """the state of the host""" - self.state = None - """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" - self.suitableformigration = None - """the host type""" - self.type = None - """the host version""" - self.version = None - """the Zone ID of the host""" - self.zoneid = None - """the Zone name of the host""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/cancelStorageMaintenance.py b/tools/marvin/build/lib/marvin/cloudstackAPI/cancelStorageMaintenance.py deleted file mode 100644 index ccd954728c6..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/cancelStorageMaintenance.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. - - -"""Cancels maintenance for primary storage""" -from baseCmd import * -from baseResponse import * -class cancelStorageMaintenanceCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the primary storage ID""" - """Required""" - self.id = None - self.required = ["id",] - -class cancelStorageMaintenanceResponse (baseResponse): - def __init__(self): - """the ID of the storage pool""" - self.id = None - """IOPS CloudStack can provision from this storage pool""" - self.capacityiops = None - """the ID of the cluster for the storage pool""" - self.clusterid = None - """the name of the cluster for the storage pool""" - self.clustername = None - """the date and time the storage pool was created""" - self.created = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the storage pool""" - self.disksizetotal = None - """the host's currently used disk size""" - self.disksizeused = None - """the hypervisor type of the storage pool""" - self.hypervisor = None - """the IP address of the storage pool""" - self.ipaddress = None - """the name of the storage pool""" - self.name = None - """the storage pool path""" - self.path = None - """the Pod ID of the storage pool""" - self.podid = None - """the Pod name of the storage pool""" - self.podname = None - """the scope of the storage pool""" - self.scope = None - """the state of the storage pool""" - self.state = None - """true if this pool is suitable to migrate a volume, false otherwise""" - self.suitableformigration = None - """the tags for the storage pool""" - self.tags = None - """the storage pool type""" - self.type = None - """the Zone ID of the storage pool""" - self.zoneid = None - """the Zone name of the storage pool""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForRouter.py deleted file mode 100644 index a189633f62d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForRouter.py +++ /dev/null @@ -1,154 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Upgrades domain router to a new service offering""" -from baseCmd import * -from baseResponse import * -class changeServiceForRouterCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """The ID of the router""" - """Required""" - self.id = None - """the service offering ID to apply to the domain router""" - """Required""" - self.serviceofferingid = None - self.required = ["id","serviceofferingid",] - -class changeServiceForRouterResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForSystemVm.py deleted file mode 100644 index 1a6c1b25e25..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForSystemVm.py +++ /dev/null @@ -1,89 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Changes the service offering for a system vm (console proxy or secondary storage). The system vm must be in a "Stopped" state for this command to take effect.""" -from baseCmd import * -from baseResponse import * -class changeServiceForSystemVmCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """The ID of the system vm""" - """Required""" - self.id = None - """the service offering ID to apply to the system vm""" - """Required""" - self.serviceofferingid = None - self.required = ["id","serviceofferingid",] - -class changeServiceForSystemVmResponse (baseResponse): - def __init__(self): - """the ID of the system VM""" - self.id = None - """the number of active console sessions for the console proxy system vm""" - self.activeviewersessions = None - """the date and time the system VM was created""" - self.created = None - """the first DNS for the system VM""" - self.dns1 = None - """the second DNS for the system VM""" - self.dns2 = None - """the gateway for the system VM""" - self.gateway = None - """the host ID for the system VM""" - self.hostid = None - """the hostname for the system VM""" - self.hostname = None - """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobid = None - """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobstatus = None - """the link local IP address for the system vm""" - self.linklocalip = None - """the link local MAC address for the system vm""" - self.linklocalmacaddress = None - """the link local netmask for the system vm""" - self.linklocalnetmask = None - """the name of the system VM""" - self.name = None - """the network domain for the system VM""" - self.networkdomain = None - """the Pod ID for the system VM""" - self.podid = None - """the private IP address for the system VM""" - self.privateip = None - """the private MAC address for the system VM""" - self.privatemacaddress = None - """the private netmask for the system VM""" - self.privatenetmask = None - """the public IP address for the system VM""" - self.publicip = None - """the public MAC address for the system VM""" - self.publicmacaddress = None - """the public netmask for the system VM""" - self.publicnetmask = None - """the state of the system VM""" - self.state = None - """the system VM type""" - self.systemvmtype = None - """the template ID for the system VM""" - self.templateid = None - """the Zone ID for the system VM""" - self.zoneid = None - """the Zone name for the system VM""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForVirtualMachine.py deleted file mode 100644 index e0d2edeac4b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/changeServiceForVirtualMachine.py +++ /dev/null @@ -1,372 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Changes the service offering for a virtual machine. The virtual machine must be in a "Stopped" state for this command to take effect.""" -from baseCmd import * -from baseResponse import * -class changeServiceForVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """The ID of the virtual machine""" - """Required""" - self.id = None - """the service offering ID to apply to the virtual machine""" - """Required""" - self.serviceofferingid = None - self.required = ["id","serviceofferingid",] - -class changeServiceForVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/cleanVMReservations.py b/tools/marvin/build/lib/marvin/cloudstackAPI/cleanVMReservations.py deleted file mode 100644 index 89113e256ec..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/cleanVMReservations.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. - - -"""Cleanups VM reservations in the database.""" -from baseCmd import * -from baseResponse import * -class cleanVMReservationsCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - self.required = [] - -class cleanVMReservationsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/cloudstackAPIClient.py b/tools/marvin/build/lib/marvin/cloudstackAPI/cloudstackAPIClient.py deleted file mode 100644 index caa457ec2f0..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/cloudstackAPIClient.py +++ /dev/null @@ -1,2513 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -"""Test Client for CloudStack API""" -import copy -from createAccount import createAccountResponse -from deleteAccount import deleteAccountResponse -from updateAccount import updateAccountResponse -from disableAccount import disableAccountResponse -from enableAccount import enableAccountResponse -from lockAccount import lockAccountResponse -from listAccounts import listAccountsResponse -from markDefaultZoneForAccount import markDefaultZoneForAccountResponse -from createUser import createUserResponse -from deleteUser import deleteUserResponse -from updateUser import updateUserResponse -from listUsers import listUsersResponse -from lockUser import lockUserResponse -from disableUser import disableUserResponse -from enableUser import enableUserResponse -from getUser import getUserResponse -from createDomain import createDomainResponse -from updateDomain import updateDomainResponse -from deleteDomain import deleteDomainResponse -from listDomains import listDomainsResponse -from listDomainChildren import listDomainChildrenResponse -from getCloudIdentifier import getCloudIdentifierResponse -from updateResourceLimit import updateResourceLimitResponse -from updateResourceCount import updateResourceCountResponse -from listResourceLimits import listResourceLimitsResponse -from deployVirtualMachine import deployVirtualMachineResponse -from destroyVirtualMachine import destroyVirtualMachineResponse -from rebootVirtualMachine import rebootVirtualMachineResponse -from startVirtualMachine import startVirtualMachineResponse -from stopVirtualMachine import stopVirtualMachineResponse -from resetPasswordForVirtualMachine import resetPasswordForVirtualMachineResponse -from resetSSHKeyForVirtualMachine import resetSSHKeyForVirtualMachineResponse -from updateVirtualMachine import updateVirtualMachineResponse -from listVirtualMachines import listVirtualMachinesResponse -from getVMPassword import getVMPasswordResponse -from restoreVirtualMachine import restoreVirtualMachineResponse -from changeServiceForVirtualMachine import changeServiceForVirtualMachineResponse -from scaleVirtualMachine import scaleVirtualMachineResponse -from assignVirtualMachine import assignVirtualMachineResponse -from migrateVirtualMachine import migrateVirtualMachineResponse -from migrateVirtualMachineWithVolume import migrateVirtualMachineWithVolumeResponse -from recoverVirtualMachine import recoverVirtualMachineResponse -from createSnapshot import createSnapshotResponse -from listSnapshots import listSnapshotsResponse -from deleteSnapshot import deleteSnapshotResponse -from createSnapshotPolicy import createSnapshotPolicyResponse -from deleteSnapshotPolicies import deleteSnapshotPoliciesResponse -from listSnapshotPolicies import listSnapshotPoliciesResponse -from revertSnapshot import revertSnapshotResponse -from createTemplate import createTemplateResponse -from registerTemplate import registerTemplateResponse -from updateTemplate import updateTemplateResponse -from copyTemplate import copyTemplateResponse -from deleteTemplate import deleteTemplateResponse -from listTemplates import listTemplatesResponse -from updateTemplatePermissions import updateTemplatePermissionsResponse -from listTemplatePermissions import listTemplatePermissionsResponse -from extractTemplate import extractTemplateResponse -from prepareTemplate import prepareTemplateResponse -from attachIso import attachIsoResponse -from detachIso import detachIsoResponse -from listIsos import listIsosResponse -from registerIso import registerIsoResponse -from updateIso import updateIsoResponse -from deleteIso import deleteIsoResponse -from copyIso import copyIsoResponse -from updateIsoPermissions import updateIsoPermissionsResponse -from listIsoPermissions import listIsoPermissionsResponse -from extractIso import extractIsoResponse -from listOsTypes import listOsTypesResponse -from listOsCategories import listOsCategoriesResponse -from createServiceOffering import createServiceOfferingResponse -from deleteServiceOffering import deleteServiceOfferingResponse -from updateServiceOffering import updateServiceOfferingResponse -from listServiceOfferings import listServiceOfferingsResponse -from createDiskOffering import createDiskOfferingResponse -from updateDiskOffering import updateDiskOfferingResponse -from deleteDiskOffering import deleteDiskOfferingResponse -from listDiskOfferings import listDiskOfferingsResponse -from createVlanIpRange import createVlanIpRangeResponse -from deleteVlanIpRange import deleteVlanIpRangeResponse -from listVlanIpRanges import listVlanIpRangesResponse -from dedicatePublicIpRange import dedicatePublicIpRangeResponse -from releasePublicIpRange import releasePublicIpRangeResponse -from dedicateGuestVlanRange import dedicateGuestVlanRangeResponse -from releaseDedicatedGuestVlanRange import releaseDedicatedGuestVlanRangeResponse -from listDedicatedGuestVlanRanges import listDedicatedGuestVlanRangesResponse -from associateIpAddress import associateIpAddressResponse -from disassociateIpAddress import disassociateIpAddressResponse -from listPublicIpAddresses import listPublicIpAddressesResponse -from listPortForwardingRules import listPortForwardingRulesResponse -from createPortForwardingRule import createPortForwardingRuleResponse -from deletePortForwardingRule import deletePortForwardingRuleResponse -from updatePortForwardingRule import updatePortForwardingRuleResponse -from enableStaticNat import enableStaticNatResponse -from createIpForwardingRule import createIpForwardingRuleResponse -from deleteIpForwardingRule import deleteIpForwardingRuleResponse -from listIpForwardingRules import listIpForwardingRulesResponse -from disableStaticNat import disableStaticNatResponse -from createLoadBalancerRule import createLoadBalancerRuleResponse -from deleteLoadBalancerRule import deleteLoadBalancerRuleResponse -from removeFromLoadBalancerRule import removeFromLoadBalancerRuleResponse -from assignToLoadBalancerRule import assignToLoadBalancerRuleResponse -from createLBStickinessPolicy import createLBStickinessPolicyResponse -from deleteLBStickinessPolicy import deleteLBStickinessPolicyResponse -from listLoadBalancerRules import listLoadBalancerRulesResponse -from listLBStickinessPolicies import listLBStickinessPoliciesResponse -from listLBHealthCheckPolicies import listLBHealthCheckPoliciesResponse -from createLBHealthCheckPolicy import createLBHealthCheckPolicyResponse -from deleteLBHealthCheckPolicy import deleteLBHealthCheckPolicyResponse -from listLoadBalancerRuleInstances import listLoadBalancerRuleInstancesResponse -from updateLoadBalancerRule import updateLoadBalancerRuleResponse -from createCounter import createCounterResponse -from createCondition import createConditionResponse -from createAutoScalePolicy import createAutoScalePolicyResponse -from createAutoScaleVmProfile import createAutoScaleVmProfileResponse -from createAutoScaleVmGroup import createAutoScaleVmGroupResponse -from deleteCounter import deleteCounterResponse -from deleteCondition import deleteConditionResponse -from deleteAutoScalePolicy import deleteAutoScalePolicyResponse -from deleteAutoScaleVmProfile import deleteAutoScaleVmProfileResponse -from deleteAutoScaleVmGroup import deleteAutoScaleVmGroupResponse -from listCounters import listCountersResponse -from listConditions import listConditionsResponse -from listAutoScalePolicies import listAutoScalePoliciesResponse -from listAutoScaleVmProfiles import listAutoScaleVmProfilesResponse -from listAutoScaleVmGroups import listAutoScaleVmGroupsResponse -from enableAutoScaleVmGroup import enableAutoScaleVmGroupResponse -from disableAutoScaleVmGroup import disableAutoScaleVmGroupResponse -from updateAutoScalePolicy import updateAutoScalePolicyResponse -from updateAutoScaleVmProfile import updateAutoScaleVmProfileResponse -from updateAutoScaleVmGroup import updateAutoScaleVmGroupResponse -from startRouter import startRouterResponse -from rebootRouter import rebootRouterResponse -from stopRouter import stopRouterResponse -from destroyRouter import destroyRouterResponse -from changeServiceForRouter import changeServiceForRouterResponse -from listRouters import listRoutersResponse -from listVirtualRouterElements import listVirtualRouterElementsResponse -from configureVirtualRouterElement import configureVirtualRouterElementResponse -from createVirtualRouterElement import createVirtualRouterElementResponse -from startSystemVm import startSystemVmResponse -from rebootSystemVm import rebootSystemVmResponse -from stopSystemVm import stopSystemVmResponse -from destroySystemVm import destroySystemVmResponse -from listSystemVms import listSystemVmsResponse -from migrateSystemVm import migrateSystemVmResponse -from changeServiceForSystemVm import changeServiceForSystemVmResponse -from scaleSystemVm import scaleSystemVmResponse -from updateConfiguration import updateConfigurationResponse -from listConfigurations import listConfigurationsResponse -from listCapabilities import listCapabilitiesResponse -from listDeploymentPlanners import listDeploymentPlannersResponse -from cleanVMReservations import cleanVMReservationsResponse -from createPod import createPodResponse -from updatePod import updatePodResponse -from deletePod import deletePodResponse -from listPods import listPodsResponse -from createZone import createZoneResponse -from updateZone import updateZoneResponse -from deleteZone import deleteZoneResponse -from listZones import listZonesResponse -from listEvents import listEventsResponse -from listEventTypes import listEventTypesResponse -from archiveEvents import archiveEventsResponse -from deleteEvents import deleteEventsResponse -from listAlerts import listAlertsResponse -from archiveAlerts import archiveAlertsResponse -from deleteAlerts import deleteAlertsResponse -from listCapacity import listCapacityResponse -from addSwift import addSwiftResponse -from listSwifts import listSwiftsResponse -from addS3 import addS3Response -from listS3s import listS3sResponse -from addImageStore import addImageStoreResponse -from listImageStores import listImageStoresResponse -from deleteImageStore import deleteImageStoreResponse -from createSecondaryStagingStore import createSecondaryStagingStoreResponse -from listSecondaryStagingStores import listSecondaryStagingStoresResponse -from deleteSecondaryStagingStore import deleteSecondaryStagingStoreResponse -from addHost import addHostResponse -from addCluster import addClusterResponse -from deleteCluster import deleteClusterResponse -from updateCluster import updateClusterResponse -from reconnectHost import reconnectHostResponse -from updateHost import updateHostResponse -from deleteHost import deleteHostResponse -from prepareHostForMaintenance import prepareHostForMaintenanceResponse -from cancelHostMaintenance import cancelHostMaintenanceResponse -from listHosts import listHostsResponse -from findHostsForMigration import findHostsForMigrationResponse -from addSecondaryStorage import addSecondaryStorageResponse -from updateHostPassword import updateHostPasswordResponse -from releaseHostReservation import releaseHostReservationResponse -from attachVolume import attachVolumeResponse -from uploadVolume import uploadVolumeResponse -from detachVolume import detachVolumeResponse -from createVolume import createVolumeResponse -from deleteVolume import deleteVolumeResponse -from listVolumes import listVolumesResponse -from extractVolume import extractVolumeResponse -from migrateVolume import migrateVolumeResponse -from resizeVolume import resizeVolumeResponse -from updateVolume import updateVolumeResponse -from registerUserKeys import registerUserKeysResponse -from queryAsyncJobResult import queryAsyncJobResultResponse -from listAsyncJobs import listAsyncJobsResponse -from listStoragePools import listStoragePoolsResponse -from listStorageProviders import listStorageProvidersResponse -from createStoragePool import createStoragePoolResponse -from updateStoragePool import updateStoragePoolResponse -from deleteStoragePool import deleteStoragePoolResponse -from listClusters import listClustersResponse -from enableStorageMaintenance import enableStorageMaintenanceResponse -from cancelStorageMaintenance import cancelStorageMaintenanceResponse -from findStoragePoolsForMigration import findStoragePoolsForMigrationResponse -from createSecurityGroup import createSecurityGroupResponse -from deleteSecurityGroup import deleteSecurityGroupResponse -from authorizeSecurityGroupIngress import authorizeSecurityGroupIngressResponse -from revokeSecurityGroupIngress import revokeSecurityGroupIngressResponse -from authorizeSecurityGroupEgress import authorizeSecurityGroupEgressResponse -from revokeSecurityGroupEgress import revokeSecurityGroupEgressResponse -from listSecurityGroups import listSecurityGroupsResponse -from createInstanceGroup import createInstanceGroupResponse -from deleteInstanceGroup import deleteInstanceGroupResponse -from updateInstanceGroup import updateInstanceGroupResponse -from listInstanceGroups import listInstanceGroupsResponse -from uploadCustomCertificate import uploadCustomCertificateResponse -from listHypervisors import listHypervisorsResponse -from createRemoteAccessVpn import createRemoteAccessVpnResponse -from deleteRemoteAccessVpn import deleteRemoteAccessVpnResponse -from listRemoteAccessVpns import listRemoteAccessVpnsResponse -from addVpnUser import addVpnUserResponse -from removeVpnUser import removeVpnUserResponse -from listVpnUsers import listVpnUsersResponse -from createNetworkOffering import createNetworkOfferingResponse -from updateNetworkOffering import updateNetworkOfferingResponse -from deleteNetworkOffering import deleteNetworkOfferingResponse -from listNetworkOfferings import listNetworkOfferingsResponse -from createNetwork import createNetworkResponse -from deleteNetwork import deleteNetworkResponse -from listNetworks import listNetworksResponse -from restartNetwork import restartNetworkResponse -from updateNetwork import updateNetworkResponse -from addNicToVirtualMachine import addNicToVirtualMachineResponse -from removeNicFromVirtualMachine import removeNicFromVirtualMachineResponse -from updateDefaultNicForVirtualMachine import updateDefaultNicForVirtualMachineResponse -from addIpToNic import addIpToNicResponse -from removeIpFromNic import removeIpFromNicResponse -from listNics import listNicsResponse -from registerSSHKeyPair import registerSSHKeyPairResponse -from createSSHKeyPair import createSSHKeyPairResponse -from deleteSSHKeyPair import deleteSSHKeyPairResponse -from listSSHKeyPairs import listSSHKeyPairsResponse -from createProject import createProjectResponse -from deleteProject import deleteProjectResponse -from updateProject import updateProjectResponse -from activateProject import activateProjectResponse -from suspendProject import suspendProjectResponse -from listProjects import listProjectsResponse -from addAccountToProject import addAccountToProjectResponse -from deleteAccountFromProject import deleteAccountFromProjectResponse -from listProjectAccounts import listProjectAccountsResponse -from listProjectInvitations import listProjectInvitationsResponse -from updateProjectInvitation import updateProjectInvitationResponse -from deleteProjectInvitation import deleteProjectInvitationResponse -from createFirewallRule import createFirewallRuleResponse -from deleteFirewallRule import deleteFirewallRuleResponse -from listFirewallRules import listFirewallRulesResponse -from createEgressFirewallRule import createEgressFirewallRuleResponse -from deleteEgressFirewallRule import deleteEgressFirewallRuleResponse -from listEgressFirewallRules import listEgressFirewallRulesResponse -from updateHypervisorCapabilities import updateHypervisorCapabilitiesResponse -from listHypervisorCapabilities import listHypervisorCapabilitiesResponse -from createPhysicalNetwork import createPhysicalNetworkResponse -from deletePhysicalNetwork import deletePhysicalNetworkResponse -from listPhysicalNetworks import listPhysicalNetworksResponse -from updatePhysicalNetwork import updatePhysicalNetworkResponse -from listSupportedNetworkServices import listSupportedNetworkServicesResponse -from addNetworkServiceProvider import addNetworkServiceProviderResponse -from deleteNetworkServiceProvider import deleteNetworkServiceProviderResponse -from listNetworkServiceProviders import listNetworkServiceProvidersResponse -from updateNetworkServiceProvider import updateNetworkServiceProviderResponse -from addTrafficType import addTrafficTypeResponse -from deleteTrafficType import deleteTrafficTypeResponse -from listTrafficTypes import listTrafficTypesResponse -from updateTrafficType import updateTrafficTypeResponse -from listTrafficTypeImplementors import listTrafficTypeImplementorsResponse -from createStorageNetworkIpRange import createStorageNetworkIpRangeResponse -from deleteStorageNetworkIpRange import deleteStorageNetworkIpRangeResponse -from listStorageNetworkIpRange import listStorageNetworkIpRangeResponse -from updateStorageNetworkIpRange import updateStorageNetworkIpRangeResponse -from addNetworkDevice import addNetworkDeviceResponse -from listNetworkDevice import listNetworkDeviceResponse -from deleteNetworkDevice import deleteNetworkDeviceResponse -from createVPC import createVPCResponse -from listVPCs import listVPCsResponse -from deleteVPC import deleteVPCResponse -from updateVPC import updateVPCResponse -from restartVPC import restartVPCResponse -from createVPCOffering import createVPCOfferingResponse -from updateVPCOffering import updateVPCOfferingResponse -from deleteVPCOffering import deleteVPCOfferingResponse -from listVPCOfferings import listVPCOfferingsResponse -from createPrivateGateway import createPrivateGatewayResponse -from listPrivateGateways import listPrivateGatewaysResponse -from deletePrivateGateway import deletePrivateGatewayResponse -from createNetworkACL import createNetworkACLResponse -from updateNetworkACLItem import updateNetworkACLItemResponse -from deleteNetworkACL import deleteNetworkACLResponse -from listNetworkACLs import listNetworkACLsResponse -from createNetworkACLList import createNetworkACLListResponse -from deleteNetworkACLList import deleteNetworkACLListResponse -from replaceNetworkACLList import replaceNetworkACLListResponse -from listNetworkACLLists import listNetworkACLListsResponse -from createStaticRoute import createStaticRouteResponse -from deleteStaticRoute import deleteStaticRouteResponse -from listStaticRoutes import listStaticRoutesResponse -from createTags import createTagsResponse -from deleteTags import deleteTagsResponse -from listTags import listTagsResponse -from addResourceDetail import addResourceDetailResponse -from removeResourceDetail import removeResourceDetailResponse -from listResourceDetails import listResourceDetailsResponse -from createVpnCustomerGateway import createVpnCustomerGatewayResponse -from createVpnGateway import createVpnGatewayResponse -from createVpnConnection import createVpnConnectionResponse -from deleteVpnCustomerGateway import deleteVpnCustomerGatewayResponse -from deleteVpnGateway import deleteVpnGatewayResponse -from deleteVpnConnection import deleteVpnConnectionResponse -from updateVpnCustomerGateway import updateVpnCustomerGatewayResponse -from resetVpnConnection import resetVpnConnectionResponse -from listVpnCustomerGateways import listVpnCustomerGatewaysResponse -from listVpnGateways import listVpnGatewaysResponse -from listVpnConnections import listVpnConnectionsResponse -from generateUsageRecords import generateUsageRecordsResponse -from listUsageRecords import listUsageRecordsResponse -from listUsageTypes import listUsageTypesResponse -from addTrafficMonitor import addTrafficMonitorResponse -from deleteTrafficMonitor import deleteTrafficMonitorResponse -from listTrafficMonitors import listTrafficMonitorsResponse -from addNiciraNvpDevice import addNiciraNvpDeviceResponse -from deleteNiciraNvpDevice import deleteNiciraNvpDeviceResponse -from listNiciraNvpDevices import listNiciraNvpDevicesResponse -from listNiciraNvpDeviceNetworks import listNiciraNvpDeviceNetworksResponse -from addBigSwitchVnsDevice import addBigSwitchVnsDeviceResponse -from deleteBigSwitchVnsDevice import deleteBigSwitchVnsDeviceResponse -from listBigSwitchVnsDevices import listBigSwitchVnsDevicesResponse -from listApis import listApisResponse -from getApiLimit import getApiLimitResponse -from resetApiLimit import resetApiLimitResponse -from addRegion import addRegionResponse -from updateRegion import updateRegionResponse -from removeRegion import removeRegionResponse -from listRegions import listRegionsResponse -from createGlobalLoadBalancerRule import createGlobalLoadBalancerRuleResponse -from deleteGlobalLoadBalancerRule import deleteGlobalLoadBalancerRuleResponse -from updateGlobalLoadBalancerRule import updateGlobalLoadBalancerRuleResponse -from listGlobalLoadBalancerRules import listGlobalLoadBalancerRulesResponse -from assignToGlobalLoadBalancerRule import assignToGlobalLoadBalancerRuleResponse -from removeFromGlobalLoadBalancerRule import removeFromGlobalLoadBalancerRuleResponse -from listVMSnapshot import listVMSnapshotResponse -from createVMSnapshot import createVMSnapshotResponse -from deleteVMSnapshot import deleteVMSnapshotResponse -from revertToVMSnapshot import revertToVMSnapshotResponse -from addBaremetalHost import addBaremetalHostResponse -from addBaremetalPxeKickStartServer import addBaremetalPxeKickStartServerResponse -from addBaremetalPxePingServer import addBaremetalPxePingServerResponse -from addBaremetalDhcp import addBaremetalDhcpResponse -from listBaremetalDhcp import listBaremetalDhcpResponse -from listBaremetalPxeServers import listBaremetalPxeServersResponse -from addUcsManager import addUcsManagerResponse -from listUcsManagers import listUcsManagersResponse -from listUcsProfiles import listUcsProfilesResponse -from listUcsBlades import listUcsBladesResponse -from associateUcsProfileToBlade import associateUcsProfileToBladeResponse -from createLoadBalancer import createLoadBalancerResponse -from listLoadBalancers import listLoadBalancersResponse -from deleteLoadBalancer import deleteLoadBalancerResponse -from configureInternalLoadBalancerElement import configureInternalLoadBalancerElementResponse -from createInternalLoadBalancerElement import createInternalLoadBalancerElementResponse -from listInternalLoadBalancerElements import listInternalLoadBalancerElementsResponse -from createAffinityGroup import createAffinityGroupResponse -from deleteAffinityGroup import deleteAffinityGroupResponse -from listAffinityGroups import listAffinityGroupsResponse -from updateVMAffinityGroup import updateVMAffinityGroupResponse -from listAffinityGroupTypes import listAffinityGroupTypesResponse -from createPortableIpRange import createPortableIpRangeResponse -from deletePortableIpRange import deletePortableIpRangeResponse -from listPortableIpRanges import listPortableIpRangesResponse -from stopInternalLoadBalancerVM import stopInternalLoadBalancerVMResponse -from startInternalLoadBalancerVM import startInternalLoadBalancerVMResponse -from listInternalLoadBalancerVMs import listInternalLoadBalancerVMsResponse -from listNetworkIsolationMethods import listNetworkIsolationMethodsResponse -from dedicateZone import dedicateZoneResponse -from dedicatePod import dedicatePodResponse -from dedicateCluster import dedicateClusterResponse -from dedicateHost import dedicateHostResponse -from releaseDedicatedZone import releaseDedicatedZoneResponse -from releaseDedicatedPod import releaseDedicatedPodResponse -from releaseDedicatedCluster import releaseDedicatedClusterResponse -from releaseDedicatedHost import releaseDedicatedHostResponse -from listDedicatedZones import listDedicatedZonesResponse -from listDedicatedPods import listDedicatedPodsResponse -from listDedicatedClusters import listDedicatedClustersResponse -from listDedicatedHosts import listDedicatedHostsResponse -from listLdapConfigurations import listLdapConfigurationsResponse -from addLdapConfiguration import addLdapConfigurationResponse -from deleteLdapConfiguration import deleteLdapConfigurationResponse -from listLdapUsers import listLdapUsersResponse -from ldapCreateAccount import ldapCreateAccountResponse -from login import loginResponse -from logout import logoutResponse -class CloudStackAPIClient(object): - def __init__(self, connection): - self.connection = connection - self._id = None - - def __copy__(self): - return CloudStackAPIClient(copy.copy(self.connection)) - - @property - def id(self): - return self._id - - @id.setter - def id(self, identifier): - self._id = identifier - - def createAccount(self, command, method="GET"): - response = createAccountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteAccount(self, command, method="GET"): - response = deleteAccountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateAccount(self, command, method="GET"): - response = updateAccountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def disableAccount(self, command, method="GET"): - response = disableAccountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def enableAccount(self, command, method="GET"): - response = enableAccountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def lockAccount(self, command, method="GET"): - response = lockAccountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listAccounts(self, command, method="GET"): - response = listAccountsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def markDefaultZoneForAccount(self, command, method="GET"): - response = markDefaultZoneForAccountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createUser(self, command, method="GET"): - response = createUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteUser(self, command, method="GET"): - response = deleteUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateUser(self, command, method="GET"): - response = updateUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listUsers(self, command, method="GET"): - response = listUsersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def lockUser(self, command, method="GET"): - response = lockUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def disableUser(self, command, method="GET"): - response = disableUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def enableUser(self, command, method="GET"): - response = enableUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def getUser(self, command, method="GET"): - response = getUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createDomain(self, command, method="GET"): - response = createDomainResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateDomain(self, command, method="GET"): - response = updateDomainResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteDomain(self, command, method="GET"): - response = deleteDomainResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDomains(self, command, method="GET"): - response = listDomainsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDomainChildren(self, command, method="GET"): - response = listDomainChildrenResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def getCloudIdentifier(self, command, method="GET"): - response = getCloudIdentifierResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateResourceLimit(self, command, method="GET"): - response = updateResourceLimitResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateResourceCount(self, command, method="GET"): - response = updateResourceCountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listResourceLimits(self, command, method="GET"): - response = listResourceLimitsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deployVirtualMachine(self, command, method="GET"): - response = deployVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def destroyVirtualMachine(self, command, method="GET"): - response = destroyVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def rebootVirtualMachine(self, command, method="GET"): - response = rebootVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def startVirtualMachine(self, command, method="GET"): - response = startVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def stopVirtualMachine(self, command, method="GET"): - response = stopVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def resetPasswordForVirtualMachine(self, command, method="GET"): - response = resetPasswordForVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def resetSSHKeyForVirtualMachine(self, command, method="GET"): - response = resetSSHKeyForVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateVirtualMachine(self, command, method="GET"): - response = updateVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVirtualMachines(self, command, method="GET"): - response = listVirtualMachinesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def getVMPassword(self, command, method="GET"): - response = getVMPasswordResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def restoreVirtualMachine(self, command, method="GET"): - response = restoreVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def changeServiceForVirtualMachine(self, command, method="GET"): - response = changeServiceForVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def scaleVirtualMachine(self, command, method="GET"): - response = scaleVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def assignVirtualMachine(self, command, method="GET"): - response = assignVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def migrateVirtualMachine(self, command, method="GET"): - response = migrateVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def migrateVirtualMachineWithVolume(self, command, method="GET"): - response = migrateVirtualMachineWithVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def recoverVirtualMachine(self, command, method="GET"): - response = recoverVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createSnapshot(self, command, method="GET"): - response = createSnapshotResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listSnapshots(self, command, method="GET"): - response = listSnapshotsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteSnapshot(self, command, method="GET"): - response = deleteSnapshotResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createSnapshotPolicy(self, command, method="GET"): - response = createSnapshotPolicyResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteSnapshotPolicies(self, command, method="GET"): - response = deleteSnapshotPoliciesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listSnapshotPolicies(self, command, method="GET"): - response = listSnapshotPoliciesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def revertSnapshot(self, command, method="GET"): - response = revertSnapshotResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createTemplate(self, command, method="GET"): - response = createTemplateResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def registerTemplate(self, command, method="GET"): - response = registerTemplateResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateTemplate(self, command, method="GET"): - response = updateTemplateResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def copyTemplate(self, command, method="GET"): - response = copyTemplateResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteTemplate(self, command, method="GET"): - response = deleteTemplateResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listTemplates(self, command, method="GET"): - response = listTemplatesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateTemplatePermissions(self, command, method="GET"): - response = updateTemplatePermissionsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listTemplatePermissions(self, command, method="GET"): - response = listTemplatePermissionsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def extractTemplate(self, command, method="GET"): - response = extractTemplateResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def prepareTemplate(self, command, method="GET"): - response = prepareTemplateResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def attachIso(self, command, method="GET"): - response = attachIsoResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def detachIso(self, command, method="GET"): - response = detachIsoResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listIsos(self, command, method="GET"): - response = listIsosResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def registerIso(self, command, method="GET"): - response = registerIsoResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateIso(self, command, method="GET"): - response = updateIsoResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteIso(self, command, method="GET"): - response = deleteIsoResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def copyIso(self, command, method="GET"): - response = copyIsoResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateIsoPermissions(self, command, method="GET"): - response = updateIsoPermissionsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listIsoPermissions(self, command, method="GET"): - response = listIsoPermissionsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def extractIso(self, command, method="GET"): - response = extractIsoResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listOsTypes(self, command, method="GET"): - response = listOsTypesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listOsCategories(self, command, method="GET"): - response = listOsCategoriesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createServiceOffering(self, command, method="GET"): - response = createServiceOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteServiceOffering(self, command, method="GET"): - response = deleteServiceOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateServiceOffering(self, command, method="GET"): - response = updateServiceOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listServiceOfferings(self, command, method="GET"): - response = listServiceOfferingsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createDiskOffering(self, command, method="GET"): - response = createDiskOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateDiskOffering(self, command, method="GET"): - response = updateDiskOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteDiskOffering(self, command, method="GET"): - response = deleteDiskOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDiskOfferings(self, command, method="GET"): - response = listDiskOfferingsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVlanIpRange(self, command, method="GET"): - response = createVlanIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteVlanIpRange(self, command, method="GET"): - response = deleteVlanIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVlanIpRanges(self, command, method="GET"): - response = listVlanIpRangesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def dedicatePublicIpRange(self, command, method="GET"): - response = dedicatePublicIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def releasePublicIpRange(self, command, method="GET"): - response = releasePublicIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def dedicateGuestVlanRange(self, command, method="GET"): - response = dedicateGuestVlanRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def releaseDedicatedGuestVlanRange(self, command, method="GET"): - response = releaseDedicatedGuestVlanRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDedicatedGuestVlanRanges(self, command, method="GET"): - response = listDedicatedGuestVlanRangesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def associateIpAddress(self, command, method="GET"): - response = associateIpAddressResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def disassociateIpAddress(self, command, method="GET"): - response = disassociateIpAddressResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listPublicIpAddresses(self, command, method="GET"): - response = listPublicIpAddressesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listPortForwardingRules(self, command, method="GET"): - response = listPortForwardingRulesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createPortForwardingRule(self, command, method="GET"): - response = createPortForwardingRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deletePortForwardingRule(self, command, method="GET"): - response = deletePortForwardingRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updatePortForwardingRule(self, command, method="GET"): - response = updatePortForwardingRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def enableStaticNat(self, command, method="GET"): - response = enableStaticNatResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createIpForwardingRule(self, command, method="GET"): - response = createIpForwardingRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteIpForwardingRule(self, command, method="GET"): - response = deleteIpForwardingRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listIpForwardingRules(self, command, method="GET"): - response = listIpForwardingRulesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def disableStaticNat(self, command, method="GET"): - response = disableStaticNatResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createLoadBalancerRule(self, command, method="GET"): - response = createLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteLoadBalancerRule(self, command, method="GET"): - response = deleteLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def removeFromLoadBalancerRule(self, command, method="GET"): - response = removeFromLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def assignToLoadBalancerRule(self, command, method="GET"): - response = assignToLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createLBStickinessPolicy(self, command, method="GET"): - response = createLBStickinessPolicyResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteLBStickinessPolicy(self, command, method="GET"): - response = deleteLBStickinessPolicyResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listLoadBalancerRules(self, command, method="GET"): - response = listLoadBalancerRulesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listLBStickinessPolicies(self, command, method="GET"): - response = listLBStickinessPoliciesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listLBHealthCheckPolicies(self, command, method="GET"): - response = listLBHealthCheckPoliciesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createLBHealthCheckPolicy(self, command, method="GET"): - response = createLBHealthCheckPolicyResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteLBHealthCheckPolicy(self, command, method="GET"): - response = deleteLBHealthCheckPolicyResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listLoadBalancerRuleInstances(self, command, method="GET"): - response = listLoadBalancerRuleInstancesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateLoadBalancerRule(self, command, method="GET"): - response = updateLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createCounter(self, command, method="GET"): - response = createCounterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createCondition(self, command, method="GET"): - response = createConditionResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createAutoScalePolicy(self, command, method="GET"): - response = createAutoScalePolicyResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createAutoScaleVmProfile(self, command, method="GET"): - response = createAutoScaleVmProfileResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createAutoScaleVmGroup(self, command, method="GET"): - response = createAutoScaleVmGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteCounter(self, command, method="GET"): - response = deleteCounterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteCondition(self, command, method="GET"): - response = deleteConditionResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteAutoScalePolicy(self, command, method="GET"): - response = deleteAutoScalePolicyResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteAutoScaleVmProfile(self, command, method="GET"): - response = deleteAutoScaleVmProfileResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteAutoScaleVmGroup(self, command, method="GET"): - response = deleteAutoScaleVmGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listCounters(self, command, method="GET"): - response = listCountersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listConditions(self, command, method="GET"): - response = listConditionsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listAutoScalePolicies(self, command, method="GET"): - response = listAutoScalePoliciesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listAutoScaleVmProfiles(self, command, method="GET"): - response = listAutoScaleVmProfilesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listAutoScaleVmGroups(self, command, method="GET"): - response = listAutoScaleVmGroupsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def enableAutoScaleVmGroup(self, command, method="GET"): - response = enableAutoScaleVmGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def disableAutoScaleVmGroup(self, command, method="GET"): - response = disableAutoScaleVmGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateAutoScalePolicy(self, command, method="GET"): - response = updateAutoScalePolicyResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateAutoScaleVmProfile(self, command, method="GET"): - response = updateAutoScaleVmProfileResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateAutoScaleVmGroup(self, command, method="GET"): - response = updateAutoScaleVmGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def startRouter(self, command, method="GET"): - response = startRouterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def rebootRouter(self, command, method="GET"): - response = rebootRouterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def stopRouter(self, command, method="GET"): - response = stopRouterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def destroyRouter(self, command, method="GET"): - response = destroyRouterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def changeServiceForRouter(self, command, method="GET"): - response = changeServiceForRouterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listRouters(self, command, method="GET"): - response = listRoutersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVirtualRouterElements(self, command, method="GET"): - response = listVirtualRouterElementsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def configureVirtualRouterElement(self, command, method="GET"): - response = configureVirtualRouterElementResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVirtualRouterElement(self, command, method="GET"): - response = createVirtualRouterElementResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def startSystemVm(self, command, method="GET"): - response = startSystemVmResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def rebootSystemVm(self, command, method="GET"): - response = rebootSystemVmResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def stopSystemVm(self, command, method="GET"): - response = stopSystemVmResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def destroySystemVm(self, command, method="GET"): - response = destroySystemVmResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listSystemVms(self, command, method="GET"): - response = listSystemVmsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def migrateSystemVm(self, command, method="GET"): - response = migrateSystemVmResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def changeServiceForSystemVm(self, command, method="GET"): - response = changeServiceForSystemVmResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def scaleSystemVm(self, command, method="GET"): - response = scaleSystemVmResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateConfiguration(self, command, method="GET"): - response = updateConfigurationResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listConfigurations(self, command, method="GET"): - response = listConfigurationsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listCapabilities(self, command, method="GET"): - response = listCapabilitiesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDeploymentPlanners(self, command, method="GET"): - response = listDeploymentPlannersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def cleanVMReservations(self, command, method="GET"): - response = cleanVMReservationsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createPod(self, command, method="GET"): - response = createPodResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updatePod(self, command, method="GET"): - response = updatePodResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deletePod(self, command, method="GET"): - response = deletePodResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listPods(self, command, method="GET"): - response = listPodsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createZone(self, command, method="GET"): - response = createZoneResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateZone(self, command, method="GET"): - response = updateZoneResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteZone(self, command, method="GET"): - response = deleteZoneResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listZones(self, command, method="GET"): - response = listZonesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listEvents(self, command, method="GET"): - response = listEventsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listEventTypes(self, command, method="GET"): - response = listEventTypesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def archiveEvents(self, command, method="GET"): - response = archiveEventsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteEvents(self, command, method="GET"): - response = deleteEventsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listAlerts(self, command, method="GET"): - response = listAlertsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def archiveAlerts(self, command, method="GET"): - response = archiveAlertsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteAlerts(self, command, method="GET"): - response = deleteAlertsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listCapacity(self, command, method="GET"): - response = listCapacityResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addSwift(self, command, method="GET"): - response = addSwiftResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listSwifts(self, command, method="GET"): - response = listSwiftsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addS3(self, command, method="GET"): - response = addS3Response() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listS3s(self, command, method="GET"): - response = listS3sResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addImageStore(self, command, method="GET"): - response = addImageStoreResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listImageStores(self, command, method="GET"): - response = listImageStoresResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteImageStore(self, command, method="GET"): - response = deleteImageStoreResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createSecondaryStagingStore(self, command, method="GET"): - response = createSecondaryStagingStoreResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listSecondaryStagingStores(self, command, method="GET"): - response = listSecondaryStagingStoresResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteSecondaryStagingStore(self, command, method="GET"): - response = deleteSecondaryStagingStoreResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addHost(self, command, method="GET"): - response = addHostResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addCluster(self, command, method="GET"): - response = addClusterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteCluster(self, command, method="GET"): - response = deleteClusterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateCluster(self, command, method="GET"): - response = updateClusterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def reconnectHost(self, command, method="GET"): - response = reconnectHostResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateHost(self, command, method="GET"): - response = updateHostResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteHost(self, command, method="GET"): - response = deleteHostResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def prepareHostForMaintenance(self, command, method="GET"): - response = prepareHostForMaintenanceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def cancelHostMaintenance(self, command, method="GET"): - response = cancelHostMaintenanceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listHosts(self, command, method="GET"): - response = listHostsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def findHostsForMigration(self, command, method="GET"): - response = findHostsForMigrationResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addSecondaryStorage(self, command, method="GET"): - response = addSecondaryStorageResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateHostPassword(self, command, method="GET"): - response = updateHostPasswordResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def releaseHostReservation(self, command, method="GET"): - response = releaseHostReservationResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def attachVolume(self, command, method="GET"): - response = attachVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def uploadVolume(self, command, method="GET"): - response = uploadVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def detachVolume(self, command, method="GET"): - response = detachVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVolume(self, command, method="GET"): - response = createVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteVolume(self, command, method="GET"): - response = deleteVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVolumes(self, command, method="GET"): - response = listVolumesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def extractVolume(self, command, method="GET"): - response = extractVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def migrateVolume(self, command, method="GET"): - response = migrateVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def resizeVolume(self, command, method="GET"): - response = resizeVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateVolume(self, command, method="GET"): - response = updateVolumeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def registerUserKeys(self, command, method="GET"): - response = registerUserKeysResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def queryAsyncJobResult(self, command, method="GET"): - response = queryAsyncJobResultResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listAsyncJobs(self, command, method="GET"): - response = listAsyncJobsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listStoragePools(self, command, method="GET"): - response = listStoragePoolsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listStorageProviders(self, command, method="GET"): - response = listStorageProvidersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createStoragePool(self, command, method="GET"): - response = createStoragePoolResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateStoragePool(self, command, method="GET"): - response = updateStoragePoolResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteStoragePool(self, command, method="GET"): - response = deleteStoragePoolResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listClusters(self, command, method="GET"): - response = listClustersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def enableStorageMaintenance(self, command, method="GET"): - response = enableStorageMaintenanceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def cancelStorageMaintenance(self, command, method="GET"): - response = cancelStorageMaintenanceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def findStoragePoolsForMigration(self, command, method="GET"): - response = findStoragePoolsForMigrationResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createSecurityGroup(self, command, method="GET"): - response = createSecurityGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteSecurityGroup(self, command, method="GET"): - response = deleteSecurityGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def authorizeSecurityGroupIngress(self, command, method="GET"): - response = authorizeSecurityGroupIngressResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def revokeSecurityGroupIngress(self, command, method="GET"): - response = revokeSecurityGroupIngressResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def authorizeSecurityGroupEgress(self, command, method="GET"): - response = authorizeSecurityGroupEgressResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def revokeSecurityGroupEgress(self, command, method="GET"): - response = revokeSecurityGroupEgressResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listSecurityGroups(self, command, method="GET"): - response = listSecurityGroupsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createInstanceGroup(self, command, method="GET"): - response = createInstanceGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteInstanceGroup(self, command, method="GET"): - response = deleteInstanceGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateInstanceGroup(self, command, method="GET"): - response = updateInstanceGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listInstanceGroups(self, command, method="GET"): - response = listInstanceGroupsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def uploadCustomCertificate(self, command, method="GET"): - response = uploadCustomCertificateResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listHypervisors(self, command, method="GET"): - response = listHypervisorsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createRemoteAccessVpn(self, command, method="GET"): - response = createRemoteAccessVpnResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteRemoteAccessVpn(self, command, method="GET"): - response = deleteRemoteAccessVpnResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listRemoteAccessVpns(self, command, method="GET"): - response = listRemoteAccessVpnsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addVpnUser(self, command, method="GET"): - response = addVpnUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def removeVpnUser(self, command, method="GET"): - response = removeVpnUserResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVpnUsers(self, command, method="GET"): - response = listVpnUsersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createNetworkOffering(self, command, method="GET"): - response = createNetworkOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateNetworkOffering(self, command, method="GET"): - response = updateNetworkOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteNetworkOffering(self, command, method="GET"): - response = deleteNetworkOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNetworkOfferings(self, command, method="GET"): - response = listNetworkOfferingsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createNetwork(self, command, method="GET"): - response = createNetworkResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteNetwork(self, command, method="GET"): - response = deleteNetworkResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNetworks(self, command, method="GET"): - response = listNetworksResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def restartNetwork(self, command, method="GET"): - response = restartNetworkResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateNetwork(self, command, method="GET"): - response = updateNetworkResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addNicToVirtualMachine(self, command, method="GET"): - response = addNicToVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def removeNicFromVirtualMachine(self, command, method="GET"): - response = removeNicFromVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateDefaultNicForVirtualMachine(self, command, method="GET"): - response = updateDefaultNicForVirtualMachineResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addIpToNic(self, command, method="GET"): - response = addIpToNicResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def removeIpFromNic(self, command, method="GET"): - response = removeIpFromNicResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNics(self, command, method="GET"): - response = listNicsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def registerSSHKeyPair(self, command, method="GET"): - response = registerSSHKeyPairResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createSSHKeyPair(self, command, method="GET"): - response = createSSHKeyPairResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteSSHKeyPair(self, command, method="GET"): - response = deleteSSHKeyPairResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listSSHKeyPairs(self, command, method="GET"): - response = listSSHKeyPairsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createProject(self, command, method="GET"): - response = createProjectResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteProject(self, command, method="GET"): - response = deleteProjectResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateProject(self, command, method="GET"): - response = updateProjectResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def activateProject(self, command, method="GET"): - response = activateProjectResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def suspendProject(self, command, method="GET"): - response = suspendProjectResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listProjects(self, command, method="GET"): - response = listProjectsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addAccountToProject(self, command, method="GET"): - response = addAccountToProjectResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteAccountFromProject(self, command, method="GET"): - response = deleteAccountFromProjectResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listProjectAccounts(self, command, method="GET"): - response = listProjectAccountsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listProjectInvitations(self, command, method="GET"): - response = listProjectInvitationsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateProjectInvitation(self, command, method="GET"): - response = updateProjectInvitationResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteProjectInvitation(self, command, method="GET"): - response = deleteProjectInvitationResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createFirewallRule(self, command, method="GET"): - response = createFirewallRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteFirewallRule(self, command, method="GET"): - response = deleteFirewallRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listFirewallRules(self, command, method="GET"): - response = listFirewallRulesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createEgressFirewallRule(self, command, method="GET"): - response = createEgressFirewallRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteEgressFirewallRule(self, command, method="GET"): - response = deleteEgressFirewallRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listEgressFirewallRules(self, command, method="GET"): - response = listEgressFirewallRulesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateHypervisorCapabilities(self, command, method="GET"): - response = updateHypervisorCapabilitiesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listHypervisorCapabilities(self, command, method="GET"): - response = listHypervisorCapabilitiesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createPhysicalNetwork(self, command, method="GET"): - response = createPhysicalNetworkResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deletePhysicalNetwork(self, command, method="GET"): - response = deletePhysicalNetworkResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listPhysicalNetworks(self, command, method="GET"): - response = listPhysicalNetworksResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updatePhysicalNetwork(self, command, method="GET"): - response = updatePhysicalNetworkResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listSupportedNetworkServices(self, command, method="GET"): - response = listSupportedNetworkServicesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addNetworkServiceProvider(self, command, method="GET"): - response = addNetworkServiceProviderResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteNetworkServiceProvider(self, command, method="GET"): - response = deleteNetworkServiceProviderResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNetworkServiceProviders(self, command, method="GET"): - response = listNetworkServiceProvidersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateNetworkServiceProvider(self, command, method="GET"): - response = updateNetworkServiceProviderResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addTrafficType(self, command, method="GET"): - response = addTrafficTypeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteTrafficType(self, command, method="GET"): - response = deleteTrafficTypeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listTrafficTypes(self, command, method="GET"): - response = listTrafficTypesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateTrafficType(self, command, method="GET"): - response = updateTrafficTypeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listTrafficTypeImplementors(self, command, method="GET"): - response = listTrafficTypeImplementorsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createStorageNetworkIpRange(self, command, method="GET"): - response = createStorageNetworkIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteStorageNetworkIpRange(self, command, method="GET"): - response = deleteStorageNetworkIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listStorageNetworkIpRange(self, command, method="GET"): - response = listStorageNetworkIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateStorageNetworkIpRange(self, command, method="GET"): - response = updateStorageNetworkIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addNetworkDevice(self, command, method="GET"): - response = addNetworkDeviceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNetworkDevice(self, command, method="GET"): - response = listNetworkDeviceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteNetworkDevice(self, command, method="GET"): - response = deleteNetworkDeviceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVPC(self, command, method="GET"): - response = createVPCResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVPCs(self, command, method="GET"): - response = listVPCsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteVPC(self, command, method="GET"): - response = deleteVPCResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateVPC(self, command, method="GET"): - response = updateVPCResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def restartVPC(self, command, method="GET"): - response = restartVPCResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVPCOffering(self, command, method="GET"): - response = createVPCOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateVPCOffering(self, command, method="GET"): - response = updateVPCOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteVPCOffering(self, command, method="GET"): - response = deleteVPCOfferingResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVPCOfferings(self, command, method="GET"): - response = listVPCOfferingsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createPrivateGateway(self, command, method="GET"): - response = createPrivateGatewayResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listPrivateGateways(self, command, method="GET"): - response = listPrivateGatewaysResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deletePrivateGateway(self, command, method="GET"): - response = deletePrivateGatewayResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createNetworkACL(self, command, method="GET"): - response = createNetworkACLResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateNetworkACLItem(self, command, method="GET"): - response = updateNetworkACLItemResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteNetworkACL(self, command, method="GET"): - response = deleteNetworkACLResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNetworkACLs(self, command, method="GET"): - response = listNetworkACLsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createNetworkACLList(self, command, method="GET"): - response = createNetworkACLListResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteNetworkACLList(self, command, method="GET"): - response = deleteNetworkACLListResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def replaceNetworkACLList(self, command, method="GET"): - response = replaceNetworkACLListResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNetworkACLLists(self, command, method="GET"): - response = listNetworkACLListsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createStaticRoute(self, command, method="GET"): - response = createStaticRouteResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteStaticRoute(self, command, method="GET"): - response = deleteStaticRouteResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listStaticRoutes(self, command, method="GET"): - response = listStaticRoutesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createTags(self, command, method="GET"): - response = createTagsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteTags(self, command, method="GET"): - response = deleteTagsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listTags(self, command, method="GET"): - response = listTagsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addResourceDetail(self, command, method="GET"): - response = addResourceDetailResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def removeResourceDetail(self, command, method="GET"): - response = removeResourceDetailResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listResourceDetails(self, command, method="GET"): - response = listResourceDetailsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVpnCustomerGateway(self, command, method="GET"): - response = createVpnCustomerGatewayResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVpnGateway(self, command, method="GET"): - response = createVpnGatewayResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVpnConnection(self, command, method="GET"): - response = createVpnConnectionResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteVpnCustomerGateway(self, command, method="GET"): - response = deleteVpnCustomerGatewayResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteVpnGateway(self, command, method="GET"): - response = deleteVpnGatewayResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteVpnConnection(self, command, method="GET"): - response = deleteVpnConnectionResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateVpnCustomerGateway(self, command, method="GET"): - response = updateVpnCustomerGatewayResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def resetVpnConnection(self, command, method="GET"): - response = resetVpnConnectionResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVpnCustomerGateways(self, command, method="GET"): - response = listVpnCustomerGatewaysResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVpnGateways(self, command, method="GET"): - response = listVpnGatewaysResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVpnConnections(self, command, method="GET"): - response = listVpnConnectionsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def generateUsageRecords(self, command, method="GET"): - response = generateUsageRecordsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listUsageRecords(self, command, method="GET"): - response = listUsageRecordsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listUsageTypes(self, command, method="GET"): - response = listUsageTypesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addTrafficMonitor(self, command, method="GET"): - response = addTrafficMonitorResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteTrafficMonitor(self, command, method="GET"): - response = deleteTrafficMonitorResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listTrafficMonitors(self, command, method="GET"): - response = listTrafficMonitorsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addNiciraNvpDevice(self, command, method="GET"): - response = addNiciraNvpDeviceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteNiciraNvpDevice(self, command, method="GET"): - response = deleteNiciraNvpDeviceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNiciraNvpDevices(self, command, method="GET"): - response = listNiciraNvpDevicesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNiciraNvpDeviceNetworks(self, command, method="GET"): - response = listNiciraNvpDeviceNetworksResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addBigSwitchVnsDevice(self, command, method="GET"): - response = addBigSwitchVnsDeviceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteBigSwitchVnsDevice(self, command, method="GET"): - response = deleteBigSwitchVnsDeviceResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listBigSwitchVnsDevices(self, command, method="GET"): - response = listBigSwitchVnsDevicesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listApis(self, command, method="GET"): - response = listApisResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def getApiLimit(self, command, method="GET"): - response = getApiLimitResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def resetApiLimit(self, command, method="GET"): - response = resetApiLimitResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addRegion(self, command, method="GET"): - response = addRegionResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateRegion(self, command, method="GET"): - response = updateRegionResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def removeRegion(self, command, method="GET"): - response = removeRegionResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listRegions(self, command, method="GET"): - response = listRegionsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createGlobalLoadBalancerRule(self, command, method="GET"): - response = createGlobalLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteGlobalLoadBalancerRule(self, command, method="GET"): - response = deleteGlobalLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateGlobalLoadBalancerRule(self, command, method="GET"): - response = updateGlobalLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listGlobalLoadBalancerRules(self, command, method="GET"): - response = listGlobalLoadBalancerRulesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def assignToGlobalLoadBalancerRule(self, command, method="GET"): - response = assignToGlobalLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def removeFromGlobalLoadBalancerRule(self, command, method="GET"): - response = removeFromGlobalLoadBalancerRuleResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listVMSnapshot(self, command, method="GET"): - response = listVMSnapshotResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createVMSnapshot(self, command, method="GET"): - response = createVMSnapshotResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteVMSnapshot(self, command, method="GET"): - response = deleteVMSnapshotResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def revertToVMSnapshot(self, command, method="GET"): - response = revertToVMSnapshotResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addBaremetalHost(self, command, method="GET"): - response = addBaremetalHostResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addBaremetalPxeKickStartServer(self, command, method="GET"): - response = addBaremetalPxeKickStartServerResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addBaremetalPxePingServer(self, command, method="GET"): - response = addBaremetalPxePingServerResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addBaremetalDhcp(self, command, method="GET"): - response = addBaremetalDhcpResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listBaremetalDhcp(self, command, method="GET"): - response = listBaremetalDhcpResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listBaremetalPxeServers(self, command, method="GET"): - response = listBaremetalPxeServersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addUcsManager(self, command, method="GET"): - response = addUcsManagerResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listUcsManagers(self, command, method="GET"): - response = listUcsManagersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listUcsProfiles(self, command, method="GET"): - response = listUcsProfilesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listUcsBlades(self, command, method="GET"): - response = listUcsBladesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def associateUcsProfileToBlade(self, command, method="GET"): - response = associateUcsProfileToBladeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createLoadBalancer(self, command, method="GET"): - response = createLoadBalancerResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listLoadBalancers(self, command, method="GET"): - response = listLoadBalancersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteLoadBalancer(self, command, method="GET"): - response = deleteLoadBalancerResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def configureInternalLoadBalancerElement(self, command, method="GET"): - response = configureInternalLoadBalancerElementResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createInternalLoadBalancerElement(self, command, method="GET"): - response = createInternalLoadBalancerElementResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listInternalLoadBalancerElements(self, command, method="GET"): - response = listInternalLoadBalancerElementsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createAffinityGroup(self, command, method="GET"): - response = createAffinityGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteAffinityGroup(self, command, method="GET"): - response = deleteAffinityGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listAffinityGroups(self, command, method="GET"): - response = listAffinityGroupsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def updateVMAffinityGroup(self, command, method="GET"): - response = updateVMAffinityGroupResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listAffinityGroupTypes(self, command, method="GET"): - response = listAffinityGroupTypesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def createPortableIpRange(self, command, method="GET"): - response = createPortableIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deletePortableIpRange(self, command, method="GET"): - response = deletePortableIpRangeResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listPortableIpRanges(self, command, method="GET"): - response = listPortableIpRangesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def stopInternalLoadBalancerVM(self, command, method="GET"): - response = stopInternalLoadBalancerVMResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def startInternalLoadBalancerVM(self, command, method="GET"): - response = startInternalLoadBalancerVMResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listInternalLoadBalancerVMs(self, command, method="GET"): - response = listInternalLoadBalancerVMsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listNetworkIsolationMethods(self, command, method="GET"): - response = listNetworkIsolationMethodsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def dedicateZone(self, command, method="GET"): - response = dedicateZoneResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def dedicatePod(self, command, method="GET"): - response = dedicatePodResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def dedicateCluster(self, command, method="GET"): - response = dedicateClusterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def dedicateHost(self, command, method="GET"): - response = dedicateHostResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def releaseDedicatedZone(self, command, method="GET"): - response = releaseDedicatedZoneResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def releaseDedicatedPod(self, command, method="GET"): - response = releaseDedicatedPodResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def releaseDedicatedCluster(self, command, method="GET"): - response = releaseDedicatedClusterResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def releaseDedicatedHost(self, command, method="GET"): - response = releaseDedicatedHostResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDedicatedZones(self, command, method="GET"): - response = listDedicatedZonesResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDedicatedPods(self, command, method="GET"): - response = listDedicatedPodsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDedicatedClusters(self, command, method="GET"): - response = listDedicatedClustersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listDedicatedHosts(self, command, method="GET"): - response = listDedicatedHostsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listLdapConfigurations(self, command, method="GET"): - response = listLdapConfigurationsResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def addLdapConfiguration(self, command, method="GET"): - response = addLdapConfigurationResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def deleteLdapConfiguration(self, command, method="GET"): - response = deleteLdapConfigurationResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def listLdapUsers(self, command, method="GET"): - response = listLdapUsersResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def ldapCreateAccount(self, command, method="GET"): - response = ldapCreateAccountResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def login(self, command, method="GET"): - response = loginResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - - def logout(self, command, method="GET"): - response = logoutResponse() - response = self.connection.marvin_request(command, response_type=response, method=method) - return response - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/configureInternalLoadBalancerElement.py b/tools/marvin/build/lib/marvin/cloudstackAPI/configureInternalLoadBalancerElement.py deleted file mode 100644 index 26357e5993d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/configureInternalLoadBalancerElement.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. - - -"""Configures an Internal Load Balancer element.""" -from baseCmd import * -from baseResponse import * -class configureInternalLoadBalancerElementCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the internal lb provider""" - """Required""" - self.id = None - """Enables/Disables the Internal Load Balancer element""" - """Required""" - self.enabled = None - self.required = ["id","enabled",] - -class configureInternalLoadBalancerElementResponse (baseResponse): - def __init__(self): - """the id of the internal load balancer element""" - self.id = None - """Enabled/Disabled the element""" - self.enabled = None - """the physical network service provider id of the element""" - self.nspid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/configureVirtualRouterElement.py b/tools/marvin/build/lib/marvin/cloudstackAPI/configureVirtualRouterElement.py deleted file mode 100644 index 5004dcdb4f2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/configureVirtualRouterElement.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. - - -"""Configures a virtual router element.""" -from baseCmd import * -from baseResponse import * -class configureVirtualRouterElementCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the virtual router provider""" - """Required""" - self.id = None - """Enabled/Disabled the service provider""" - """Required""" - self.enabled = None - self.required = ["id","enabled",] - -class configureVirtualRouterElementResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the provider""" - self.account = None - """the domain associated with the provider""" - self.domain = None - """the domain ID associated with the provider""" - self.domainid = None - """Enabled/Disabled the service provider""" - self.enabled = None - """the physical network service provider id of the provider""" - self.nspid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/copyIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/copyIso.py deleted file mode 100644 index 34a9bece654..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/copyIso.py +++ /dev/null @@ -1,137 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Copies an iso from one zone to another.""" -from baseCmd import * -from baseResponse import * -class copyIsoCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Template ID.""" - """Required""" - self.id = None - """ID of the zone the template is being copied to.""" - """Required""" - self.destzoneid = None - """ID of the zone the template is currently hosted on.""" - """Required""" - self.sourcezoneid = None - self.required = ["id","destzoneid","sourcezoneid",] - -class copyIsoResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/copyTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/copyTemplate.py deleted file mode 100644 index fba0f4f9613..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/copyTemplate.py +++ /dev/null @@ -1,137 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Copies a template from one zone to another.""" -from baseCmd import * -from baseResponse import * -class copyTemplateCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Template ID.""" - """Required""" - self.id = None - """ID of the zone the template is being copied to.""" - """Required""" - self.destzoneid = None - """ID of the zone the template is currently hosted on.""" - """Required""" - self.sourcezoneid = None - self.required = ["id","destzoneid","sourcezoneid",] - -class copyTemplateResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAccount.py deleted file mode 100644 index 9e04ec26ff2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createAccount.py +++ /dev/null @@ -1,202 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates an account""" -from baseCmd import * -from baseResponse import * -class createAccountCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Type of the account. Specify 0 for user, 1 for root admin, and 2 for domain admin""" - """Required""" - self.accounttype = None - """email""" - """Required""" - self.email = None - """firstname""" - """Required""" - self.firstname = None - """lastname""" - """Required""" - self.lastname = None - """Clear text password (Default hashed to SHA256SALT). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.""" - """Required""" - self.password = None - """Unique username.""" - """Required""" - self.username = None - """Creates the user under the specified account. If no account is specified, the username will be used as the account name.""" - self.account = None - """details for account used to store specific parameters""" - self.accountdetails = [] - """Account UUID, required for adding account from external provisioning system""" - self.accountid = None - """Creates the user under the specified domain.""" - self.domainid = None - """Network domain for the account's networks""" - self.networkdomain = None - """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" - self.timezone = None - """User UUID, required for adding account from external provisioning system""" - self.userid = None - self.required = ["accounttype","email","firstname","lastname","password","username",] - -class createAccountResponse (baseResponse): - def __init__(self): - """the id of the account""" - self.id = None - """details for the account""" - self.accountdetails = None - """account type (admin, domain-admin, user)""" - self.accounttype = None - """the total number of cpu cores available to be created for this account""" - self.cpuavailable = None - """the total number of cpu cores the account can own""" - self.cpulimit = None - """the total number of cpu cores owned by account""" - self.cputotal = None - """the default zone of the account""" - self.defaultzoneid = None - """name of the Domain the account belongs too""" - self.domain = None - """id of the Domain the account belongs too""" - self.domainid = None - """the total number of public ip addresses available for this account to acquire""" - self.ipavailable = None - """the total number of public ip addresses this account can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this account""" - self.iptotal = None - """true if the account requires cleanup""" - self.iscleanuprequired = None - """true if account is default, false otherwise""" - self.isdefault = None - """the total memory (in MB) available to be created for this account""" - self.memoryavailable = None - """the total memory (in MB) the account can own""" - self.memorylimit = None - """the total memory (in MB) owned by account""" - self.memorytotal = None - """the name of the account""" - self.name = None - """the total number of networks available to be created for this account""" - self.networkavailable = None - """the network domain""" - self.networkdomain = None - """the total number of networks the account can own""" - self.networklimit = None - """the total number of networks owned by account""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this account""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the account can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by account""" - self.primarystoragetotal = None - """the total number of projects available for administration by this account""" - self.projectavailable = None - """the total number of projects the account can own""" - self.projectlimit = None - """the total number of projects being administrated by this account""" - self.projecttotal = None - """the total number of network traffic bytes received""" - self.receivedbytes = None - """the total secondary storage space (in GiB) available to be used for this account""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the account can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by account""" - self.secondarystoragetotal = None - """the total number of network traffic bytes sent""" - self.sentbytes = None - """the total number of snapshots available for this account""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this account""" - self.snapshotlimit = None - """the total number of snapshots stored by this account""" - self.snapshottotal = None - """the state of the account""" - self.state = None - """the total number of templates available to be created by this account""" - self.templateavailable = None - """the total number of templates which can be created by this account""" - self.templatelimit = None - """the total number of templates which have been created by this account""" - self.templatetotal = None - """the total number of virtual machines available for this account to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this account""" - self.vmlimit = None - """the total number of virtual machines running for this account""" - self.vmrunning = None - """the total number of virtual machines stopped for this account""" - self.vmstopped = None - """the total number of virtual machines deployed by this account""" - self.vmtotal = None - """the total volume available for this account""" - self.volumeavailable = None - """the total volume which can be used by this account""" - self.volumelimit = None - """the total volume being used by this account""" - self.volumetotal = None - """the total number of vpcs available to be created for this account""" - self.vpcavailable = None - """the total number of vpcs the account can own""" - self.vpclimit = None - """the total number of vpcs owned by account""" - self.vpctotal = None - """the list of users associated with account""" - self.user = [] - -class user: - def __init__(self): - """"the user ID""" - self.id = None - """"the account name of the user""" - self.account = None - """"the account ID of the user""" - self.accountid = None - """"the account type of the user""" - self.accounttype = None - """"the api key of the user""" - self.apikey = None - """"the date and time the user account was created""" - self.created = None - """"the domain name of the user""" - self.domain = None - """"the domain ID of the user""" - self.domainid = None - """"the user email address""" - self.email = None - """"the user firstname""" - self.firstname = None - """"the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """"true if user is default, false otherwise""" - self.isdefault = None - """"the user lastname""" - self.lastname = None - """"the secret key of the user""" - self.secretkey = None - """"the user state""" - self.state = None - """"the timezone user was created in""" - self.timezone = None - """"the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAffinityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAffinityGroup.py deleted file mode 100644 index 473e3ee2444..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createAffinityGroup.py +++ /dev/null @@ -1,57 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates an affinity/anti-affinity group""" -from baseCmd import * -from baseResponse import * -class createAffinityGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """name of the affinity group""" - """Required""" - self.name = None - """Type of the affinity group from the available affinity/anti-affinity group types""" - """Required""" - self.type = None - """an account for the affinity group. Must be used with domainId.""" - self.account = None - """optional description of the affinity group""" - self.description = None - """domainId of the account owning the affinity group""" - self.domainid = None - self.required = ["name","type",] - -class createAffinityGroupResponse (baseResponse): - def __init__(self): - """the ID of the affinity group""" - self.id = None - """the account owning the affinity group""" - self.account = None - """the description of the affinity group""" - self.description = None - """the domain name of the affinity group""" - self.domain = None - """the domain ID of the affinity group""" - self.domainid = None - """the name of the affinity group""" - self.name = None - """the type of the affinity group""" - self.type = None - """virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScalePolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScalePolicy.py deleted file mode 100644 index 500284660d3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScalePolicy.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. - - -"""Creates an autoscale policy for a provision or deprovision action, the action is taken when the all the conditions evaluates to true for the specified duration. The policy is in effect once it is attached to a autscale vm group.""" -from baseCmd import * -from baseResponse import * -class createAutoScalePolicyCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the action to be executed if all the conditions evaluate to true for the specified duration.""" - """Required""" - self.action = None - """the list of IDs of the conditions that are being evaluated on every interval""" - """Required""" - self.conditionids = [] - """the duration for which the conditions have to be true before action is taken""" - """Required""" - self.duration = None - """the cool down period for which the policy should not be evaluated after the action has been taken""" - self.quiettime = None - self.required = ["action","conditionids","duration",] - -class createAutoScalePolicyResponse (baseResponse): - def __init__(self): - """the autoscale policy ID""" - self.id = None - """the account owning the autoscale policy""" - self.account = None - """the action to be executed if all the conditions evaluate to true for the specified duration.""" - self.action = None - """the list of IDs of the conditions that are being evaluated on every interval""" - self.conditions = None - """the domain name of the autoscale policy""" - self.domain = None - """the domain ID of the autoscale policy""" - self.domainid = None - """the duration for which the conditions have to be true before action is taken""" - self.duration = None - """the project name of the autoscale policy""" - self.project = None - """the project id autoscale policy""" - self.projectid = None - """the cool down period for which the policy should not be evaluated after the action has been taken""" - self.quiettime = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmGroup.py deleted file mode 100644 index f8a35b62d01..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmGroup.py +++ /dev/null @@ -1,77 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.""" -from baseCmd import * -from baseResponse import * -class createAutoScaleVmGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the load balancer rule""" - """Required""" - self.lbruleid = None - """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" - """Required""" - self.maxmembers = None - """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" - """Required""" - self.minmembers = None - """list of scaledown autoscale policies""" - """Required""" - self.scaledownpolicyids = [] - """list of scaleup autoscale policies""" - """Required""" - self.scaleuppolicyids = [] - """the autoscale profile that contains information about the vms in the vm group.""" - """Required""" - self.vmprofileid = None - """the frequency at which the conditions have to be evaluated""" - self.interval = None - self.required = ["lbruleid","maxmembers","minmembers","scaledownpolicyids","scaleuppolicyids","vmprofileid",] - -class createAutoScaleVmGroupResponse (baseResponse): - def __init__(self): - """the autoscale vm group ID""" - self.id = None - """the account owning the instance group""" - self.account = None - """the domain name of the vm profile""" - self.domain = None - """the domain ID of the vm profile""" - self.domainid = None - """the frequency at which the conditions have to be evaluated""" - self.interval = None - """the load balancer rule ID""" - self.lbruleid = None - """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" - self.maxmembers = None - """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" - self.minmembers = None - """the project name of the vm profile""" - self.project = None - """the project id vm profile""" - self.projectid = None - """list of scaledown autoscale policies""" - self.scaledownpolicies = None - """list of scaleup autoscale policies""" - self.scaleuppolicies = None - """the current state of the AutoScale Vm Group""" - self.state = None - """the autoscale profile that contains information about the vms in the vm group.""" - self.vmprofileid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmProfile.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmProfile.py deleted file mode 100644 index 00250322f92..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createAutoScaleVmProfile.py +++ /dev/null @@ -1,70 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a profile that contains information about the virtual machine which will be provisioned automatically by autoscale feature.""" -from baseCmd import * -from baseResponse import * -class createAutoScaleVmProfileCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the service offering of the auto deployed virtual machine""" - """Required""" - self.serviceofferingid = None - """the template of the auto deployed virtual machine""" - """Required""" - self.templateid = None - """availability zone for the auto deployed virtual machine""" - """Required""" - self.zoneid = None - """the ID of the user used to launch and destroy the VMs""" - self.autoscaleuserid = None - """counterparam list. Example: counterparam[0].name=snmpcommunity&counterparam[0].value=public&counterparam[1].name=snmpport&counterparam[1].value=161""" - self.counterparam = [] - """the time allowed for existing connections to get closed before a vm is destroyed""" - self.destroyvmgraceperiod = None - """parameters other than zoneId/serviceOfferringId/templateId of the auto deployed virtual machine""" - self.otherdeployparams = None - self.required = ["serviceofferingid","templateid","zoneid",] - -class createAutoScaleVmProfileResponse (baseResponse): - def __init__(self): - """the autoscale vm profile ID""" - self.id = None - """the account owning the instance group""" - self.account = None - """the ID of the user used to launch and destroy the VMs""" - self.autoscaleuserid = None - """the time allowed for existing connections to get closed before a vm is destroyed""" - self.destroyvmgraceperiod = None - """the domain name of the vm profile""" - self.domain = None - """the domain ID of the vm profile""" - self.domainid = None - """parameters other than zoneId/serviceOfferringId/templateId to be used while deploying a virtual machine""" - self.otherdeployparams = None - """the project name of the vm profile""" - self.project = None - """the project id vm profile""" - self.projectid = None - """the service offering to be used while deploying a virtual machine""" - self.serviceofferingid = None - """the template to be used while deploying a virtual machine""" - self.templateid = None - """the availability zone to be used while deploying a virtual machine""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createCondition.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createCondition.py deleted file mode 100644 index 74a9dafaa4f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createCondition.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. - - -"""Creates a condition""" -from baseCmd import * -from baseResponse import * -class createConditionCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """ID of the Counter.""" - """Required""" - self.counterid = None - """Relational Operator to be used with threshold.""" - """Required""" - self.relationaloperator = None - """Threshold value.""" - """Required""" - self.threshold = None - """the account of the condition. Must be used with the domainId parameter.""" - self.account = None - """the domain ID of the account.""" - self.domainid = None - self.required = ["counterid","relationaloperator","threshold",] - -class createConditionResponse (baseResponse): - def __init__(self): - """the id of the Condition""" - self.id = None - """the owner of the Condition.""" - self.account = None - """Details of the Counter.""" - self.counter = None - """the domain name of the owner.""" - self.domain = None - """the domain id of the Condition owner""" - self.domainid = None - """the project name of the Condition""" - self.project = None - """the project id of the Condition.""" - self.projectid = None - """Relational Operator to be used with threshold.""" - self.relationaloperator = None - """Threshold Value for the counter.""" - self.threshold = None - """zone id of counter""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createCounter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createCounter.py deleted file mode 100644 index 240a486a291..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createCounter.py +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Adds metric counter""" -from baseCmd import * -from baseResponse import * -class createCounterCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Name of the counter.""" - """Required""" - self.name = None - """Source of the counter.""" - """Required""" - self.source = None - """Value of the counter e.g. oid in case of snmp.""" - """Required""" - self.value = None - self.required = ["name","source","value",] - -class createCounterResponse (baseResponse): - def __init__(self): - """the id of the Counter""" - self.id = None - """Name of the counter.""" - self.name = None - """Source of the counter.""" - self.source = None - """Value in case of snmp or other specific counters.""" - self.value = None - """zone id of counter""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createDiskOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createDiskOffering.py deleted file mode 100644 index 736a0cf5f16..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createDiskOffering.py +++ /dev/null @@ -1,97 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a disk offering.""" -from baseCmd import * -from baseResponse import * -class createDiskOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """alternate display text of the disk offering""" - """Required""" - self.displaytext = None - """name of the disk offering""" - """Required""" - self.name = None - """bytes read rate of the disk offering""" - self.bytesreadrate = None - """bytes write rate of the disk offering""" - self.byteswriterate = None - """whether disk offering size is custom or not""" - self.customized = None - """whether disk offering iops is custom or not""" - self.customizediops = None - """size of the disk offering in GB""" - self.disksize = None - """an optional field, whether to display the offering to the end user or not.""" - self.displayoffering = None - """the ID of the containing domain, null for public offerings""" - self.domainid = None - """io requests read rate of the disk offering""" - self.iopsreadrate = None - """io requests write rate of the disk offering""" - self.iopswriterate = None - """max iops of the disk offering""" - self.maxiops = None - """min iops of the disk offering""" - self.miniops = None - """the storage type of the disk offering. Values are local and shared.""" - self.storagetype = None - """tags for the disk offering""" - self.tags = None - self.required = ["displaytext","name",] - -class createDiskOfferingResponse (baseResponse): - def __init__(self): - """unique ID of the disk offering""" - self.id = None - """the date this disk offering was created""" - self.created = None - """bytes read rate of the disk offering""" - self.diskBytesReadRate = None - """bytes write rate of the disk offering""" - self.diskBytesWriteRate = None - """io requests read rate of the disk offering""" - self.diskIopsReadRate = None - """io requests write rate of the disk offering""" - self.diskIopsWriteRate = None - """the size of the disk offering in GB""" - self.disksize = None - """whether to display the offering to the end user or not.""" - self.displayoffering = None - """an alternate display text of the disk offering.""" - self.displaytext = None - """the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.""" - self.domain = None - """the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.""" - self.domainid = None - """true if disk offering uses custom size, false otherwise""" - self.iscustomized = None - """true if disk offering uses custom iops, false otherwise""" - self.iscustomizediops = None - """the max iops of the disk offering""" - self.maxiops = None - """the min iops of the disk offering""" - self.miniops = None - """the name of the disk offering""" - self.name = None - """the storage type for this disk offering""" - self.storagetype = None - """the tags for the disk offering""" - self.tags = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createDomain.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createDomain.py deleted file mode 100644 index 12b4854e981..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createDomain.py +++ /dev/null @@ -1,54 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a domain""" -from baseCmd import * -from baseResponse import * -class createDomainCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """creates domain with this name""" - """Required""" - self.name = None - """Domain UUID, required for adding domain from another Region""" - self.domainid = None - """Network domain for networks in the domain""" - self.networkdomain = None - """assigns new domain a parent domain by domain ID of the parent. If no parent domain is specied, the ROOT domain is assumed.""" - self.parentdomainid = None - self.required = ["name",] - -class createDomainResponse (baseResponse): - def __init__(self): - """the ID of the domain""" - self.id = None - """whether the domain has one or more sub-domains""" - self.haschild = None - """the level of the domain""" - self.level = None - """the name of the domain""" - self.name = None - """the network domain""" - self.networkdomain = None - """the domain ID of the parent domain""" - self.parentdomainid = None - """the domain name of the parent domain""" - self.parentdomainname = None - """the path of the domain""" - self.path = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createEgressFirewallRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createEgressFirewallRule.py deleted file mode 100644 index 61a5e7eec4e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createEgressFirewallRule.py +++ /dev/null @@ -1,94 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a egress firewall rule for a given network""" -from baseCmd import * -from baseResponse import * -class createEgressFirewallRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the network id of the port forwarding rule""" - """Required""" - self.networkid = None - """the protocol for the firewall rule. Valid values are TCP/UDP/ICMP.""" - """Required""" - self.protocol = None - """the cidr list to forward traffic from""" - self.cidrlist = [] - """the ending port of firewall rule""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """the starting port of firewall rule""" - self.startport = None - """type of firewallrule: system/user""" - self.type = None - self.required = ["networkid","protocol",] - -class createEgressFirewallRuleResponse (baseResponse): - def __init__(self): - """the ID of the firewall rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the ending port of firewall rule's port range""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """the public ip address for the firewall rule""" - self.ipaddress = None - """the public ip address id for the firewall rule""" - self.ipaddressid = None - """the network id of the firewall rule""" - self.networkid = None - """the protocol of the firewall rule""" - self.protocol = None - """the starting port of firewall rule's port range""" - self.startport = None - """the state of the rule""" - self.state = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createFirewallRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createFirewallRule.py deleted file mode 100644 index 4faeb6bde1b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createFirewallRule.py +++ /dev/null @@ -1,94 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a firewall rule for a given ip address""" -from baseCmd import * -from baseResponse import * -class createFirewallRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the IP address id of the port forwarding rule""" - """Required""" - self.ipaddressid = None - """the protocol for the firewall rule. Valid values are TCP/UDP/ICMP.""" - """Required""" - self.protocol = None - """the cidr list to forward traffic from""" - self.cidrlist = [] - """the ending port of firewall rule""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """the starting port of firewall rule""" - self.startport = None - """type of firewallrule: system/user""" - self.type = None - self.required = ["ipaddressid","protocol",] - -class createFirewallRuleResponse (baseResponse): - def __init__(self): - """the ID of the firewall rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the ending port of firewall rule's port range""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """the public ip address for the firewall rule""" - self.ipaddress = None - """the public ip address id for the firewall rule""" - self.ipaddressid = None - """the network id of the firewall rule""" - self.networkid = None - """the protocol of the firewall rule""" - self.protocol = None - """the starting port of firewall rule's port range""" - self.startport = None - """the state of the rule""" - self.state = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createGlobalLoadBalancerRule.py deleted file mode 100644 index dd0c610a530..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createGlobalLoadBalancerRule.py +++ /dev/null @@ -1,161 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a global load balancer rule""" -from baseCmd import * -from baseResponse import * -class createGlobalLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """domain name for the GSLB service.""" - """Required""" - self.gslbdomainname = None - """GSLB service type (tcp, udp)""" - """Required""" - self.gslbservicetype = None - """name of the load balancer rule""" - """Required""" - self.name = None - """region where the global load balancer is going to be created.""" - """Required""" - self.regionid = None - """the account associated with the global load balancer. Must be used with the domainId parameter.""" - self.account = None - """the description of the load balancer rule""" - self.description = None - """the domain ID associated with the load balancer""" - self.domainid = None - """load balancer algorithm (roundrobin, leastconn, proximity) that method is used to distribute traffic across the zones participating in global server load balancing, if not specified defaults to 'round robin'""" - self.gslblbmethod = None - """session sticky method (sourceip) if not specified defaults to sourceip""" - self.gslbstickysessionmethodname = None - self.required = ["gslbdomainname","gslbservicetype","name","regionid",] - -class createGlobalLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """global load balancer rule ID""" - self.id = None - """the account of the load balancer rule""" - self.account = None - """the description of the global load balancer rule""" - self.description = None - """the domain of the load balancer rule""" - self.domain = None - """the domain ID of the load balancer rule""" - self.domainid = None - """DNS domain name given for the global load balancer""" - self.gslbdomainname = None - """Load balancing method used for the global load balancer""" - self.gslblbmethod = None - """GSLB service type""" - self.gslbservicetype = None - """session persistence method used for the global load balancer""" - self.gslbstickysessionmethodname = None - """name of the global load balancer rule""" - self.name = None - """the project name of the load balancer""" - self.project = None - """the project id of the load balancer""" - self.projectid = None - """Region Id in which global load balancer is created""" - self.regionid = None - """List of load balancer rules that are part of GSLB rule""" - self.loadbalancerrule = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class loadbalancerrule: - def __init__(self): - """"the load balancer rule ID""" - self.id = None - """"the account of the load balancer rule""" - self.account = None - """"the load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """"the cidr list to forward traffic from""" - self.cidrlist = None - """"the description of the load balancer""" - self.description = None - """"the domain of the load balancer rule""" - self.domain = None - """"the domain ID of the load balancer rule""" - self.domainid = None - """"the name of the load balancer""" - self.name = None - """"the id of the guest network the lb rule belongs to""" - self.networkid = None - """"the private port""" - self.privateport = None - """"the project name of the load balancer""" - self.project = None - """"the project id of the load balancer""" - self.projectid = None - """"the public ip address""" - self.publicip = None - """"the public ip address id""" - self.publicipid = None - """"the public port""" - self.publicport = None - """"the state of the rule""" - self.state = None - """"the id of the zone the rule belongs to""" - self.zoneid = None - """"the list of resource tags associated with load balancer""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createInstanceGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createInstanceGroup.py deleted file mode 100644 index 37f72727c2d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createInstanceGroup.py +++ /dev/null @@ -1,54 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a vm group""" -from baseCmd import * -from baseResponse import * -class createInstanceGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the name of the instance group""" - """Required""" - self.name = None - """the account of the instance group. The account parameter must be used with the domainId parameter.""" - self.account = None - """the domain ID of account owning the instance group""" - self.domainid = None - """The project of the instance group""" - self.projectid = None - self.required = ["name",] - -class createInstanceGroupResponse (baseResponse): - def __init__(self): - """the id of the instance group""" - self.id = None - """the account owning the instance group""" - self.account = None - """time and date the instance group was created""" - self.created = None - """the domain name of the instance group""" - self.domain = None - """the domain ID of the instance group""" - self.domainid = None - """the name of the instance group""" - self.name = None - """the project name of the group""" - self.project = None - """the project id of the group""" - self.projectid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createInternalLoadBalancerElement.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createInternalLoadBalancerElement.py deleted file mode 100644 index 7a84929783e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createInternalLoadBalancerElement.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. - - -"""Create an Internal Load Balancer element.""" -from baseCmd import * -from baseResponse import * -class createInternalLoadBalancerElementCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the network service provider ID of the internal load balancer element""" - """Required""" - self.nspid = None - self.required = ["nspid",] - -class createInternalLoadBalancerElementResponse (baseResponse): - def __init__(self): - """the id of the internal load balancer element""" - self.id = None - """Enabled/Disabled the element""" - self.enabled = None - """the physical network service provider id of the element""" - self.nspid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createIpForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createIpForwardingRule.py deleted file mode 100644 index 06f7b07388d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createIpForwardingRule.py +++ /dev/null @@ -1,97 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates an ip forwarding rule""" -from baseCmd import * -from baseResponse import * -class createIpForwardingRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the public IP address id of the forwarding rule, already associated via associateIp""" - """Required""" - self.ipaddressid = None - """the protocol for the rule. Valid values are TCP or UDP.""" - """Required""" - self.protocol = None - """the start port for the rule""" - """Required""" - self.startport = None - """the cidr list to forward traffic from""" - self.cidrlist = [] - """the end port for the rule""" - self.endport = None - """if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. Has value true by default""" - self.openfirewall = None - self.required = ["ipaddressid","protocol","startport",] - -class createIpForwardingRuleResponse (baseResponse): - def __init__(self): - """the ID of the port forwarding rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the public ip address for the port forwarding rule""" - self.ipaddress = None - """the public ip address id for the port forwarding rule""" - self.ipaddressid = None - """the ending port of port forwarding rule's private port range""" - self.privateendport = None - """the starting port of port forwarding rule's private port range""" - self.privateport = None - """the protocol of the port forwarding rule""" - self.protocol = None - """the ending port of port forwarding rule's private port range""" - self.publicendport = None - """the starting port of port forwarding rule's public port range""" - self.publicport = None - """the state of the rule""" - self.state = None - """the VM display name for the port forwarding rule""" - self.virtualmachinedisplayname = None - """the VM ID for the port forwarding rule""" - self.virtualmachineid = None - """the VM name for the port forwarding rule""" - self.virtualmachinename = None - """the vm ip address for the port forwarding rule""" - self.vmguestip = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createLBHealthCheckPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createLBHealthCheckPolicy.py deleted file mode 100644 index e650d15e033..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createLBHealthCheckPolicy.py +++ /dev/null @@ -1,75 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a Load Balancer healthcheck policy""" -from baseCmd import * -from baseResponse import * -class createLBHealthCheckPolicyCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the load balancer rule""" - """Required""" - self.lbruleid = None - """the description of the load balancer HealthCheck policy""" - self.description = None - """Number of consecutive health check success before declaring an instance healthy""" - self.healthythreshold = None - """Amount of time between health checks (1 sec - 20940 sec)""" - self.intervaltime = None - """HTTP Ping Path""" - self.pingpath = None - """Time to wait when receiving a response from the health check (2sec - 60 sec)""" - self.responsetimeout = None - """Number of consecutive health check failures before declaring an instance unhealthy""" - self.unhealthythreshold = None - self.required = ["lbruleid",] - -class createLBHealthCheckPolicyResponse (baseResponse): - def __init__(self): - """the account of the HealthCheck policy""" - self.account = None - """the domain of the HealthCheck policy""" - self.domain = None - """the domain ID of the HealthCheck policy""" - self.domainid = None - """the LB rule ID""" - self.lbruleid = None - """the id of the zone the HealthCheck policy belongs to""" - self.zoneid = None - """the list of healthcheckpolicies""" - self.healthcheckpolicy = [] - -class healthcheckpolicy: - def __init__(self): - """"the LB HealthCheck policy ID""" - self.id = None - """"the description of the healthcheck policy""" - self.description = None - """"Amount of time between health checks""" - self.healthcheckinterval = None - """"Number of consecutive health check success before declaring an instance healthy""" - self.healthcheckthresshold = None - """"the pingpath of the healthcheck policy""" - self.pingpath = None - """"Time to wait when receiving a response from the health check""" - self.responsetime = None - """"the state of the policy""" - self.state = None - """"Number of consecutive health check failures before declaring an instance unhealthy.""" - self.unhealthcheckthresshold = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createLBStickinessPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createLBStickinessPolicy.py deleted file mode 100644 index 5accb88135c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createLBStickinessPolicy.py +++ /dev/null @@ -1,75 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a Load Balancer stickiness policy""" -from baseCmd import * -from baseResponse import * -class createLBStickinessPolicyCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the load balancer rule""" - """Required""" - self.lbruleid = None - """name of the LB Stickiness policy method, possible values can be obtained from ListNetworks API""" - """Required""" - self.methodname = None - """name of the LB Stickiness policy""" - """Required""" - self.name = None - """the description of the LB Stickiness policy""" - self.description = None - """param list. Example: param[0].name=cookiename¶m[0].value=LBCookie""" - self.param = [] - self.required = ["lbruleid","methodname","name",] - -class createLBStickinessPolicyResponse (baseResponse): - def __init__(self): - """the account of the Stickiness policy""" - self.account = None - """the description of the Stickiness policy""" - self.description = None - """the domain of the Stickiness policy""" - self.domain = None - """the domain ID of the Stickiness policy""" - self.domainid = None - """the LB rule ID""" - self.lbruleid = None - """the name of the Stickiness policy""" - self.name = None - """the state of the policy""" - self.state = None - """the id of the zone the Stickiness policy belongs to""" - self.zoneid = None - """the list of stickinesspolicies""" - self.stickinesspolicy = [] - -class stickinesspolicy: - def __init__(self): - """"the LB Stickiness policy ID""" - self.id = None - """"the description of the Stickiness policy""" - self.description = None - """"the method name of the Stickiness policy""" - self.methodname = None - """"the name of the Stickiness policy""" - self.name = None - """"the params of the policy""" - self.params = None - """"the state of the policy""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancer.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancer.py deleted file mode 100644 index 0dcb5e91724..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancer.py +++ /dev/null @@ -1,127 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a Load Balancer""" -from baseCmd import * -from baseResponse import * -class createLoadBalancerCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """load balancer algorithm (source, roundrobin, leastconn)""" - """Required""" - self.algorithm = None - """the TCP port of the virtual machine where the network traffic will be load balanced to""" - """Required""" - self.instanceport = None - """name of the Load Balancer""" - """Required""" - self.name = None - """The guest network the Load Balancer will be created for""" - """Required""" - self.networkid = None - """the load balancer scheme. Supported value in this release is Internal""" - """Required""" - self.scheme = None - """the network id of the source ip address""" - """Required""" - self.sourceipaddressnetworkid = None - """the source port the network traffic will be load balanced from""" - """Required""" - self.sourceport = None - """the description of the Load Balancer""" - self.description = None - """the source ip address the network traffic will be load balanced from""" - self.sourceipaddress = None - self.required = ["algorithm","instanceport","name","networkid","scheme","sourceipaddressnetworkid","sourceport",] - -class createLoadBalancerResponse (baseResponse): - def __init__(self): - """the Load Balancer ID""" - self.id = None - """the account of the Load Balancer""" - self.account = None - """the load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """the description of the Load Balancer""" - self.description = None - """the domain of the Load Balancer""" - self.domain = None - """the domain ID of the Load Balancer""" - self.domainid = None - """the name of the Load Balancer""" - self.name = None - """Load Balancer network id""" - self.networkid = None - """the project name of the Load Balancer""" - self.project = None - """the project id of the Load Balancer""" - self.projectid = None - """Load Balancer source ip""" - self.sourceipaddress = None - """Load Balancer source ip network id""" - self.sourceipaddressnetworkid = None - """the list of instances associated with the Load Balancer""" - self.loadbalancerinstance = [] - """the list of rules associated with the Load Balancer""" - self.loadbalancerrule = [] - """the list of resource tags associated with the Load Balancer""" - self.tags = [] - -class loadbalancerinstance: - def __init__(self): - """"the instance ID""" - self.id = None - """"the ip address of the instance""" - self.ipaddress = None - """"the name of the instance""" - self.name = None - """"the state of the instance""" - self.state = None - -class loadbalancerrule: - def __init__(self): - """"instance port of the load balancer rule""" - self.instanceport = None - """"source port of the load balancer rule""" - self.sourceport = None - """"the state of the load balancer rule""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancerRule.py deleted file mode 100644 index e30877ee289..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createLoadBalancerRule.py +++ /dev/null @@ -1,116 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a load balancer rule""" -from baseCmd import * -from baseResponse import * -class createLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """load balancer algorithm (source, roundrobin, leastconn)""" - """Required""" - self.algorithm = None - """name of the load balancer rule""" - """Required""" - self.name = None - """the private port of the private ip address/virtual machine where the network traffic will be load balanced to""" - """Required""" - self.privateport = None - """the public port from where the network traffic will be load balanced from""" - """Required""" - self.publicport = None - """the account associated with the load balancer. Must be used with the domainId parameter.""" - self.account = None - """the cidr list to forward traffic from""" - self.cidrlist = [] - """the description of the load balancer rule""" - self.description = None - """the domain ID associated with the load balancer""" - self.domainid = None - """The guest network this rule will be created for. Required when public Ip address is not associated with any Guest network yet (VPC case)""" - self.networkid = None - """if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. If not specified 1) defaulted to false when LB rule is being created for VPC guest network 2) in all other cases defaulted to true""" - self.openfirewall = None - """public ip address id from where the network traffic will be load balanced from""" - self.publicipid = None - """zone where the load balancer is going to be created. This parameter is required when LB service provider is ElasticLoadBalancerVm""" - self.zoneid = None - self.required = ["algorithm","name","privateport","publicport",] - -class createLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """the load balancer rule ID""" - self.id = None - """the account of the load balancer rule""" - self.account = None - """the load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the description of the load balancer""" - self.description = None - """the domain of the load balancer rule""" - self.domain = None - """the domain ID of the load balancer rule""" - self.domainid = None - """the name of the load balancer""" - self.name = None - """the id of the guest network the lb rule belongs to""" - self.networkid = None - """the private port""" - self.privateport = None - """the project name of the load balancer""" - self.project = None - """the project id of the load balancer""" - self.projectid = None - """the public ip address""" - self.publicip = None - """the public ip address id""" - self.publicipid = None - """the public port""" - self.publicport = None - """the state of the rule""" - self.state = None - """the id of the zone the rule belongs to""" - self.zoneid = None - """the list of resource tags associated with load balancer""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetwork.py deleted file mode 100644 index 0e5c3a94ced..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetwork.py +++ /dev/null @@ -1,251 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a network""" -from baseCmd import * -from baseResponse import * -class createNetworkCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the display text of the network""" - """Required""" - self.displaytext = None - """the name of the network""" - """Required""" - self.name = None - """the network offering id""" - """Required""" - self.networkofferingid = None - """the Zone ID for the network""" - """Required""" - self.zoneid = None - """account who will own the network""" - self.account = None - """Network ACL Id associated for the network""" - self.aclid = None - """Access control type; supported values are account and domain. In 3.0 all shared networks should have aclType=Domain, and all Isolated networks - Account. Account means that only the account owner can use the network, domain - all accouns in the domain can use the network""" - self.acltype = None - """an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """domain ID of the account owning a network""" - self.domainid = None - """the ending IP address in the network IP range. If not specified, will be defaulted to startIP""" - self.endip = None - """the ending IPv6 address in the IPv6 network range""" - self.endipv6 = None - """the gateway of the network. Required for Shared networks and Isolated networks when it belongs to VPC""" - self.gateway = None - """the CIDR of IPv6 network, must be at least /64""" - self.ip6cidr = None - """the gateway of the IPv6 network. Required for Shared networks and Isolated networks when it belongs to VPC""" - self.ip6gateway = None - """the isolated private vlan for this network""" - self.isolatedpvlan = None - """the netmask of the network. Required for Shared networks and Isolated networks when it belongs to VPC""" - self.netmask = None - """network domain""" - self.networkdomain = None - """the Physical Network ID the network belongs to""" - self.physicalnetworkid = None - """an optional project for the ssh key""" - self.projectid = None - """the beginning IP address in the network IP range""" - self.startip = None - """the beginning IPv6 address in the IPv6 network range""" - self.startipv6 = None - """Defines whether to allow subdomains to use networks dedicated to their parent domain(s). Should be used with aclType=Domain, defaulted to allow.subdomain.network.access global config if not specified""" - self.subdomainaccess = None - """the ID or VID of the network""" - self.vlan = None - """the VPC network belongs to""" - self.vpcid = None - self.required = ["displaytext","name","networkofferingid","zoneid",] - -class createNetworkResponse (baseResponse): - def __init__(self): - """the id of the network""" - self.id = None - """the owner of the network""" - self.account = None - """ACL Id associated with the VPC network""" - self.aclid = None - """acl type - access type to the network""" - self.acltype = None - """Broadcast domain type of the network""" - self.broadcastdomaintype = None - """broadcast uri of the network. This parameter is visible to ROOT admins only""" - self.broadcasturi = None - """list networks available for vm deployment""" - self.canusefordeploy = None - """Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" - self.cidr = None - """an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """the displaytext of the network""" - self.displaytext = None - """the first DNS for the network""" - self.dns1 = None - """the second DNS for the network""" - self.dns2 = None - """the domain name of the network owner""" - self.domain = None - """the domain id of the network owner""" - self.domainid = None - """the network's gateway""" - self.gateway = None - """the cidr of IPv6 network""" - self.ip6cidr = None - """the gateway of IPv6 network""" - self.ip6gateway = None - """true if network is default, false otherwise""" - self.isdefault = None - """list networks that are persistent""" - self.ispersistent = None - """true if network is system, false otherwise""" - self.issystem = None - """the name of the network""" - self.name = None - """the network's netmask""" - self.netmask = None - """the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" - self.networkcidr = None - """the network domain""" - self.networkdomain = None - """availability of the network offering the network is created from""" - self.networkofferingavailability = None - """true if network offering is ip conserve mode enabled""" - self.networkofferingconservemode = None - """display text of the network offering the network is created from""" - self.networkofferingdisplaytext = None - """network offering id the network is created from""" - self.networkofferingid = None - """name of the network offering the network is created from""" - self.networkofferingname = None - """the physical network id""" - self.physicalnetworkid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """related to what other network configuration""" - self.related = None - """the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" - self.reservediprange = None - """true network requires restart""" - self.restartrequired = None - """true if network supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """state of the network""" - self.state = None - """true if users from subdomains can access the domain level network""" - self.subdomainaccess = None - """the traffic type of the network""" - self.traffictype = None - """the type of the network""" - self.type = None - """The vlan of the network. This parameter is visible to ROOT admins only""" - self.vlan = None - """VPC the network belongs to""" - self.vpcid = None - """zone id of the network""" - self.zoneid = None - """the name of the zone the network belongs to""" - self.zonename = None - """the list of services""" - self.service = [] - """the list of resource tags associated with network""" - self.tags = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACL.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACL.py deleted file mode 100644 index 3b3f611edac..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACL.py +++ /dev/null @@ -1,101 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a ACL rule in the given network (the network has to belong to VPC)""" -from baseCmd import * -from baseResponse import * -class createNetworkACLCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the protocol for the ACL rule. Valid values are TCP/UDP/ICMP/ALL or valid protocol number""" - """Required""" - self.protocol = None - """The network of the vm the ACL will be created for""" - self.aclid = None - """scl entry action, allow or deny""" - self.action = None - """the cidr list to allow traffic from/to""" - self.cidrlist = [] - """the ending port of ACL""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """The network of the vm the ACL will be created for""" - self.networkid = None - """The network of the vm the ACL will be created for""" - self.number = None - """the starting port of ACL""" - self.startport = None - """the traffic type for the ACL,can be Ingress or Egress, defaulted to Ingress if not specified""" - self.traffictype = None - self.required = ["protocol",] - -class createNetworkACLResponse (baseResponse): - def __init__(self): - """the ID of the ACL Item""" - self.id = None - """the ID of the ACL this item belongs to""" - self.aclid = None - """Action of ACL Item. Allow/Deny""" - self.action = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the ending port of ACL's port range""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """Number of the ACL Item""" - self.number = None - """the protocol of the ACL""" - self.protocol = None - """the starting port of ACL's port range""" - self.startport = None - """the state of the rule""" - self.state = None - """the traffic type for the ACL""" - self.traffictype = None - """the list of resource tags associated with the network ACLs""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACLList.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACLList.py deleted file mode 100644 index d13ffc163fc..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkACLList.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. - - -"""Creates a Network ACL for the given VPC""" -from baseCmd import * -from baseResponse import * -class createNetworkACLListCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Name of the network ACL List""" - """Required""" - self.name = None - """Id of the VPC associated with this network ACL List""" - """Required""" - self.vpcid = None - """Description of the network ACL List""" - self.description = None - self.required = ["name","vpcid",] - -class createNetworkACLListResponse (baseResponse): - def __init__(self): - """the ID of the ACL""" - self.id = None - """Description of the ACL""" - self.description = None - """the Name of the ACL""" - self.name = None - """Id of the VPC this ACL is associated with""" - self.vpcid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkOffering.py deleted file mode 100644 index e7b29d54891..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createNetworkOffering.py +++ /dev/null @@ -1,167 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a network offering.""" -from baseCmd import * -from baseResponse import * -class createNetworkOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the display text of the network offering""" - """Required""" - self.displaytext = None - """guest type of the network offering: Shared or Isolated""" - """Required""" - self.guestiptype = None - """the name of the network offering""" - """Required""" - self.name = None - """services supported by the network offering""" - """Required""" - self.supportedservices = [] - """the traffic type for the network offering. Supported type in current release is GUEST only""" - """Required""" - self.traffictype = None - """the availability of network offering. Default value is Optional""" - self.availability = None - """true if the network offering is IP conserve mode enabled""" - self.conservemode = None - """Network offering details in key/value pairs. Supported keys are internallbprovider/publiclbprovider with service provider as a value""" - self.details = [] - """true if default guest network egress policy is allow; false if default egress policy is deny""" - self.egressdefaultpolicy = None - """true if network offering supports persistent networks; defaulted to false if not specified""" - self.ispersistent = None - """maximum number of concurrent connections supported by the network offering""" - self.maxconnections = None - """data transfer rate in megabits per second allowed""" - self.networkrate = None - """desired service capabilities as part of network offering""" - self.servicecapabilitylist = [] - """the service offering ID used by virtual router provider""" - self.serviceofferingid = None - """provider to service mapping. If not specified, the provider for the service will be mapped to the default provider on the physical network""" - self.serviceproviderlist = [] - """true if network offering supports specifying ip ranges; defaulted to false if not specified""" - self.specifyipranges = None - """true if network offering supports vlans""" - self.specifyvlan = None - """the tags for the network offering.""" - self.tags = None - self.required = ["displaytext","guestiptype","name","supportedservices","traffictype",] - -class createNetworkOfferingResponse (baseResponse): - def __init__(self): - """the id of the network offering""" - self.id = None - """availability of the network offering""" - self.availability = None - """true if network offering is ip conserve mode enabled""" - self.conservemode = None - """the date this network offering was created""" - self.created = None - """additional key/value details tied with network offering""" - self.details = None - """an alternate display text of the network offering.""" - self.displaytext = None - """true if network offering supports persistent networks, false otherwise""" - self.egressdefaultpolicy = None - """true if network offering can be used by VPC networks only""" - self.forvpc = None - """guest type of the network offering, can be Shared or Isolated""" - self.guestiptype = None - """true if network offering is default, false otherwise""" - self.isdefault = None - """true if network offering supports persistent networks, false otherwise""" - self.ispersistent = None - """maximum number of concurrents connections to be handled by lb""" - self.maxconnections = None - """the name of the network offering""" - self.name = None - """data transfer rate in megabits per second allowed.""" - self.networkrate = None - """the ID of the service offering used by virtual router provider""" - self.serviceofferingid = None - """true if network offering supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """true if network offering supports vlans, false otherwise""" - self.specifyvlan = None - """state of the network offering. Can be Disabled/Enabled/Inactive""" - self.state = None - """the tags for the network offering""" - self.tags = None - """the traffic type for the network offering, supported types are Public, Management, Control, Guest, Vlan or Storage.""" - self.traffictype = None - """the list of supported services""" - self.service = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPhysicalNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPhysicalNetwork.py deleted file mode 100644 index 8bbb8d83084..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createPhysicalNetwork.py +++ /dev/null @@ -1,67 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a physical network""" -from baseCmd import * -from baseResponse import * -class createPhysicalNetworkCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the name of the physical network""" - """Required""" - self.name = None - """the Zone ID for the physical network""" - """Required""" - self.zoneid = None - """the broadcast domain range for the physical network[Pod or Zone]. In Acton release it can be Zone only in Advance zone, and Pod in Basic""" - self.broadcastdomainrange = None - """domain ID of the account owning a physical network""" - self.domainid = None - """the isolation method for the physical network[VLAN/L3/GRE]""" - self.isolationmethods = [] - """the speed for the physical network[1G/10G]""" - self.networkspeed = None - """Tag the physical network""" - self.tags = [] - """the VLAN for the physical network""" - self.vlan = None - self.required = ["name","zoneid",] - -class createPhysicalNetworkResponse (baseResponse): - def __init__(self): - """the uuid of the physical network""" - self.id = None - """Broadcast domain range of the physical network""" - self.broadcastdomainrange = None - """the domain id of the physical network owner""" - self.domainid = None - """isolation methods""" - self.isolationmethods = None - """name of the physical network""" - self.name = None - """the speed of the physical network""" - self.networkspeed = None - """state of the physical network""" - self.state = None - """comma separated tag""" - self.tags = None - """the vlan of the physical network""" - self.vlan = None - """zone id of the physical network""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPod.py deleted file mode 100644 index e84e563abaf..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createPod.py +++ /dev/null @@ -1,91 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a new Pod.""" -from baseCmd import * -from baseResponse import * -class createPodCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the gateway for the Pod""" - """Required""" - self.gateway = None - """the name of the Pod""" - """Required""" - self.name = None - """the netmask for the Pod""" - """Required""" - self.netmask = None - """the starting IP address for the Pod""" - """Required""" - self.startip = None - """the Zone ID in which the Pod will be created""" - """Required""" - self.zoneid = None - """Allocation state of this Pod for allocation of new resources""" - self.allocationstate = None - """the ending IP address for the Pod""" - self.endip = None - self.required = ["gateway","name","netmask","startip","zoneid",] - -class createPodResponse (baseResponse): - def __init__(self): - """the ID of the Pod""" - self.id = None - """the allocation state of the Pod""" - self.allocationstate = None - """the ending IP for the Pod""" - self.endip = None - """the gateway of the Pod""" - self.gateway = None - """the name of the Pod""" - self.name = None - """the netmask of the Pod""" - self.netmask = None - """the starting IP for the Pod""" - self.startip = None - """the Zone ID of the Pod""" - self.zoneid = None - """the Zone name of the Pod""" - self.zonename = None - """the capacity of the Pod""" - self.capacity = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPortForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPortForwardingRule.py deleted file mode 100644 index b7717e9e7ce..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createPortForwardingRule.py +++ /dev/null @@ -1,109 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a port forwarding rule""" -from baseCmd import * -from baseResponse import * -class createPortForwardingRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the IP address id of the port forwarding rule""" - """Required""" - self.ipaddressid = None - """the starting port of port forwarding rule's private port range""" - """Required""" - self.privateport = None - """the protocol for the port fowarding rule. Valid values are TCP or UDP.""" - """Required""" - self.protocol = None - """the starting port of port forwarding rule's public port range""" - """Required""" - self.publicport = None - """the ID of the virtual machine for the port forwarding rule""" - """Required""" - self.virtualmachineid = None - """the cidr list to forward traffic from""" - self.cidrlist = [] - """The network of the vm the Port Forwarding rule will be created for. Required when public Ip address is not associated with any Guest network yet (VPC case)""" - self.networkid = None - """if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. If not specified 1) defaulted to false when PF rule is being created for VPC guest network 2) in all other cases defaulted to true""" - self.openfirewall = None - """the ending port of port forwarding rule's private port range""" - self.privateendport = None - """the ending port of port forwarding rule's private port range""" - self.publicendport = None - """VM guest nic Secondary ip address for the port forwarding rule""" - self.vmguestip = None - self.required = ["ipaddressid","privateport","protocol","publicport","virtualmachineid",] - -class createPortForwardingRuleResponse (baseResponse): - def __init__(self): - """the ID of the port forwarding rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the public ip address for the port forwarding rule""" - self.ipaddress = None - """the public ip address id for the port forwarding rule""" - self.ipaddressid = None - """the ending port of port forwarding rule's private port range""" - self.privateendport = None - """the starting port of port forwarding rule's private port range""" - self.privateport = None - """the protocol of the port forwarding rule""" - self.protocol = None - """the ending port of port forwarding rule's private port range""" - self.publicendport = None - """the starting port of port forwarding rule's public port range""" - self.publicport = None - """the state of the rule""" - self.state = None - """the VM display name for the port forwarding rule""" - self.virtualmachinedisplayname = None - """the VM ID for the port forwarding rule""" - self.virtualmachineid = None - """the VM name for the port forwarding rule""" - self.virtualmachinename = None - """the vm ip address for the port forwarding rule""" - self.vmguestip = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPortableIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPortableIpRange.py deleted file mode 100644 index 2936ec148f2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createPortableIpRange.py +++ /dev/null @@ -1,85 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""adds a range of portable public IP's to a region""" -from baseCmd import * -from baseResponse import * -class createPortableIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ending IP address in the portable IP range""" - """Required""" - self.endip = None - """the gateway for the portable IP range""" - """Required""" - self.gateway = None - """the netmask of the portable IP range""" - """Required""" - self.netmask = None - """Id of the Region""" - """Required""" - self.regionid = None - """the beginning IP address in the portable IP range""" - """Required""" - self.startip = None - """VLAN id, if not specified defaulted to untagged""" - self.vlan = None - self.required = ["endip","gateway","netmask","regionid","startip",] - -class createPortableIpRangeResponse (baseResponse): - def __init__(self): - """portable IP range ID""" - self.id = None - """the end ip of the portable IP range""" - self.endip = None - """the gateway of the VLAN IP range""" - self.gateway = None - """the netmask of the VLAN IP range""" - self.netmask = None - """Region Id in which portable ip range is provisioned""" - self.regionid = None - """the start ip of the portable IP range""" - self.startip = None - """the ID or VID of the VLAN.""" - self.vlan = None - """List of portable IP and association with zone/network/vpc details that are part of GSLB rule""" - self.portableipaddress = [] - -class portableipaddress: - def __init__(self): - """"the account ID the portable IP address is associated with""" - self.accountid = None - """"date the portal IP address was acquired""" - self.allocated = None - """"the domain ID the portable IP address is associated with""" - self.domainid = None - """"public IP address""" - self.ipaddress = None - """"the ID of the Network where ip belongs to""" - self.networkid = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"Region Id in which global load balancer is created""" - self.regionid = None - """"State of the ip address. Can be: Allocatin, Allocated and Releasing""" - self.state = None - """"VPC the ip belongs to""" - self.vpcid = None - """"the ID of the zone the public IP address belongs to""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createPrivateGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createPrivateGateway.py deleted file mode 100644 index 3759a9838f2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createPrivateGateway.py +++ /dev/null @@ -1,86 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a private gateway""" -from baseCmd import * -from baseResponse import * -class createPrivateGatewayCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the gateway of the Private gateway""" - """Required""" - self.gateway = None - """the IP address of the Private gateaway""" - """Required""" - self.ipaddress = None - """the netmask of the Private gateway""" - """Required""" - self.netmask = None - """the network implementation uri for the private gateway""" - """Required""" - self.vlan = None - """the VPC network belongs to""" - """Required""" - self.vpcid = None - """the ID of the network ACL""" - self.aclid = None - """the uuid of the network offering to use for the private gateways network connection""" - self.networkofferingid = None - """the Physical Network ID the network belongs to""" - self.physicalnetworkid = None - """source NAT supported value. Default value false. If 'true' source NAT is enabled on the private gateway 'false': sourcenat is not supported""" - self.sourcenatsupported = None - self.required = ["gateway","ipaddress","netmask","vlan","vpcid",] - -class createPrivateGatewayResponse (baseResponse): - def __init__(self): - """the id of the private gateway""" - self.id = None - """the account associated with the private gateway""" - self.account = None - """ACL Id set for private gateway""" - self.aclid = None - """the domain associated with the private gateway""" - self.domain = None - """the ID of the domain associated with the private gateway""" - self.domainid = None - """the gateway""" - self.gateway = None - """the private gateway's ip address""" - self.ipaddress = None - """the private gateway's netmask""" - self.netmask = None - """the physical network id""" - self.physicalnetworkid = None - """the project name of the private gateway""" - self.project = None - """the project id of the private gateway""" - self.projectid = None - """Souce Nat enable status""" - self.sourcenatsupported = None - """State of the gateway, can be Creating, Ready, Deleting""" - self.state = None - """the network implementation uri for the private gateway""" - self.vlan = None - """VPC the private gateaway belongs to""" - self.vpcid = None - """zone id of the private gateway""" - self.zoneid = None - """the name of the zone the private gateway belongs to""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createProject.py deleted file mode 100644 index e4afd5e05ab..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createProject.py +++ /dev/null @@ -1,148 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a project""" -from baseCmd import * -from baseResponse import * -class createProjectCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """display text of the project""" - """Required""" - self.displaytext = None - """name of the project""" - """Required""" - self.name = None - """account who will be Admin for the project""" - self.account = None - """domain ID of the account owning a project""" - self.domainid = None - self.required = ["displaytext","name",] - -class createProjectResponse (baseResponse): - def __init__(self): - """the id of the project""" - self.id = None - """the account name of the project's owner""" - self.account = None - """the total number of cpu cores available to be created for this project""" - self.cpuavailable = None - """the total number of cpu cores the project can own""" - self.cpulimit = None - """the total number of cpu cores owned by project""" - self.cputotal = None - """the displaytext of the project""" - self.displaytext = None - """the domain name where the project belongs to""" - self.domain = None - """the domain id the project belongs to""" - self.domainid = None - """the total number of public ip addresses available for this project to acquire""" - self.ipavailable = None - """the total number of public ip addresses this project can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this project""" - self.iptotal = None - """the total memory (in MB) available to be created for this project""" - self.memoryavailable = None - """the total memory (in MB) the project can own""" - self.memorylimit = None - """the total memory (in MB) owned by project""" - self.memorytotal = None - """the name of the project""" - self.name = None - """the total number of networks available to be created for this project""" - self.networkavailable = None - """the total number of networks the project can own""" - self.networklimit = None - """the total number of networks owned by project""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this project""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the project can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by project""" - self.primarystoragetotal = None - """the total secondary storage space (in GiB) available to be used for this project""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the project can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by project""" - self.secondarystoragetotal = None - """the total number of snapshots available for this project""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this project""" - self.snapshotlimit = None - """the total number of snapshots stored by this project""" - self.snapshottotal = None - """the state of the project""" - self.state = None - """the total number of templates available to be created by this project""" - self.templateavailable = None - """the total number of templates which can be created by this project""" - self.templatelimit = None - """the total number of templates which have been created by this project""" - self.templatetotal = None - """the total number of virtual machines available for this project to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this project""" - self.vmlimit = None - """the total number of virtual machines running for this project""" - self.vmrunning = None - """the total number of virtual machines stopped for this project""" - self.vmstopped = None - """the total number of virtual machines deployed by this project""" - self.vmtotal = None - """the total volume available for this project""" - self.volumeavailable = None - """the total volume which can be used by this project""" - self.volumelimit = None - """the total volume being used by this project""" - self.volumetotal = None - """the total number of vpcs available to be created for this project""" - self.vpcavailable = None - """the total number of vpcs the project can own""" - self.vpclimit = None - """the total number of vpcs owned by project""" - self.vpctotal = None - """the list of resource tags associated with vm""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createRemoteAccessVpn.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createRemoteAccessVpn.py deleted file mode 100644 index 71f2f84688d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createRemoteAccessVpn.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. - - -"""Creates a l2tp/ipsec remote access vpn""" -from baseCmd import * -from baseResponse import * -class createRemoteAccessVpnCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """public ip address id of the vpn server""" - """Required""" - self.publicipid = None - """an optional account for the VPN. Must be used with domainId.""" - self.account = None - """an optional domainId for the VPN. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """the range of ip addresses to allocate to vpn clients. The first ip in the range will be taken by the vpn server""" - self.iprange = None - """if true, firewall rule for source/end pubic port is automatically created; if false - firewall rule has to be created explicitely. Has value true by default""" - self.openfirewall = None - self.required = ["publicipid",] - -class createRemoteAccessVpnResponse (baseResponse): - def __init__(self): - """the id of the remote access vpn""" - self.id = None - """the account of the remote access vpn""" - self.account = None - """the domain name of the account of the remote access vpn""" - self.domain = None - """the domain id of the account of the remote access vpn""" - self.domainid = None - """the range of ips to allocate to the clients""" - self.iprange = None - """the ipsec preshared key""" - self.presharedkey = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the public ip address of the vpn server""" - self.publicip = None - """the public ip address of the vpn server""" - self.publicipid = None - """the state of the rule""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSSHKeyPair.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSSHKeyPair.py deleted file mode 100644 index 9415566b5c9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createSSHKeyPair.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. - - -"""Create a new keypair and returns the private key""" -from baseCmd import * -from baseResponse import * -class createSSHKeyPairCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Name of the keypair""" - """Required""" - self.name = None - """an optional account for the ssh key. Must be used with domainId.""" - self.account = None - """an optional domainId for the ssh key. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """an optional project for the ssh key""" - self.projectid = None - self.required = ["name",] - -class createSSHKeyPairResponse (baseResponse): - def __init__(self): - """Fingerprint of the public key""" - self.fingerprint = None - """Name of the keypair""" - self.name = None - """Private key""" - self.privatekey = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSecondaryStagingStore.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSecondaryStagingStore.py deleted file mode 100644 index 74fea7fb57a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createSecondaryStagingStore.py +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""create secondary staging store.""" -from baseCmd import * -from baseResponse import * -class createSecondaryStagingStoreCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the URL for the staging store""" - """Required""" - self.url = None - """the details for the staging store""" - self.details = [] - """the staging store provider name""" - self.provider = None - """the scope of the staging store: zone only for now""" - self.scope = None - """the Zone ID for the staging store""" - self.zoneid = None - self.required = ["url",] - -class createSecondaryStagingStoreResponse (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSecurityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSecurityGroup.py deleted file mode 100644 index 321431c2720..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createSecurityGroup.py +++ /dev/null @@ -1,131 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a security group""" -from baseCmd import * -from baseResponse import * -class createSecurityGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """name of the security group""" - """Required""" - self.name = None - """an optional account for the security group. Must be used with domainId.""" - self.account = None - """the description of the security group""" - self.description = None - """an optional domainId for the security group. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """Create security group for project""" - self.projectid = None - self.required = ["name",] - -class createSecurityGroupResponse (baseResponse): - def __init__(self): - """the ID of the security group""" - self.id = None - """the account owning the security group""" - self.account = None - """the description of the security group""" - self.description = None - """the domain name of the security group""" - self.domain = None - """the domain ID of the security group""" - self.domainid = None - """the name of the security group""" - self.name = None - """the project name of the group""" - self.project = None - """the project id of the group""" - self.projectid = None - """the list of egress rules associated with the security group""" - self.egressrule = [] - """the list of ingress rules associated with the security group""" - self.ingressrule = [] - """the list of resource tags associated with the rule""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createServiceOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createServiceOffering.py deleted file mode 100644 index a9f4f739aa8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createServiceOffering.py +++ /dev/null @@ -1,151 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a service offering.""" -from baseCmd import * -from baseResponse import * -class createServiceOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the CPU number of the service offering""" - """Required""" - self.cpunumber = None - """the CPU speed of the service offering in MHz.""" - """Required""" - self.cpuspeed = None - """the display text of the service offering""" - """Required""" - self.displaytext = None - """the total memory of the service offering in MB""" - """Required""" - self.memory = None - """the name of the service offering""" - """Required""" - self.name = None - """bytes read rate of the disk offering""" - self.bytesreadrate = None - """bytes write rate of the disk offering""" - self.byteswriterate = None - """The deployment planner heuristics used to deploy a VM of this offering. If null, value of global config vm.deployment.planner is used""" - self.deploymentplanner = None - """the ID of the containing domain, null for public offerings""" - self.domainid = None - """the host tag for this service offering.""" - self.hosttags = None - """io requests read rate of the disk offering""" - self.iopsreadrate = None - """io requests write rate of the disk offering""" - self.iopswriterate = None - """is this a system vm offering""" - self.issystem = None - """true if the virtual machine needs to be volatile so that on every reboot of VM, original root disk is dettached then destroyed and a fresh root disk is created and attached to VM""" - self.isvolatile = None - """restrict the CPU usage to committed service offering""" - self.limitcpuuse = None - """data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having "domainrouter" systemvmtype""" - self.networkrate = None - """the HA for the service offering""" - self.offerha = None - """details for planner, used to store specific parameters""" - self.serviceofferingdetails = [] - """the storage type of the service offering. Values are local and shared.""" - self.storagetype = None - """the system VM type. Possible types are "domainrouter", "consoleproxy" and "secondarystoragevm".""" - self.systemvmtype = None - """the tags for this service offering.""" - self.tags = None - self.required = ["cpunumber","cpuspeed","displaytext","memory","name",] - -class createServiceOfferingResponse (baseResponse): - def __init__(self): - """the id of the service offering""" - self.id = None - """the number of CPU""" - self.cpunumber = None - """the clock rate CPU speed in Mhz""" - self.cpuspeed = None - """the date this service offering was created""" - self.created = None - """is this a default system vm offering""" - self.defaultuse = None - """deployment strategy used to deploy VM.""" - self.deploymentplanner = None - """bytes read rate of the service offering""" - self.diskBytesReadRate = None - """bytes write rate of the service offering""" - self.diskBytesWriteRate = None - """io requests read rate of the service offering""" - self.diskIopsReadRate = None - """io requests write rate of the service offering""" - self.diskIopsWriteRate = None - """an alternate display text of the service offering.""" - self.displaytext = None - """Domain name for the offering""" - self.domain = None - """the domain id of the service offering""" - self.domainid = None - """the host tag for the service offering""" - self.hosttags = None - """is this a system vm offering""" - self.issystem = None - """true if the vm needs to be volatile, i.e., on every reboot of vm from API root disk is discarded and creates a new root disk""" - self.isvolatile = None - """restrict the CPU usage to committed service offering""" - self.limitcpuuse = None - """the memory in MB""" - self.memory = None - """the name of the service offering""" - self.name = None - """data transfer rate in megabits per second allowed.""" - self.networkrate = None - """the ha support in the service offering""" - self.offerha = None - """additional key/value details tied with this service offering""" - self.serviceofferingdetails = None - """the storage type for this service offering""" - self.storagetype = None - """is this a the systemvm type for system vm offering""" - self.systemvmtype = None - """the tags for the service offering""" - self.tags = None - """the list of resource tags associated with service offering. The resource tags are not used for Volume/VM placement on the specific host.""" - self.resourcetags = [] - -class resourcetags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshot.py deleted file mode 100644 index 2ea1a0d12b8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshot.py +++ /dev/null @@ -1,97 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates an instant snapshot of a volume.""" -from baseCmd import * -from baseResponse import * -class createSnapshotCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the disk volume""" - """Required""" - self.volumeid = None - """The account of the snapshot. The account parameter must be used with the domainId parameter.""" - self.account = None - """The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume.""" - self.domainid = None - """policy id of the snapshot, if this is null, then use MANUAL_POLICY.""" - self.policyid = None - self.required = ["volumeid",] - -class createSnapshotResponse (baseResponse): - def __init__(self): - """ID of the snapshot""" - self.id = None - """the account associated with the snapshot""" - self.account = None - """the date the snapshot was created""" - self.created = None - """the domain name of the snapshot's account""" - self.domain = None - """the domain ID of the snapshot's account""" - self.domainid = None - """valid types are hourly, daily, weekly, monthy, template, and none.""" - self.intervaltype = None - """name of the snapshot""" - self.name = None - """the project name of the snapshot""" - self.project = None - """the project id of the snapshot""" - self.projectid = None - """the type of the snapshot""" - self.snapshottype = None - """the state of the snapshot. BackedUp means that snapshot is ready to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp - the snapshot is being backed up on secondary storage""" - self.state = None - """ID of the disk volume""" - self.volumeid = None - """name of the disk volume""" - self.volumename = None - """type of the disk volume""" - self.volumetype = None - """id of the availability zone""" - self.zoneid = None - """the list of resource tags associated with snapshot""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshotPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshotPolicy.py deleted file mode 100644 index f0eb86525de..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createSnapshotPolicy.py +++ /dev/null @@ -1,56 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a snapshot policy for the account.""" -from baseCmd import * -from baseResponse import * -class createSnapshotPolicyCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """valid values are HOURLY, DAILY, WEEKLY, and MONTHLY""" - """Required""" - self.intervaltype = None - """maximum number of snapshots to retain""" - """Required""" - self.maxsnaps = None - """time the snapshot is scheduled to be taken. Format is:* if HOURLY, MM* if DAILY, MM:HH* if WEEKLY, MM:HH:DD (1-7)* if MONTHLY, MM:HH:DD (1-28)""" - """Required""" - self.schedule = None - """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" - """Required""" - self.timezone = None - """the ID of the disk volume""" - """Required""" - self.volumeid = None - self.required = ["intervaltype","maxsnaps","schedule","timezone","volumeid",] - -class createSnapshotPolicyResponse (baseResponse): - def __init__(self): - """the ID of the snapshot policy""" - self.id = None - """the interval type of the snapshot policy""" - self.intervaltype = None - """maximum number of snapshots retained""" - self.maxsnaps = None - """time the snapshot is scheduled to be taken.""" - self.schedule = None - """the time zone of the snapshot policy""" - self.timezone = None - """the ID of the disk volume""" - self.volumeid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createStaticRoute.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createStaticRoute.py deleted file mode 100644 index 1a58ccda510..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createStaticRoute.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. - - -"""Creates a static route""" -from baseCmd import * -from baseResponse import * -class createStaticRouteCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """static route cidr""" - """Required""" - self.cidr = None - """the gateway id we are creating static route for""" - """Required""" - self.gatewayid = None - self.required = ["cidr","gatewayid",] - -class createStaticRouteResponse (baseResponse): - def __init__(self): - """the ID of static route""" - self.id = None - """the account associated with the static route""" - self.account = None - """static route CIDR""" - self.cidr = None - """the domain associated with the static route""" - self.domain = None - """the ID of the domain associated with the static route""" - self.domainid = None - """VPC gateway the route is created for""" - self.gatewayid = None - """the project name of the static route""" - self.project = None - """the project id of the static route""" - self.projectid = None - """the state of the static route""" - self.state = None - """VPC the static route belongs to""" - self.vpcid = None - """the list of resource tags associated with static route""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createStorageNetworkIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createStorageNetworkIpRange.py deleted file mode 100644 index 8e695dae42e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createStorageNetworkIpRange.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. - - -"""Creates a Storage network IP range.""" -from baseCmd import * -from baseResponse import * -class createStorageNetworkIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the gateway for storage network""" - """Required""" - self.gateway = None - """the netmask for storage network""" - """Required""" - self.netmask = None - """UUID of pod where the ip range belongs to""" - """Required""" - self.podid = None - """the beginning IP address""" - """Required""" - self.startip = None - """the ending IP address""" - self.endip = None - """Optional. The vlan the ip range sits on, default to Null when it is not specificed which means you network is not on any Vlan. This is mainly for Vmware as other hypervisors can directly reterive bridge from pyhsical network traffic type table""" - self.vlan = None - self.required = ["gateway","netmask","podid","startip",] - -class createStorageNetworkIpRangeResponse (baseResponse): - def __init__(self): - """the uuid of storage network IP range.""" - self.id = None - """the end ip of the storage network IP range""" - self.endip = None - """the gateway of the storage network IP range""" - self.gateway = None - """the netmask of the storage network IP range""" - self.netmask = None - """the network uuid of storage network IP range""" - self.networkid = None - """the Pod uuid for the storage network IP range""" - self.podid = None - """the start ip of the storage network IP range""" - self.startip = None - """the ID or VID of the VLAN.""" - self.vlan = None - """the Zone uuid of the storage network IP range""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createStoragePool.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createStoragePool.py deleted file mode 100644 index 1186e766bb7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createStoragePool.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. - - -"""Creates a storage pool.""" -from baseCmd import * -from baseResponse import * -class createStoragePoolCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the name for the storage pool""" - """Required""" - self.name = None - """the URL of the storage pool""" - """Required""" - self.url = None - """the Zone ID for the storage pool""" - """Required""" - self.zoneid = None - """bytes CloudStack can provision from this storage pool""" - self.capacitybytes = None - """IOPS CloudStack can provision from this storage pool""" - self.capacityiops = None - """the cluster ID for the storage pool""" - self.clusterid = None - """the details for the storage pool""" - self.details = [] - """hypervisor type of the hosts in zone that will be attached to this storage pool. KVM, VMware supported as of now.""" - self.hypervisor = None - """whether the storage should be managed by CloudStack""" - self.managed = None - """the Pod ID for the storage pool""" - self.podid = None - """the storage provider name""" - self.provider = None - """the scope of the storage: cluster or zone""" - self.scope = None - """the tags for the storage pool""" - self.tags = None - self.required = ["name","url","zoneid",] - -class createStoragePoolResponse (baseResponse): - def __init__(self): - """the ID of the storage pool""" - self.id = None - """IOPS CloudStack can provision from this storage pool""" - self.capacityiops = None - """the ID of the cluster for the storage pool""" - self.clusterid = None - """the name of the cluster for the storage pool""" - self.clustername = None - """the date and time the storage pool was created""" - self.created = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the storage pool""" - self.disksizetotal = None - """the host's currently used disk size""" - self.disksizeused = None - """the hypervisor type of the storage pool""" - self.hypervisor = None - """the IP address of the storage pool""" - self.ipaddress = None - """the name of the storage pool""" - self.name = None - """the storage pool path""" - self.path = None - """the Pod ID of the storage pool""" - self.podid = None - """the Pod name of the storage pool""" - self.podname = None - """the scope of the storage pool""" - self.scope = None - """the state of the storage pool""" - self.state = None - """true if this pool is suitable to migrate a volume, false otherwise""" - self.suitableformigration = None - """the tags for the storage pool""" - self.tags = None - """the storage pool type""" - self.type = None - """the Zone ID of the storage pool""" - self.zoneid = None - """the Zone name of the storage pool""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createTags.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createTags.py deleted file mode 100644 index f380b527b62..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createTags.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. - - -"""Creates resource tag(s)""" -from baseCmd import * -from baseResponse import * -class createTagsCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """list of resources to create the tags for""" - """Required""" - self.resourceids = [] - """type of the resource""" - """Required""" - self.resourcetype = None - """Map of tags (key/value pairs)""" - """Required""" - self.tags = [] - """identifies client specific tag. When the value is not null, the tag can't be used by cloudStack code internally""" - self.customer = None - self.required = ["resourceids","resourcetype","tags",] - -class createTagsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createTemplate.py deleted file mode 100644 index cfb848cab49..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createTemplate.py +++ /dev/null @@ -1,161 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a template of a virtual machine. The virtual machine must be in a STOPPED state. A template created from this command is automatically designated as a private template visible to the account that created it.""" -from baseCmd import * -from baseResponse import * -class createTemplateCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the display text of the template. This is usually used for display purposes.""" - """Required""" - self.displaytext = None - """the name of the template""" - """Required""" - self.name = None - """the ID of the OS Type that best represents the OS of this template.""" - """Required""" - self.ostypeid = None - """32 or 64 bit""" - self.bits = None - """Template details in key/value pairs.""" - self.details = [] - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template supports the password reset feature; default is false""" - self.passwordenabled = None - """true if the template requres HVM, false otherwise""" - self.requireshvm = None - """the ID of the snapshot the template is being created from. Either this parameter, or volumeId has to be passed in""" - self.snapshotid = None - """the tag for this template.""" - self.templatetag = None - """Optional, only for baremetal hypervisor. The directory name where template stored on CIFS server""" - self.url = None - """Optional, VM ID. If this presents, it is going to create a baremetal template for VM this ID refers to. This is only for VM whose hypervisor type is BareMetal""" - self.virtualmachineid = None - """the ID of the disk volume the template is being created from. Either this parameter, or snapshotId has to be passed in""" - self.volumeid = None - self.required = ["displaytext","name","ostypeid",] - -class createTemplateResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createUser.py deleted file mode 100644 index 0914db87542..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createUser.py +++ /dev/null @@ -1,87 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a user for an account that already exists""" -from baseCmd import * -from baseResponse import * -class createUserCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Creates the user under the specified account. If no account is specified, the username will be used as the account name.""" - """Required""" - self.account = None - """email""" - """Required""" - self.email = None - """firstname""" - """Required""" - self.firstname = None - """lastname""" - """Required""" - self.lastname = None - """Clear text password (Default hashed to SHA256SALT). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.""" - """Required""" - self.password = None - """Unique username.""" - """Required""" - self.username = None - """Creates the user under the specified domain. Has to be accompanied with the account parameter""" - self.domainid = None - """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" - self.timezone = None - """User UUID, required for adding account from external provisioning system""" - self.userid = None - self.required = ["account","email","firstname","lastname","password","username",] - -class createUserResponse (baseResponse): - def __init__(self): - """the user ID""" - self.id = None - """the account name of the user""" - self.account = None - """the account ID of the user""" - self.accountid = None - """the account type of the user""" - self.accounttype = None - """the api key of the user""" - self.apikey = None - """the date and time the user account was created""" - self.created = None - """the domain name of the user""" - self.domain = None - """the domain ID of the user""" - self.domainid = None - """the user email address""" - self.email = None - """the user firstname""" - self.firstname = None - """the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """true if user is default, false otherwise""" - self.isdefault = None - """the user lastname""" - self.lastname = None - """the secret key of the user""" - self.secretkey = None - """the user state""" - self.state = None - """the timezone user was created in""" - self.timezone = None - """the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVMSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVMSnapshot.py deleted file mode 100644 index 36366748f04..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVMSnapshot.py +++ /dev/null @@ -1,72 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates snapshot for a vm.""" -from baseCmd import * -from baseResponse import * -class createVMSnapshotCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the vm""" - """Required""" - self.virtualmachineid = None - """The discription of the snapshot""" - self.description = None - """The display name of the snapshot""" - self.name = None - """snapshot memory if true""" - self.snapshotmemory = None - self.required = ["virtualmachineid",] - -class createVMSnapshotResponse (baseResponse): - def __init__(self): - """the ID of the vm snapshot""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the create date of the vm snapshot""" - self.created = None - """indiates if this is current snapshot""" - self.current = None - """the description of the vm snapshot""" - self.description = None - """the display name of the vm snapshot""" - self.displayname = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """the name of the vm snapshot""" - self.name = None - """the parent ID of the vm snapshot""" - self.parent = None - """the parent displayName of the vm snapshot""" - self.parentName = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the state of the vm snapshot""" - self.state = None - """VM Snapshot type""" - self.type = None - """the vm ID of the vm snapshot""" - self.virtualmachineid = None - """the Zone ID of the vm snapshot""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVPC.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVPC.py deleted file mode 100644 index 5307f8a619a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVPC.py +++ /dev/null @@ -1,413 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a VPC""" -from baseCmd import * -from baseResponse import * -class createVPCCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the cidr of the VPC. All VPC guest networks' cidrs should be within this CIDR""" - """Required""" - self.cidr = None - """the display text of the VPC""" - """Required""" - self.displaytext = None - """the name of the VPC""" - """Required""" - self.name = None - """the ID of the VPC offering""" - """Required""" - self.vpcofferingid = None - """the ID of the availability zone""" - """Required""" - self.zoneid = None - """the account associated with the VPC. Must be used with the domainId parameter.""" - self.account = None - """the domain ID associated with the VPC. If used with the account parameter returns the VPC associated with the account for the specified domain.""" - self.domainid = None - """VPC network domain. All networks inside the VPC will belong to this domain""" - self.networkdomain = None - """create VPC for the project""" - self.projectid = None - self.required = ["cidr","displaytext","name","vpcofferingid","zoneid",] - -class createVPCResponse (baseResponse): - def __init__(self): - """the id of the VPC""" - self.id = None - """the owner of the VPC""" - self.account = None - """the cidr the VPC""" - self.cidr = None - """the date this VPC was created""" - self.created = None - """an alternate display text of the VPC.""" - self.displaytext = None - """the domain name of the owner""" - self.domain = None - """the domain id of the VPC owner""" - self.domainid = None - """the name of the VPC""" - self.name = None - """the network domain of the VPC""" - self.networkdomain = None - """the project name of the VPC""" - self.project = None - """the project id of the VPC""" - self.projectid = None - """true VPC requires restart""" - self.restartrequired = None - """state of the VPC. Can be Inactive/Enabled""" - self.state = None - """vpc offering id the VPC is created from""" - self.vpcofferingid = None - """zone id of the vpc""" - self.zoneid = None - """the name of the zone the VPC belongs to""" - self.zonename = None - """the list of networks belongign to the VPC""" - self.network = [] - """the list of supported services""" - self.service = [] - """the list of resource tags associated with the project""" - self.tags = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class network: - def __init__(self): - """"the id of the network""" - self.id = None - """"the owner of the network""" - self.account = None - """"ACL Id associated with the VPC network""" - self.aclid = None - """"acl type - access type to the network""" - self.acltype = None - """"Broadcast domain type of the network""" - self.broadcastdomaintype = None - """"broadcast uri of the network. This parameter is visible to ROOT admins only""" - self.broadcasturi = None - """"list networks available for vm deployment""" - self.canusefordeploy = None - """"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" - self.cidr = None - """"an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """"the displaytext of the network""" - self.displaytext = None - """"the first DNS for the network""" - self.dns1 = None - """"the second DNS for the network""" - self.dns2 = None - """"the domain name of the network owner""" - self.domain = None - """"the domain id of the network owner""" - self.domainid = None - """"the network's gateway""" - self.gateway = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"true if network is default, false otherwise""" - self.isdefault = None - """"list networks that are persistent""" - self.ispersistent = None - """"true if network is system, false otherwise""" - self.issystem = None - """"the name of the network""" - self.name = None - """"the network's netmask""" - self.netmask = None - """"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" - self.networkcidr = None - """"the network domain""" - self.networkdomain = None - """"availability of the network offering the network is created from""" - self.networkofferingavailability = None - """"true if network offering is ip conserve mode enabled""" - self.networkofferingconservemode = None - """"display text of the network offering the network is created from""" - self.networkofferingdisplaytext = None - """"network offering id the network is created from""" - self.networkofferingid = None - """"name of the network offering the network is created from""" - self.networkofferingname = None - """"the physical network id""" - self.physicalnetworkid = None - """"the project name of the address""" - self.project = None - """"the project id of the ipaddress""" - self.projectid = None - """"related to what other network configuration""" - self.related = None - """"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" - self.reservediprange = None - """"true network requires restart""" - self.restartrequired = None - """"true if network supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """"state of the network""" - self.state = None - """"true if users from subdomains can access the domain level network""" - self.subdomainaccess = None - """"the traffic type of the network""" - self.traffictype = None - """"the type of the network""" - self.type = None - """"The vlan of the network. This parameter is visible to ROOT admins only""" - self.vlan = None - """"VPC the network belongs to""" - self.vpcid = None - """"zone id of the network""" - self.zoneid = None - """"the name of the zone the network belongs to""" - self.zonename = None - """"the list of services""" - self.service = [] - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - """"the list of resource tags associated with network""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVPCOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVPCOffering.py deleted file mode 100644 index e36234e048f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVPCOffering.py +++ /dev/null @@ -1,109 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates VPC offering""" -from baseCmd import * -from baseResponse import * -class createVPCOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the display text of the vpc offering""" - """Required""" - self.displaytext = None - """the name of the vpc offering""" - """Required""" - self.name = None - """services supported by the vpc offering""" - """Required""" - self.supportedservices = [] - """provider to service mapping. If not specified, the provider for the service will be mapped to the default provider on the physical network""" - self.serviceproviderlist = [] - self.required = ["displaytext","name","supportedservices",] - -class createVPCOfferingResponse (baseResponse): - def __init__(self): - """the id of the vpc offering""" - self.id = None - """the date this vpc offering was created""" - self.created = None - """an alternate display text of the vpc offering.""" - self.displaytext = None - """true if vpc offering is default, false otherwise""" - self.isdefault = None - """the name of the vpc offering""" - self.name = None - """state of the vpc offering. Can be Disabled/Enabled""" - self.state = None - """the list of supported services""" - self.service = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVirtualRouterElement.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVirtualRouterElement.py deleted file mode 100644 index 9c1d48b9523..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVirtualRouterElement.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. - - -"""Create a virtual router element.""" -from baseCmd import * -from baseResponse import * -class createVirtualRouterElementCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the network service provider ID of the virtual router element""" - """Required""" - self.nspid = None - """The provider type. Supported types are VirtualRouter (default) and VPCVirtualRouter""" - self.providertype = None - self.required = ["nspid",] - -class createVirtualRouterElementResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the provider""" - self.account = None - """the domain associated with the provider""" - self.domain = None - """the domain ID associated with the provider""" - self.domainid = None - """Enabled/Disabled the service provider""" - self.enabled = None - """the physical network service provider id of the provider""" - self.nspid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVlanIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVlanIpRange.py deleted file mode 100644 index 0a16e334ef9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVlanIpRange.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. - - -"""Creates a VLAN IP range.""" -from baseCmd import * -from baseResponse import * -class createVlanIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """account who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited""" - self.account = None - """domain ID of the account owning a VLAN""" - self.domainid = None - """the ending IP address in the VLAN IP range""" - self.endip = None - """the ending IPv6 address in the IPv6 network range""" - self.endipv6 = None - """true if VLAN is of Virtual type, false if Direct""" - self.forvirtualnetwork = None - """the gateway of the VLAN IP range""" - self.gateway = None - """the CIDR of IPv6 network, must be at least /64""" - self.ip6cidr = None - """the gateway of the IPv6 network. Required for Shared networks and Isolated networks when it belongs to VPC""" - self.ip6gateway = None - """the netmask of the VLAN IP range""" - self.netmask = None - """the network id""" - self.networkid = None - """the physical network id""" - self.physicalnetworkid = None - """optional parameter. Have to be specified for Direct Untagged vlan only.""" - self.podid = None - """project who will own the VLAN. If VLAN is Zone wide, this parameter should be ommited""" - self.projectid = None - """the beginning IP address in the VLAN IP range""" - self.startip = None - """the beginning IPv6 address in the IPv6 network range""" - self.startipv6 = None - """the ID or VID of the VLAN. If not specified, will be defaulted to the vlan of the network or if vlan of the network is null - to Untagged""" - self.vlan = None - """the Zone ID of the VLAN IP range""" - self.zoneid = None - self.required = [] - -class createVlanIpRangeResponse (baseResponse): - def __init__(self): - """the ID of the VLAN IP range""" - self.id = None - """the account of the VLAN IP range""" - self.account = None - """the description of the VLAN IP range""" - self.description = None - """the domain name of the VLAN IP range""" - self.domain = None - """the domain ID of the VLAN IP range""" - self.domainid = None - """the end ip of the VLAN IP range""" - self.endip = None - """the end ipv6 of the VLAN IP range""" - self.endipv6 = None - """the virtual network for the VLAN IP range""" - self.forvirtualnetwork = None - """the gateway of the VLAN IP range""" - self.gateway = None - """the cidr of IPv6 network""" - self.ip6cidr = None - """the gateway of IPv6 network""" - self.ip6gateway = None - """the netmask of the VLAN IP range""" - self.netmask = None - """the network id of vlan range""" - self.networkid = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """the Pod ID for the VLAN IP range""" - self.podid = None - """the Pod name for the VLAN IP range""" - self.podname = None - """the project name of the vlan range""" - self.project = None - """the project id of the vlan range""" - self.projectid = None - """the start ip of the VLAN IP range""" - self.startip = None - """the start ipv6 of the VLAN IP range""" - self.startipv6 = None - """the ID or VID of the VLAN.""" - self.vlan = None - """the Zone ID of the VLAN IP range""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVolume.py deleted file mode 100644 index 4b6f91a20d7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVolume.py +++ /dev/null @@ -1,163 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.""" -from baseCmd import * -from baseResponse import * -class createVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the name of the disk volume""" - """Required""" - self.name = None - """the account associated with the disk volume. Must be used with the domainId parameter.""" - self.account = None - """the ID of the disk offering. Either diskOfferingId or snapshotId must be passed in.""" - self.diskofferingid = None - """an optional field, whether to display the volume to the end user or not.""" - self.displayvolume = None - """the domain ID associated with the disk offering. If used with the account parameter returns the disk volume associated with the account for the specified domain.""" - self.domainid = None - """max iops""" - self.maxiops = None - """min iops""" - self.miniops = None - """the project associated with the volume. Mutually exclusive with account parameter""" - self.projectid = None - """Arbitrary volume size""" - self.size = None - """the snapshot ID for the disk volume. Either diskOfferingId or snapshotId must be passed in.""" - self.snapshotid = None - """the ID of the availability zone""" - self.zoneid = None - self.required = ["name",] - -class createVolumeResponse (baseResponse): - def __init__(self): - """ID of the disk volume""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the date the volume was attached to a VM instance""" - self.attached = None - """the date the disk volume was created""" - self.created = None - """the boolean state of whether the volume is destroyed or not""" - self.destroyed = None - """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" - self.deviceid = None - """bytes read rate of the disk volume""" - self.diskBytesReadRate = None - """bytes write rate of the disk volume""" - self.diskBytesWriteRate = None - """io requests read rate of the disk volume""" - self.diskIopsReadRate = None - """io requests write rate of the disk volume""" - self.diskIopsWriteRate = None - """the display text of the disk offering""" - self.diskofferingdisplaytext = None - """ID of the disk offering""" - self.diskofferingid = None - """name of the disk offering""" - self.diskofferingname = None - """an optional field whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """Hypervisor the volume belongs to""" - self.hypervisor = None - """true if the volume is extractable, false otherwise""" - self.isextractable = None - """max iops of the disk volume""" - self.maxiops = None - """min iops of the disk volume""" - self.miniops = None - """name of the disk volume""" - self.name = None - """The path of the volume""" - self.path = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the display text of the service offering for root disk""" - self.serviceofferingdisplaytext = None - """ID of the service offering for root disk""" - self.serviceofferingid = None - """name of the service offering for root disk""" - self.serviceofferingname = None - """size of the disk volume""" - self.size = None - """ID of the snapshot from which this volume was created""" - self.snapshotid = None - """the state of the disk volume""" - self.state = None - """the status of the volume""" - self.status = None - """name of the primary storage hosting the disk volume""" - self.storage = None - """id of the primary storage hosting the disk volume; returned to admin user only""" - self.storageid = None - """shared or local storage""" - self.storagetype = None - """type of the disk volume (ROOT or DATADISK)""" - self.type = None - """id of the virtual machine""" - self.virtualmachineid = None - """display name of the virtual machine""" - self.vmdisplayname = None - """name of the virtual machine""" - self.vmname = None - """state of the virtual machine""" - self.vmstate = None - """ID of the availability zone""" - self.zoneid = None - """name of the availability zone""" - self.zonename = None - """the list of resource tags associated with volume""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnConnection.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnConnection.py deleted file mode 100644 index 7e8cf7b1af4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnConnection.py +++ /dev/null @@ -1,75 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Create site to site vpn connection""" -from baseCmd import * -from baseResponse import * -class createVpnConnectionCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of the customer gateway""" - """Required""" - self.s2scustomergatewayid = None - """id of the vpn gateway""" - """Required""" - self.s2svpngatewayid = None - self.required = ["s2scustomergatewayid","s2svpngatewayid",] - -class createVpnConnectionResponse (baseResponse): - def __init__(self): - """the vpn gateway ID""" - self.id = None - """the owner""" - self.account = None - """guest cidr list of the customer gateway""" - self.cidrlist = None - """the date and time the host was created""" - self.created = None - """the domain name of the owner""" - self.domain = None - """the domain id of the owner""" - self.domainid = None - """if DPD is enabled for customer gateway""" - self.dpd = None - """Lifetime of ESP SA of customer gateway""" - self.esplifetime = None - """ESP policy of the customer gateway""" - self.esppolicy = None - """public ip address id of the customer gateway""" - self.gateway = None - """Lifetime of IKE SA of customer gateway""" - self.ikelifetime = None - """IKE policy of the customer gateway""" - self.ikepolicy = None - """IPsec Preshared-Key of the customer gateway""" - self.ipsecpsk = None - """the project name""" - self.project = None - """the project id""" - self.projectid = None - """the public IP address""" - self.publicip = None - """the date and time the host was removed""" - self.removed = None - """the customer gateway ID""" - self.s2scustomergatewayid = None - """the vpn gateway ID""" - self.s2svpngatewayid = None - """State of vpn connection""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnCustomerGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnCustomerGateway.py deleted file mode 100644 index 14d94bc744a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnCustomerGateway.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. - - -"""Creates site to site vpn customer gateway""" -from baseCmd import * -from baseResponse import * -class createVpnCustomerGatewayCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """guest cidr list of the customer gateway""" - """Required""" - self.cidrlist = None - """ESP policy of the customer gateway""" - """Required""" - self.esppolicy = None - """public ip address id of the customer gateway""" - """Required""" - self.gateway = None - """IKE policy of the customer gateway""" - """Required""" - self.ikepolicy = None - """IPsec Preshared-Key of the customer gateway""" - """Required""" - self.ipsecpsk = None - """the account associated with the gateway. Must be used with the domainId parameter.""" - self.account = None - """the domain ID associated with the gateway. If used with the account parameter returns the gateway associated with the account for the specified domain.""" - self.domainid = None - """If DPD is enabled for VPN connection""" - self.dpd = None - """Lifetime of phase 2 VPN connection to the customer gateway, in seconds""" - self.esplifetime = None - """Lifetime of phase 1 VPN connection to the customer gateway, in seconds""" - self.ikelifetime = None - """name of this customer gateway""" - self.name = None - self.required = ["cidrlist","esppolicy","gateway","ikepolicy","ipsecpsk",] - -class createVpnCustomerGatewayResponse (baseResponse): - def __init__(self): - """the vpn gateway ID""" - self.id = None - """the owner""" - self.account = None - """guest cidr list of the customer gateway""" - self.cidrlist = None - """the domain name of the owner""" - self.domain = None - """the domain id of the owner""" - self.domainid = None - """if DPD is enabled for customer gateway""" - self.dpd = None - """Lifetime of ESP SA of customer gateway""" - self.esplifetime = None - """IPsec policy of customer gateway""" - self.esppolicy = None - """public ip address id of the customer gateway""" - self.gateway = None - """Lifetime of IKE SA of customer gateway""" - self.ikelifetime = None - """IKE policy of customer gateway""" - self.ikepolicy = None - """guest ip of the customer gateway""" - self.ipaddress = None - """IPsec preshared-key of customer gateway""" - self.ipsecpsk = None - """name of the customer gateway""" - self.name = None - """the project name""" - self.project = None - """the project id""" - self.projectid = None - """the date and time the host was removed""" - self.removed = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnGateway.py deleted file mode 100644 index 918c55f5d51..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createVpnGateway.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. - - -"""Creates site to site vpn local gateway""" -from baseCmd import * -from baseResponse import * -class createVpnGatewayCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """public ip address id of the vpn gateway""" - """Required""" - self.vpcid = None - self.required = ["vpcid",] - -class createVpnGatewayResponse (baseResponse): - def __init__(self): - """the vpn gateway ID""" - self.id = None - """the owner""" - self.account = None - """the domain name of the owner""" - self.domain = None - """the domain id of the owner""" - self.domainid = None - """the project name""" - self.project = None - """the project id""" - self.projectid = None - """the public IP address""" - self.publicip = None - """the date and time the host was removed""" - self.removed = None - """the vpc id of this gateway""" - self.vpcid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/createZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/createZone.py deleted file mode 100644 index 364eeba6b77..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/createZone.py +++ /dev/null @@ -1,153 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a Zone.""" -from baseCmd import * -from baseResponse import * -class createZoneCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the first DNS for the Zone""" - """Required""" - self.dns1 = None - """the first internal DNS for the Zone""" - """Required""" - self.internaldns1 = None - """the name of the Zone""" - """Required""" - self.name = None - """network type of the zone, can be Basic or Advanced""" - """Required""" - self.networktype = None - """Allocation state of this Zone for allocation of new resources""" - self.allocationstate = None - """the second DNS for the Zone""" - self.dns2 = None - """Network domain name for the networks in the zone""" - self.domain = None - """the ID of the containing domain, null for public zones""" - self.domainid = None - """the guest CIDR address for the Zone""" - self.guestcidraddress = None - """the second internal DNS for the Zone""" - self.internaldns2 = None - """the first DNS for IPv6 network in the Zone""" - self.ip6dns1 = None - """the second DNS for IPv6 network in the Zone""" - self.ip6dns2 = None - """true if local storage offering enabled, false otherwise""" - self.localstorageenabled = None - """true if network is security group enabled, false otherwise""" - self.securitygroupenabled = None - self.required = ["dns1","internaldns1","name","networktype",] - -class createZoneResponse (baseResponse): - def __init__(self): - """Zone id""" - self.id = None - """the allocation state of the cluster""" - self.allocationstate = None - """Zone description""" - self.description = None - """the dhcp Provider for the Zone""" - self.dhcpprovider = None - """the display text of the zone""" - self.displaytext = None - """the first DNS for the Zone""" - self.dns1 = None - """the second DNS for the Zone""" - self.dns2 = None - """Network domain name for the networks in the zone""" - self.domain = None - """the UUID of the containing domain, null for public zones""" - self.domainid = None - """the name of the containing domain, null for public zones""" - self.domainname = None - """the guest CIDR address for the Zone""" - self.guestcidraddress = None - """the first internal DNS for the Zone""" - self.internaldns1 = None - """the second internal DNS for the Zone""" - self.internaldns2 = None - """the first IPv6 DNS for the Zone""" - self.ip6dns1 = None - """the second IPv6 DNS for the Zone""" - self.ip6dns2 = None - """true if local storage offering enabled, false otherwise""" - self.localstorageenabled = None - """Zone name""" - self.name = None - """the network type of the zone; can be Basic or Advanced""" - self.networktype = None - """true if security groups support is enabled, false otherwise""" - self.securitygroupsenabled = None - """the vlan range of the zone""" - self.vlan = None - """Zone Token""" - self.zonetoken = None - """the capacity of the Zone""" - self.capacity = [] - """the list of resource tags associated with zone.""" - self.tags = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateCluster.py deleted file mode 100644 index e52e2330e97..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateCluster.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. - - -"""Dedicate an existing cluster""" -from baseCmd import * -from baseResponse import * -class dedicateClusterCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the Cluster""" - """Required""" - self.clusterid = None - """the ID of the containing domain""" - """Required""" - self.domainid = None - """the name of the account which needs dedication. Must be used with domainId.""" - self.account = None - self.required = ["clusterid","domainid",] - -class dedicateClusterResponse (baseResponse): - def __init__(self): - """the ID of the dedicated resource""" - self.id = None - """the Account ID of the cluster""" - self.accountid = None - """the Dedication Affinity Group ID of the cluster""" - self.affinitygroupid = None - """the ID of the cluster""" - self.clusterid = None - """the name of the cluster""" - self.clustername = None - """the domain ID of the cluster""" - self.domainid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateGuestVlanRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateGuestVlanRange.py deleted file mode 100644 index 3c779a6bfea..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateGuestVlanRange.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. - - -"""Dedicates a guest vlan range to an account""" -from baseCmd import * -from baseResponse import * -class dedicateGuestVlanRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """account who will own the VLAN""" - """Required""" - self.account = None - """domain ID of the account owning a VLAN""" - """Required""" - self.domainid = None - """physical network ID of the vlan""" - """Required""" - self.physicalnetworkid = None - """guest vlan range to be dedicated""" - """Required""" - self.vlanrange = None - """project who will own the VLAN""" - self.projectid = None - self.required = ["account","domainid","physicalnetworkid","vlanrange",] - -class dedicateGuestVlanRangeResponse (baseResponse): - def __init__(self): - """the ID of the guest VLAN range""" - self.id = None - """the account of the guest VLAN range""" - self.account = None - """the domain name of the guest VLAN range""" - self.domain = None - """the domain ID of the guest VLAN range""" - self.domainid = None - """the guest VLAN range""" - self.guestvlanrange = None - """the physical network of the guest vlan range""" - self.physicalnetworkid = None - """the project name of the guest vlan range""" - self.project = None - """the project id of the guest vlan range""" - self.projectid = None - """the zone of the guest vlan range""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateHost.py deleted file mode 100644 index 122d3e2e47f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateHost.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. - - -"""Dedicates a host.""" -from baseCmd import * -from baseResponse import * -class dedicateHostCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the containing domain""" - """Required""" - self.domainid = None - """the ID of the host to update""" - """Required""" - self.hostid = None - """the name of the account which needs dedication. Must be used with domainId.""" - self.account = None - self.required = ["domainid","hostid",] - -class dedicateHostResponse (baseResponse): - def __init__(self): - """the ID of the dedicated resource""" - self.id = None - """the Account ID of the host""" - self.accountid = None - """the Dedication Affinity Group ID of the host""" - self.affinitygroupid = None - """the domain ID of the host""" - self.domainid = None - """the ID of the host""" - self.hostid = None - """the name of the host""" - self.hostname = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePod.py deleted file mode 100644 index 494d846cc8b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePod.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. - - -"""Dedicates a Pod.""" -from baseCmd import * -from baseResponse import * -class dedicatePodCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the containing domain""" - """Required""" - self.domainid = None - """the ID of the Pod""" - """Required""" - self.podid = None - """the name of the account which needs dedication. Must be used with domainId.""" - self.account = None - self.required = ["domainid","podid",] - -class dedicatePodResponse (baseResponse): - def __init__(self): - """the ID of the dedicated resource""" - self.id = None - """the Account Id to which the Pod is dedicated""" - self.accountid = None - """the Dedication Affinity Group ID of the pod""" - self.affinitygroupid = None - """the domain ID to which the Pod is dedicated""" - self.domainid = None - """the ID of the Pod""" - self.podid = None - """the Name of the Pod""" - self.podname = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePublicIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePublicIpRange.py deleted file mode 100644 index ce4f768dee9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicatePublicIpRange.py +++ /dev/null @@ -1,84 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Dedicates a Public IP range to an account""" -from baseCmd import * -from baseResponse import * -class dedicatePublicIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the id of the VLAN IP range""" - """Required""" - self.id = None - """account who will own the VLAN""" - """Required""" - self.account = None - """domain ID of the account owning a VLAN""" - """Required""" - self.domainid = None - """project who will own the VLAN""" - self.projectid = None - self.required = ["id","account","domainid",] - -class dedicatePublicIpRangeResponse (baseResponse): - def __init__(self): - """the ID of the VLAN IP range""" - self.id = None - """the account of the VLAN IP range""" - self.account = None - """the description of the VLAN IP range""" - self.description = None - """the domain name of the VLAN IP range""" - self.domain = None - """the domain ID of the VLAN IP range""" - self.domainid = None - """the end ip of the VLAN IP range""" - self.endip = None - """the end ipv6 of the VLAN IP range""" - self.endipv6 = None - """the virtual network for the VLAN IP range""" - self.forvirtualnetwork = None - """the gateway of the VLAN IP range""" - self.gateway = None - """the cidr of IPv6 network""" - self.ip6cidr = None - """the gateway of IPv6 network""" - self.ip6gateway = None - """the netmask of the VLAN IP range""" - self.netmask = None - """the network id of vlan range""" - self.networkid = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """the Pod ID for the VLAN IP range""" - self.podid = None - """the Pod name for the VLAN IP range""" - self.podname = None - """the project name of the vlan range""" - self.project = None - """the project id of the vlan range""" - self.projectid = None - """the start ip of the VLAN IP range""" - self.startip = None - """the start ipv6 of the VLAN IP range""" - self.startipv6 = None - """the ID or VID of the VLAN.""" - self.vlan = None - """the Zone ID of the VLAN IP range""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateZone.py deleted file mode 100644 index caf901eb76b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/dedicateZone.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. - - -"""Dedicates a zones.""" -from baseCmd import * -from baseResponse import * -class dedicateZoneCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the containing domain""" - """Required""" - self.domainid = None - """the ID of the zone""" - """Required""" - self.zoneid = None - """the name of the account which needs dedication. Must be used with domainId.""" - self.account = None - self.required = ["domainid","zoneid",] - -class dedicateZoneResponse (baseResponse): - def __init__(self): - """the ID of the dedicated resource""" - self.id = None - """the Account Id to which the Zone is dedicated""" - self.accountid = None - """the Dedication Affinity Group ID of the zone""" - self.affinitygroupid = None - """the domain ID to which the Zone is dedicated""" - self.domainid = None - """the ID of the Zone""" - self.zoneid = None - """the Name of the Zone""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccount.py deleted file mode 100644 index 84810c83108..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccount.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a account, and all users associated with this account""" -from baseCmd import * -from baseResponse import * -class deleteAccountCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Account id""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteAccountResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccountFromProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccountFromProject.py deleted file mode 100644 index e7e32fc88e7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAccountFromProject.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes account from the project""" -from baseCmd import * -from baseResponse import * -class deleteAccountFromProjectCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """name of the account to be removed from the project""" - """Required""" - self.account = None - """id of the project to remove the account from""" - """Required""" - self.projectid = None - self.required = ["account","projectid",] - -class deleteAccountFromProjectResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAffinityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAffinityGroup.py deleted file mode 100644 index 059dd8ad56b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAffinityGroup.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. - - -"""Deletes affinity group""" -from baseCmd import * -from baseResponse import * -class deleteAffinityGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the account of the affinity group. Must be specified with domain ID""" - self.account = None - """the domain ID of account owning the affinity group""" - self.domainid = None - """The ID of the affinity group. Mutually exclusive with name parameter""" - self.id = None - """The name of the affinity group. Mutually exclusive with id parameter""" - self.name = None - self.required = [] - -class deleteAffinityGroupResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAlerts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAlerts.py deleted file mode 100644 index 7bebd41debc..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAlerts.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. - - -"""Delete one or more alerts.""" -from baseCmd import * -from baseResponse import * -class deleteAlertsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """end date range to delete alerts (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" - self.enddate = None - """the IDs of the alerts""" - self.ids = [] - """start date range to delete alerts (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" - self.startdate = None - """delete by alert type""" - self.type = None - self.required = [] - -class deleteAlertsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScalePolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScalePolicy.py deleted file mode 100644 index 5ce5b2a6767..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScalePolicy.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a autoscale policy.""" -from baseCmd import * -from baseResponse import * -class deleteAutoScalePolicyCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the autoscale policy""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteAutoScalePolicyResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmGroup.py deleted file mode 100644 index 060d5f071d0..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmGroup.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a autoscale vm group.""" -from baseCmd import * -from baseResponse import * -class deleteAutoScaleVmGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the autoscale group""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteAutoScaleVmGroupResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmProfile.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmProfile.py deleted file mode 100644 index 9279a564ed4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteAutoScaleVmProfile.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a autoscale vm profile.""" -from baseCmd import * -from baseResponse import * -class deleteAutoScaleVmProfileCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the autoscale profile""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteAutoScaleVmProfileResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteBigSwitchVnsDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteBigSwitchVnsDevice.py deleted file mode 100644 index c3c41503fb8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteBigSwitchVnsDevice.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""delete a bigswitch vns device""" -from baseCmd import * -from baseResponse import * -class deleteBigSwitchVnsDeviceCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """BigSwitch device ID""" - """Required""" - self.vnsdeviceid = None - self.required = ["vnsdeviceid",] - -class deleteBigSwitchVnsDeviceResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCluster.py deleted file mode 100644 index 7ad27c28558..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCluster.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a cluster.""" -from baseCmd import * -from baseResponse import * -class deleteClusterCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the cluster ID""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteClusterResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCondition.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCondition.py deleted file mode 100644 index e87ec957033..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCondition.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Removes a condition""" -from baseCmd import * -from baseResponse import * -class deleteConditionCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the condition.""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteConditionResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCounter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCounter.py deleted file mode 100644 index 78c2b71b3af..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteCounter.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a counter""" -from baseCmd import * -from baseResponse import * -class deleteCounterCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the counter""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteCounterResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDiskOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDiskOffering.py deleted file mode 100644 index 535d992c358..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDiskOffering.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a disk offering.""" -from baseCmd import * -from baseResponse import * -class deleteDiskOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """ID of the disk offering""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteDiskOfferingResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDomain.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDomain.py deleted file mode 100644 index 7289850244f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteDomain.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. - - -"""Deletes a specified domain""" -from baseCmd import * -from baseResponse import * -class deleteDomainCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """ID of domain to delete""" - """Required""" - self.id = None - """true if all domain resources (child domains, accounts) have to be cleaned up, false otherwise""" - self.cleanup = None - self.required = ["id",] - -class deleteDomainResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEgressFirewallRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEgressFirewallRule.py deleted file mode 100644 index 3baecade3db..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEgressFirewallRule.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes an ggress firewall rule""" -from baseCmd import * -from baseResponse import * -class deleteEgressFirewallRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the firewall rule""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteEgressFirewallRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEvents.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEvents.py deleted file mode 100644 index 3b4cbdf46ae..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteEvents.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. - - -"""Delete one or more events.""" -from baseCmd import * -from baseResponse import * -class deleteEventsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """end date range to delete events (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" - self.enddate = None - """the IDs of the events""" - self.ids = [] - """start date range to delete events (including) this date (use format "yyyy-MM-dd" or the new format "yyyy-MM-ddThh:mm:ss")""" - self.startdate = None - """delete by event type""" - self.type = None - self.required = [] - -class deleteEventsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteFirewallRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteFirewallRule.py deleted file mode 100644 index de9344a033c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteFirewallRule.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a firewall rule""" -from baseCmd import * -from baseResponse import * -class deleteFirewallRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the firewall rule""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteFirewallRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py deleted file mode 100644 index 26ef6fe82b3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteGlobalLoadBalancerRule.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a global load balancer rule.""" -from baseCmd import * -from baseResponse import * -class deleteGlobalLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the global load balancer rule""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteGlobalLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteHost.py deleted file mode 100644 index 1ffd8de7d05..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteHost.py +++ /dev/null @@ -1,40 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a host.""" -from baseCmd import * -from baseResponse import * -class deleteHostCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the host ID""" - """Required""" - self.id = None - """Force delete the host. All HA enabled vms running on the host will be put to HA; HA disabled ones will be stopped""" - self.forced = None - """Force destroy local storage on this host. All VMs created on this local storage will be destroyed""" - self.forcedestroylocalstorage = None - self.required = ["id",] - -class deleteHostResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteImageStore.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteImageStore.py deleted file mode 100644 index 447eab35960..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteImageStore.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes an image store .""" -from baseCmd import * -from baseResponse import * -class deleteImageStoreCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the image store ID""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteImageStoreResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteInstanceGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteInstanceGroup.py deleted file mode 100644 index ccfef7fae2e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteInstanceGroup.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a vm group""" -from baseCmd import * -from baseResponse import * -class deleteInstanceGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the instance group""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteInstanceGroupResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIpForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIpForwardingRule.py deleted file mode 100644 index 3cf496fe096..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIpForwardingRule.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes an ip forwarding rule""" -from baseCmd import * -from baseResponse import * -class deleteIpForwardingRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the id of the forwarding rule""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteIpForwardingRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIso.py deleted file mode 100644 index 748b6be2956..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteIso.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. - - -"""Deletes an ISO file.""" -from baseCmd import * -from baseResponse import * -class deleteIsoCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the ISO file""" - """Required""" - self.id = None - """the ID of the zone of the ISO file. If not specified, the ISO will be deleted from all the zones""" - self.zoneid = None - self.required = ["id",] - -class deleteIsoResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBHealthCheckPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBHealthCheckPolicy.py deleted file mode 100644 index 50086168d41..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBHealthCheckPolicy.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a load balancer HealthCheck policy.""" -from baseCmd import * -from baseResponse import * -class deleteLBHealthCheckPolicyCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the load balancer HealthCheck policy""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteLBHealthCheckPolicyResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBStickinessPolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBStickinessPolicy.py deleted file mode 100644 index d90b4d8755d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLBStickinessPolicy.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a LB stickiness policy.""" -from baseCmd import * -from baseResponse import * -class deleteLBStickinessPolicyCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the LB stickiness policy""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteLBStickinessPolicyResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLdapConfiguration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLdapConfiguration.py deleted file mode 100644 index 3ac530dfa26..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLdapConfiguration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Remove an Ldap Configuration""" -from baseCmd import * -from baseResponse import * -class deleteLdapConfigurationCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Hostname""" - """Required""" - self.hostname = None - self.required = ["hostname",] - -class deleteLdapConfigurationResponse (baseResponse): - def __init__(self): - """hostname""" - self.hostname = None - """port""" - self.port = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancer.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancer.py deleted file mode 100644 index 753c370735f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancer.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a load balancer""" -from baseCmd import * -from baseResponse import * -class deleteLoadBalancerCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the Load Balancer""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteLoadBalancerResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancerRule.py deleted file mode 100644 index 660825018e1..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteLoadBalancerRule.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a load balancer rule.""" -from baseCmd import * -from baseResponse import * -class deleteLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the load balancer rule""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetwork.py deleted file mode 100644 index adbb792ba40..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetwork.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a network""" -from baseCmd import * -from baseResponse import * -class deleteNetworkCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the network""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteNetworkResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACL.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACL.py deleted file mode 100644 index cf2288d087a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACL.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a Network ACL""" -from baseCmd import * -from baseResponse import * -class deleteNetworkACLCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the network ACL""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteNetworkACLResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACLList.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACLList.py deleted file mode 100644 index e9b854bb270..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkACLList.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a Network ACL""" -from baseCmd import * -from baseResponse import * -class deleteNetworkACLListCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the network ACL""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteNetworkACLListResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkDevice.py deleted file mode 100644 index 11014f42132..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkDevice.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes network device.""" -from baseCmd import * -from baseResponse import * -class deleteNetworkDeviceCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Id of network device to delete""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteNetworkDeviceResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkOffering.py deleted file mode 100644 index 76747211993..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkOffering.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a network offering.""" -from baseCmd import * -from baseResponse import * -class deleteNetworkOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the network offering""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteNetworkOfferingResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkServiceProvider.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkServiceProvider.py deleted file mode 100644 index 0bdc3e4211f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNetworkServiceProvider.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a Network Service Provider.""" -from baseCmd import * -from baseResponse import * -class deleteNetworkServiceProviderCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the network service provider""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteNetworkServiceProviderResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNiciraNvpDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNiciraNvpDevice.py deleted file mode 100644 index 067ea8ba6a5..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteNiciraNvpDevice.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""delete a nicira nvp device""" -from baseCmd import * -from baseResponse import * -class deleteNiciraNvpDeviceCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Nicira device ID""" - """Required""" - self.nvpdeviceid = None - self.required = ["nvpdeviceid",] - -class deleteNiciraNvpDeviceResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePhysicalNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePhysicalNetwork.py deleted file mode 100644 index 36381302fc7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePhysicalNetwork.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a Physical Network.""" -from baseCmd import * -from baseResponse import * -class deletePhysicalNetworkCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the Physical network""" - """Required""" - self.id = None - self.required = ["id",] - -class deletePhysicalNetworkResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePod.py deleted file mode 100644 index 73e636ee5e3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePod.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a Pod.""" -from baseCmd import * -from baseResponse import * -class deletePodCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the Pod""" - """Required""" - self.id = None - self.required = ["id",] - -class deletePodResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortForwardingRule.py deleted file mode 100644 index 4669d0e0ef8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortForwardingRule.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a port forwarding rule""" -from baseCmd import * -from baseResponse import * -class deletePortForwardingRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the port forwarding rule""" - """Required""" - self.id = None - self.required = ["id",] - -class deletePortForwardingRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortableIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortableIpRange.py deleted file mode 100644 index 9fe23468999..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePortableIpRange.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""deletes a range of portable public IP's associated with a region""" -from baseCmd import * -from baseResponse import * -class deletePortableIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Id of the portable ip range""" - """Required""" - self.id = None - self.required = ["id",] - -class deletePortableIpRangeResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePrivateGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deletePrivateGateway.py deleted file mode 100644 index 8f30a0f3360..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deletePrivateGateway.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a Private gateway""" -from baseCmd import * -from baseResponse import * -class deletePrivateGatewayCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the private gateway""" - """Required""" - self.id = None - self.required = ["id",] - -class deletePrivateGatewayResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProject.py deleted file mode 100644 index e0f6e69bb3e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProject.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a project""" -from baseCmd import * -from baseResponse import * -class deleteProjectCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of the project to be deleted""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteProjectResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProjectInvitation.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProjectInvitation.py deleted file mode 100644 index beef9b87991..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteProjectInvitation.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Accepts or declines project invitation""" -from baseCmd import * -from baseResponse import * -class deleteProjectInvitationCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of the invitation""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteProjectInvitationResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteRemoteAccessVpn.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteRemoteAccessVpn.py deleted file mode 100644 index 2188299c018..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteRemoteAccessVpn.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Destroys a l2tp/ipsec remote access vpn""" -from baseCmd import * -from baseResponse import * -class deleteRemoteAccessVpnCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """public ip address id of the vpn server""" - """Required""" - self.publicipid = None - self.required = ["publicipid",] - -class deleteRemoteAccessVpnResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSSHKeyPair.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSSHKeyPair.py deleted file mode 100644 index 6236cf55693..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSSHKeyPair.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. - - -"""Deletes a keypair by name""" -from baseCmd import * -from baseResponse import * -class deleteSSHKeyPairCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Name of the keypair""" - """Required""" - self.name = None - """the account associated with the keypair. Must be used with the domainId parameter.""" - self.account = None - """the domain ID associated with the keypair""" - self.domainid = None - """the project associated with keypair""" - self.projectid = None - self.required = ["name",] - -class deleteSSHKeyPairResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecondaryStagingStore.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecondaryStagingStore.py deleted file mode 100644 index 79363bce141..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecondaryStagingStore.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a secondary staging store .""" -from baseCmd import * -from baseResponse import * -class deleteSecondaryStagingStoreCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the staging store ID""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteSecondaryStagingStoreResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecurityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecurityGroup.py deleted file mode 100644 index 3278396f171..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSecurityGroup.py +++ /dev/null @@ -1,43 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes security group""" -from baseCmd import * -from baseResponse import * -class deleteSecurityGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the account of the security group. Must be specified with domain ID""" - self.account = None - """the domain ID of account owning the security group""" - self.domainid = None - """The ID of the security group. Mutually exclusive with name parameter""" - self.id = None - """The ID of the security group. Mutually exclusive with id parameter""" - self.name = None - """the project of the security group""" - self.projectid = None - self.required = [] - -class deleteSecurityGroupResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteServiceOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteServiceOffering.py deleted file mode 100644 index 44e3df6264e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteServiceOffering.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a service offering.""" -from baseCmd import * -from baseResponse import * -class deleteServiceOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the service offering""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteServiceOfferingResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshot.py deleted file mode 100644 index f98b15cd859..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshot.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a snapshot of a disk volume.""" -from baseCmd import * -from baseResponse import * -class deleteSnapshotCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the snapshot""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteSnapshotResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshotPolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshotPolicies.py deleted file mode 100644 index 1ed481d6f9e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteSnapshotPolicies.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. - - -"""Deletes snapshot policies for the account.""" -from baseCmd import * -from baseResponse import * -class deleteSnapshotPoliciesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the Id of the snapshot policy""" - self.id = None - """list of snapshots policy IDs separated by comma""" - self.ids = [] - self.required = [] - -class deleteSnapshotPoliciesResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStaticRoute.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStaticRoute.py deleted file mode 100644 index 030f3e60fd7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStaticRoute.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a static route""" -from baseCmd import * -from baseResponse import * -class deleteStaticRouteCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the static route""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteStaticRouteResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStorageNetworkIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStorageNetworkIpRange.py deleted file mode 100644 index ad61954557f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStorageNetworkIpRange.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a storage network IP Range.""" -from baseCmd import * -from baseResponse import * -class deleteStorageNetworkIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the uuid of the storage network ip range""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteStorageNetworkIpRangeResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStoragePool.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStoragePool.py deleted file mode 100644 index 6ea4ee3a7c4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteStoragePool.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. - - -"""Deletes a storage pool.""" -from baseCmd import * -from baseResponse import * -class deleteStoragePoolCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Storage pool id""" - """Required""" - self.id = None - """Force destroy storage pool (force expunge volumes in Destroyed state as a part of pool removal)""" - self.forced = None - self.required = ["id",] - -class deleteStoragePoolResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTags.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTags.py deleted file mode 100644 index 7891ff66690..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTags.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. - - -"""Deleting resource tag(s)""" -from baseCmd import * -from baseResponse import * -class deleteTagsCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Delete tags for resource id(s)""" - """Required""" - self.resourceids = [] - """Delete tag by resource type""" - """Required""" - self.resourcetype = None - """Delete tags matching key/value pairs""" - self.tags = [] - self.required = ["resourceids","resourcetype",] - -class deleteTagsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTemplate.py deleted file mode 100644 index 83eb45f8a29..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTemplate.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. - - -"""Deletes a template from the system. All virtual machines using the deleted template will not be affected.""" -from baseCmd import * -from baseResponse import * -class deleteTemplateCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the template""" - """Required""" - self.id = None - """the ID of zone of the template""" - self.zoneid = None - self.required = ["id",] - -class deleteTemplateResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficMonitor.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficMonitor.py deleted file mode 100644 index c03a2f3b475..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficMonitor.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes an traffic monitor host.""" -from baseCmd import * -from baseResponse import * -class deleteTrafficMonitorCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Id of the Traffic Monitor Host.""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteTrafficMonitorResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficType.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficType.py deleted file mode 100644 index 6cf0f47015d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteTrafficType.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes traffic type of a physical network""" -from baseCmd import * -from baseResponse import * -class deleteTrafficTypeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """traffic type id""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteTrafficTypeResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteUser.py deleted file mode 100644 index 2d9790974c8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteUser.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a user for an account""" -from baseCmd import * -from baseResponse import * -class deleteUserCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """id of the user to be deleted""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteUserResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVMSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVMSnapshot.py deleted file mode 100644 index 91dfab62928..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVMSnapshot.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a vmsnapshot.""" -from baseCmd import * -from baseResponse import * -class deleteVMSnapshotCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the VM snapshot""" - """Required""" - self.vmsnapshotid = None - self.required = ["vmsnapshotid",] - -class deleteVMSnapshotResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPC.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPC.py deleted file mode 100644 index 073e03867c3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPC.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a VPC""" -from baseCmd import * -from baseResponse import * -class deleteVPCCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the VPC""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteVPCResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPCOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPCOffering.py deleted file mode 100644 index 0e222f1797f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVPCOffering.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes VPC offering""" -from baseCmd import * -from baseResponse import * -class deleteVPCOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the VPC offering""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteVPCOfferingResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVlanIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVlanIpRange.py deleted file mode 100644 index 94f54d17fa1..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVlanIpRange.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates a VLAN IP range.""" -from baseCmd import * -from baseResponse import * -class deleteVlanIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the id of the VLAN IP range""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteVlanIpRangeResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVolume.py deleted file mode 100644 index ad0cd628ff2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVolume.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a detached disk volume.""" -from baseCmd import * -from baseResponse import * -class deleteVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """The ID of the disk volume""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteVolumeResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnConnection.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnConnection.py deleted file mode 100644 index b1349802459..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnConnection.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Delete site to site vpn connection""" -from baseCmd import * -from baseResponse import * -class deleteVpnConnectionCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of vpn connection""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteVpnConnectionResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnCustomerGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnCustomerGateway.py deleted file mode 100644 index 559282e45be..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnCustomerGateway.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Delete site to site vpn customer gateway""" -from baseCmd import * -from baseResponse import * -class deleteVpnCustomerGatewayCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of customer gateway""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteVpnCustomerGatewayResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnGateway.py deleted file mode 100644 index 06de8a32339..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteVpnGateway.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Delete site to site vpn gateway""" -from baseCmd import * -from baseResponse import * -class deleteVpnGatewayCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of customer gateway""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteVpnGatewayResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deleteZone.py deleted file mode 100644 index 32818b1bcb6..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deleteZone.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a Zone.""" -from baseCmd import * -from baseResponse import * -class deleteZoneCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the Zone""" - """Required""" - self.id = None - self.required = ["id",] - -class deleteZoneResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/deployVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/deployVirtualMachine.py deleted file mode 100644 index ba45f1da2d3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/deployVirtualMachine.py +++ /dev/null @@ -1,421 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.""" -from baseCmd import * -from baseResponse import * -class deployVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the service offering for the virtual machine""" - """Required""" - self.serviceofferingid = None - """the ID of the template for the virtual machine""" - """Required""" - self.templateid = None - """availability zone for the virtual machine""" - """Required""" - self.zoneid = None - """an optional account for the virtual machine. Must be used with domainId.""" - self.account = None - """comma separated list of affinity groups id that are going to be applied to the virtual machine. Mutually exclusive with affinitygroupnames parameter""" - self.affinitygroupids = [] - """comma separated list of affinity groups names that are going to be applied to the virtual machine.Mutually exclusive with affinitygroupids parameter""" - self.affinitygroupnames = [] - """the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskOfferingId is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateId parameter passed is from a Template object, the diskOfferingId refers to a DATA Disk Volume created. If the templateId parameter passed is from an ISO object, the diskOfferingId refers to a ROOT Disk Volume created.""" - self.diskofferingid = None - """an optional user generated name for the virtual machine""" - self.displayname = None - """an optional field, whether to the display the vm to the end user or not.""" - self.displayvm = None - """an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """an optional group for the virtual machine""" - self.group = None - """destination Host ID to deploy the VM to - parameter available for root admin only""" - self.hostid = None - """the hypervisor on which to deploy the virtual machine""" - self.hypervisor = None - """the ipv6 address for default vm's network""" - self.ip6address = None - """the ip address for default vm's network""" - self.ipaddress = None - """ip to network mapping. Can't be specified with networkIds parameter. Example: iptonetworklist[0].ip=10.10.10.11&iptonetworklist[0].ipv6=fc00:1234:5678::abcd&iptonetworklist[0].networkid=uuid - requests to use ip 10.10.10.11 in network id=uuid""" - self.iptonetworklist = [] - """an optional keyboard device type for the virtual machine. valid value can be one of de,de-ch,es,fi,fr,fr-be,fr-ch,is,it,jp,nl-be,no,pt,uk,us""" - self.keyboard = None - """name of the ssh key pair used to login to the virtual machine""" - self.keypair = None - """host name for the virtual machine""" - self.name = None - """list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter""" - self.networkids = [] - """Deploy vm for the project""" - self.projectid = None - """comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter""" - self.securitygroupids = [] - """comma separated list of security groups names that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupids parameter""" - self.securitygroupnames = [] - """the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId""" - self.size = None - """true if network offering supports specifying ip ranges; defaulted to true if not specified""" - self.startvm = None - """an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding. Using HTTP POST(via POST body), you can send up to 32K of data after base64 encoding.""" - self.userdata = None - self.required = ["serviceofferingid","templateid","zoneid",] - -class deployVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/destroyRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/destroyRouter.py deleted file mode 100644 index 4e63dba7a84..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/destroyRouter.py +++ /dev/null @@ -1,151 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Destroys a router.""" -from baseCmd import * -from baseResponse import * -class destroyRouterCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the router""" - """Required""" - self.id = None - self.required = ["id",] - -class destroyRouterResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/destroySystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/destroySystemVm.py deleted file mode 100644 index c7c20784436..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/destroySystemVm.py +++ /dev/null @@ -1,86 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Destroyes a system virtual machine.""" -from baseCmd import * -from baseResponse import * -class destroySystemVmCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the system virtual machine""" - """Required""" - self.id = None - self.required = ["id",] - -class destroySystemVmResponse (baseResponse): - def __init__(self): - """the ID of the system VM""" - self.id = None - """the number of active console sessions for the console proxy system vm""" - self.activeviewersessions = None - """the date and time the system VM was created""" - self.created = None - """the first DNS for the system VM""" - self.dns1 = None - """the second DNS for the system VM""" - self.dns2 = None - """the gateway for the system VM""" - self.gateway = None - """the host ID for the system VM""" - self.hostid = None - """the hostname for the system VM""" - self.hostname = None - """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobid = None - """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobstatus = None - """the link local IP address for the system vm""" - self.linklocalip = None - """the link local MAC address for the system vm""" - self.linklocalmacaddress = None - """the link local netmask for the system vm""" - self.linklocalnetmask = None - """the name of the system VM""" - self.name = None - """the network domain for the system VM""" - self.networkdomain = None - """the Pod ID for the system VM""" - self.podid = None - """the private IP address for the system VM""" - self.privateip = None - """the private MAC address for the system VM""" - self.privatemacaddress = None - """the private netmask for the system VM""" - self.privatenetmask = None - """the public IP address for the system VM""" - self.publicip = None - """the public MAC address for the system VM""" - self.publicmacaddress = None - """the public netmask for the system VM""" - self.publicnetmask = None - """the state of the system VM""" - self.state = None - """the system VM type""" - self.systemvmtype = None - """the template ID for the system VM""" - self.templateid = None - """the Zone ID for the system VM""" - self.zoneid = None - """the Zone name for the system VM""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/destroyVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/destroyVirtualMachine.py deleted file mode 100644 index 6a33ce0df0d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/destroyVirtualMachine.py +++ /dev/null @@ -1,369 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Destroys a virtual machine. Once destroyed, only the administrator can recover it.""" -from baseCmd import * -from baseResponse import * -class destroyVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.id = None - self.required = ["id",] - -class destroyVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/detachIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/detachIso.py deleted file mode 100644 index d445d51f5e2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/detachIso.py +++ /dev/null @@ -1,369 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Detaches any ISO file (if any) currently attached to a virtual machine.""" -from baseCmd import * -from baseResponse import * -class detachIsoCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.virtualmachineid = None - self.required = ["virtualmachineid",] - -class detachIsoResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/detachVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/detachVolume.py deleted file mode 100644 index 31e1c9a5c75..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/detachVolume.py +++ /dev/null @@ -1,146 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Detaches a disk volume from a virtual machine.""" -from baseCmd import * -from baseResponse import * -class detachVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the device ID on the virtual machine where volume is detached from""" - self.deviceid = None - """the ID of the disk volume""" - self.id = None - """the ID of the virtual machine where the volume is detached from""" - self.virtualmachineid = None - self.required = [] - -class detachVolumeResponse (baseResponse): - def __init__(self): - """ID of the disk volume""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the date the volume was attached to a VM instance""" - self.attached = None - """the date the disk volume was created""" - self.created = None - """the boolean state of whether the volume is destroyed or not""" - self.destroyed = None - """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" - self.deviceid = None - """bytes read rate of the disk volume""" - self.diskBytesReadRate = None - """bytes write rate of the disk volume""" - self.diskBytesWriteRate = None - """io requests read rate of the disk volume""" - self.diskIopsReadRate = None - """io requests write rate of the disk volume""" - self.diskIopsWriteRate = None - """the display text of the disk offering""" - self.diskofferingdisplaytext = None - """ID of the disk offering""" - self.diskofferingid = None - """name of the disk offering""" - self.diskofferingname = None - """an optional field whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """Hypervisor the volume belongs to""" - self.hypervisor = None - """true if the volume is extractable, false otherwise""" - self.isextractable = None - """max iops of the disk volume""" - self.maxiops = None - """min iops of the disk volume""" - self.miniops = None - """name of the disk volume""" - self.name = None - """The path of the volume""" - self.path = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the display text of the service offering for root disk""" - self.serviceofferingdisplaytext = None - """ID of the service offering for root disk""" - self.serviceofferingid = None - """name of the service offering for root disk""" - self.serviceofferingname = None - """size of the disk volume""" - self.size = None - """ID of the snapshot from which this volume was created""" - self.snapshotid = None - """the state of the disk volume""" - self.state = None - """the status of the volume""" - self.status = None - """name of the primary storage hosting the disk volume""" - self.storage = None - """id of the primary storage hosting the disk volume; returned to admin user only""" - self.storageid = None - """shared or local storage""" - self.storagetype = None - """type of the disk volume (ROOT or DATADISK)""" - self.type = None - """id of the virtual machine""" - self.virtualmachineid = None - """display name of the virtual machine""" - self.vmdisplayname = None - """name of the virtual machine""" - self.vmname = None - """state of the virtual machine""" - self.vmstate = None - """ID of the availability zone""" - self.zoneid = None - """name of the availability zone""" - self.zonename = None - """the list of resource tags associated with volume""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disableAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disableAccount.py deleted file mode 100644 index b8d513adcd7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/disableAccount.py +++ /dev/null @@ -1,179 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Disables an account""" -from baseCmd import * -from baseResponse import * -class disableAccountCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """If true, only lock the account; else disable the account""" - """Required""" - self.lock = None - """Disables specified account.""" - self.account = None - """Disables specified account in this domain.""" - self.domainid = None - """Account id""" - self.id = None - self.required = ["lock",] - -class disableAccountResponse (baseResponse): - def __init__(self): - """the id of the account""" - self.id = None - """details for the account""" - self.accountdetails = None - """account type (admin, domain-admin, user)""" - self.accounttype = None - """the total number of cpu cores available to be created for this account""" - self.cpuavailable = None - """the total number of cpu cores the account can own""" - self.cpulimit = None - """the total number of cpu cores owned by account""" - self.cputotal = None - """the default zone of the account""" - self.defaultzoneid = None - """name of the Domain the account belongs too""" - self.domain = None - """id of the Domain the account belongs too""" - self.domainid = None - """the total number of public ip addresses available for this account to acquire""" - self.ipavailable = None - """the total number of public ip addresses this account can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this account""" - self.iptotal = None - """true if the account requires cleanup""" - self.iscleanuprequired = None - """true if account is default, false otherwise""" - self.isdefault = None - """the total memory (in MB) available to be created for this account""" - self.memoryavailable = None - """the total memory (in MB) the account can own""" - self.memorylimit = None - """the total memory (in MB) owned by account""" - self.memorytotal = None - """the name of the account""" - self.name = None - """the total number of networks available to be created for this account""" - self.networkavailable = None - """the network domain""" - self.networkdomain = None - """the total number of networks the account can own""" - self.networklimit = None - """the total number of networks owned by account""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this account""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the account can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by account""" - self.primarystoragetotal = None - """the total number of projects available for administration by this account""" - self.projectavailable = None - """the total number of projects the account can own""" - self.projectlimit = None - """the total number of projects being administrated by this account""" - self.projecttotal = None - """the total number of network traffic bytes received""" - self.receivedbytes = None - """the total secondary storage space (in GiB) available to be used for this account""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the account can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by account""" - self.secondarystoragetotal = None - """the total number of network traffic bytes sent""" - self.sentbytes = None - """the total number of snapshots available for this account""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this account""" - self.snapshotlimit = None - """the total number of snapshots stored by this account""" - self.snapshottotal = None - """the state of the account""" - self.state = None - """the total number of templates available to be created by this account""" - self.templateavailable = None - """the total number of templates which can be created by this account""" - self.templatelimit = None - """the total number of templates which have been created by this account""" - self.templatetotal = None - """the total number of virtual machines available for this account to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this account""" - self.vmlimit = None - """the total number of virtual machines running for this account""" - self.vmrunning = None - """the total number of virtual machines stopped for this account""" - self.vmstopped = None - """the total number of virtual machines deployed by this account""" - self.vmtotal = None - """the total volume available for this account""" - self.volumeavailable = None - """the total volume which can be used by this account""" - self.volumelimit = None - """the total volume being used by this account""" - self.volumetotal = None - """the total number of vpcs available to be created for this account""" - self.vpcavailable = None - """the total number of vpcs the account can own""" - self.vpclimit = None - """the total number of vpcs owned by account""" - self.vpctotal = None - """the list of users associated with account""" - self.user = [] - -class user: - def __init__(self): - """"the user ID""" - self.id = None - """"the account name of the user""" - self.account = None - """"the account ID of the user""" - self.accountid = None - """"the account type of the user""" - self.accounttype = None - """"the api key of the user""" - self.apikey = None - """"the date and time the user account was created""" - self.created = None - """"the domain name of the user""" - self.domain = None - """"the domain ID of the user""" - self.domainid = None - """"the user email address""" - self.email = None - """"the user firstname""" - self.firstname = None - """"the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """"true if user is default, false otherwise""" - self.isdefault = None - """"the user lastname""" - self.lastname = None - """"the secret key of the user""" - self.secretkey = None - """"the user state""" - self.state = None - """"the timezone user was created in""" - self.timezone = None - """"the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disableAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disableAutoScaleVmGroup.py deleted file mode 100644 index 5b455a36ada..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/disableAutoScaleVmGroup.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. - - -"""Disables an AutoScale Vm Group""" -from baseCmd import * -from baseResponse import * -class disableAutoScaleVmGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the autoscale group""" - """Required""" - self.id = None - self.required = ["id",] - -class disableAutoScaleVmGroupResponse (baseResponse): - def __init__(self): - """the autoscale vm group ID""" - self.id = None - """the account owning the instance group""" - self.account = None - """the domain name of the vm profile""" - self.domain = None - """the domain ID of the vm profile""" - self.domainid = None - """the frequency at which the conditions have to be evaluated""" - self.interval = None - """the load balancer rule ID""" - self.lbruleid = None - """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" - self.maxmembers = None - """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" - self.minmembers = None - """the project name of the vm profile""" - self.project = None - """the project id vm profile""" - self.projectid = None - """list of scaledown autoscale policies""" - self.scaledownpolicies = None - """list of scaleup autoscale policies""" - self.scaleuppolicies = None - """the current state of the AutoScale Vm Group""" - self.state = None - """the autoscale profile that contains information about the vms in the vm group.""" - self.vmprofileid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disableStaticNat.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disableStaticNat.py deleted file mode 100644 index 611dc3f195e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/disableStaticNat.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Disables static rule for given ip address""" -from baseCmd import * -from baseResponse import * -class disableStaticNatCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the public IP address id for which static nat feature is being disableed""" - """Required""" - self.ipaddressid = None - self.required = ["ipaddressid",] - -class disableStaticNatResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disableUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disableUser.py deleted file mode 100644 index 4d217607516..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/disableUser.py +++ /dev/null @@ -1,66 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Disables a user account""" -from baseCmd import * -from baseResponse import * -class disableUserCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Disables user by user ID.""" - """Required""" - self.id = None - self.required = ["id",] - -class disableUserResponse (baseResponse): - def __init__(self): - """the user ID""" - self.id = None - """the account name of the user""" - self.account = None - """the account ID of the user""" - self.accountid = None - """the account type of the user""" - self.accounttype = None - """the api key of the user""" - self.apikey = None - """the date and time the user account was created""" - self.created = None - """the domain name of the user""" - self.domain = None - """the domain ID of the user""" - self.domainid = None - """the user email address""" - self.email = None - """the user firstname""" - self.firstname = None - """the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """true if user is default, false otherwise""" - self.isdefault = None - """the user lastname""" - self.lastname = None - """the secret key of the user""" - self.secretkey = None - """the user state""" - self.state = None - """the timezone user was created in""" - self.timezone = None - """the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/disassociateIpAddress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/disassociateIpAddress.py deleted file mode 100644 index 099401a8815..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/disassociateIpAddress.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Disassociates an ip address from the account.""" -from baseCmd import * -from baseResponse import * -class disassociateIpAddressCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the id of the public ip address to disassociate""" - """Required""" - self.id = None - self.required = ["id",] - -class disassociateIpAddressResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableAccount.py deleted file mode 100644 index b9099d6fe8e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/enableAccount.py +++ /dev/null @@ -1,176 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Enables an account""" -from baseCmd import * -from baseResponse import * -class enableAccountCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Enables specified account.""" - self.account = None - """Enables specified account in this domain.""" - self.domainid = None - """Account id""" - self.id = None - self.required = [] - -class enableAccountResponse (baseResponse): - def __init__(self): - """the id of the account""" - self.id = None - """details for the account""" - self.accountdetails = None - """account type (admin, domain-admin, user)""" - self.accounttype = None - """the total number of cpu cores available to be created for this account""" - self.cpuavailable = None - """the total number of cpu cores the account can own""" - self.cpulimit = None - """the total number of cpu cores owned by account""" - self.cputotal = None - """the default zone of the account""" - self.defaultzoneid = None - """name of the Domain the account belongs too""" - self.domain = None - """id of the Domain the account belongs too""" - self.domainid = None - """the total number of public ip addresses available for this account to acquire""" - self.ipavailable = None - """the total number of public ip addresses this account can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this account""" - self.iptotal = None - """true if the account requires cleanup""" - self.iscleanuprequired = None - """true if account is default, false otherwise""" - self.isdefault = None - """the total memory (in MB) available to be created for this account""" - self.memoryavailable = None - """the total memory (in MB) the account can own""" - self.memorylimit = None - """the total memory (in MB) owned by account""" - self.memorytotal = None - """the name of the account""" - self.name = None - """the total number of networks available to be created for this account""" - self.networkavailable = None - """the network domain""" - self.networkdomain = None - """the total number of networks the account can own""" - self.networklimit = None - """the total number of networks owned by account""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this account""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the account can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by account""" - self.primarystoragetotal = None - """the total number of projects available for administration by this account""" - self.projectavailable = None - """the total number of projects the account can own""" - self.projectlimit = None - """the total number of projects being administrated by this account""" - self.projecttotal = None - """the total number of network traffic bytes received""" - self.receivedbytes = None - """the total secondary storage space (in GiB) available to be used for this account""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the account can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by account""" - self.secondarystoragetotal = None - """the total number of network traffic bytes sent""" - self.sentbytes = None - """the total number of snapshots available for this account""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this account""" - self.snapshotlimit = None - """the total number of snapshots stored by this account""" - self.snapshottotal = None - """the state of the account""" - self.state = None - """the total number of templates available to be created by this account""" - self.templateavailable = None - """the total number of templates which can be created by this account""" - self.templatelimit = None - """the total number of templates which have been created by this account""" - self.templatetotal = None - """the total number of virtual machines available for this account to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this account""" - self.vmlimit = None - """the total number of virtual machines running for this account""" - self.vmrunning = None - """the total number of virtual machines stopped for this account""" - self.vmstopped = None - """the total number of virtual machines deployed by this account""" - self.vmtotal = None - """the total volume available for this account""" - self.volumeavailable = None - """the total volume which can be used by this account""" - self.volumelimit = None - """the total volume being used by this account""" - self.volumetotal = None - """the total number of vpcs available to be created for this account""" - self.vpcavailable = None - """the total number of vpcs the account can own""" - self.vpclimit = None - """the total number of vpcs owned by account""" - self.vpctotal = None - """the list of users associated with account""" - self.user = [] - -class user: - def __init__(self): - """"the user ID""" - self.id = None - """"the account name of the user""" - self.account = None - """"the account ID of the user""" - self.accountid = None - """"the account type of the user""" - self.accounttype = None - """"the api key of the user""" - self.apikey = None - """"the date and time the user account was created""" - self.created = None - """"the domain name of the user""" - self.domain = None - """"the domain ID of the user""" - self.domainid = None - """"the user email address""" - self.email = None - """"the user firstname""" - self.firstname = None - """"the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """"true if user is default, false otherwise""" - self.isdefault = None - """"the user lastname""" - self.lastname = None - """"the secret key of the user""" - self.secretkey = None - """"the user state""" - self.state = None - """"the timezone user was created in""" - self.timezone = None - """"the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableAutoScaleVmGroup.py deleted file mode 100644 index cb4e6bda2f0..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/enableAutoScaleVmGroup.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. - - -"""Enables an AutoScale Vm Group""" -from baseCmd import * -from baseResponse import * -class enableAutoScaleVmGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the autoscale group""" - """Required""" - self.id = None - self.required = ["id",] - -class enableAutoScaleVmGroupResponse (baseResponse): - def __init__(self): - """the autoscale vm group ID""" - self.id = None - """the account owning the instance group""" - self.account = None - """the domain name of the vm profile""" - self.domain = None - """the domain ID of the vm profile""" - self.domainid = None - """the frequency at which the conditions have to be evaluated""" - self.interval = None - """the load balancer rule ID""" - self.lbruleid = None - """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" - self.maxmembers = None - """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" - self.minmembers = None - """the project name of the vm profile""" - self.project = None - """the project id vm profile""" - self.projectid = None - """list of scaledown autoscale policies""" - self.scaledownpolicies = None - """list of scaleup autoscale policies""" - self.scaleuppolicies = None - """the current state of the AutoScale Vm Group""" - self.state = None - """the autoscale profile that contains information about the vms in the vm group.""" - self.vmprofileid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableStaticNat.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableStaticNat.py deleted file mode 100644 index be859fca691..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/enableStaticNat.py +++ /dev/null @@ -1,43 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Enables static nat for given ip address""" -from baseCmd import * -from baseResponse import * -class enableStaticNatCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the public IP address id for which static nat feature is being enabled""" - """Required""" - self.ipaddressid = None - """the ID of the virtual machine for enabling static nat feature""" - """Required""" - self.virtualmachineid = None - """The network of the vm the static nat will be enabled for. Required when public Ip address is not associated with any Guest network yet (VPC case)""" - self.networkid = None - """VM guest nic Secondary ip address for the port forwarding rule""" - self.vmguestip = None - self.required = ["ipaddressid","virtualmachineid",] - -class enableStaticNatResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableStorageMaintenance.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableStorageMaintenance.py deleted file mode 100644 index 6eba6d9310f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/enableStorageMaintenance.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. - - -"""Puts storage pool into maintenance state""" -from baseCmd import * -from baseResponse import * -class enableStorageMaintenanceCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Primary storage ID""" - """Required""" - self.id = None - self.required = ["id",] - -class enableStorageMaintenanceResponse (baseResponse): - def __init__(self): - """the ID of the storage pool""" - self.id = None - """IOPS CloudStack can provision from this storage pool""" - self.capacityiops = None - """the ID of the cluster for the storage pool""" - self.clusterid = None - """the name of the cluster for the storage pool""" - self.clustername = None - """the date and time the storage pool was created""" - self.created = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the storage pool""" - self.disksizetotal = None - """the host's currently used disk size""" - self.disksizeused = None - """the hypervisor type of the storage pool""" - self.hypervisor = None - """the IP address of the storage pool""" - self.ipaddress = None - """the name of the storage pool""" - self.name = None - """the storage pool path""" - self.path = None - """the Pod ID of the storage pool""" - self.podid = None - """the Pod name of the storage pool""" - self.podname = None - """the scope of the storage pool""" - self.scope = None - """the state of the storage pool""" - self.state = None - """true if this pool is suitable to migrate a volume, false otherwise""" - self.suitableformigration = None - """the tags for the storage pool""" - self.tags = None - """the storage pool type""" - self.type = None - """the Zone ID of the storage pool""" - self.zoneid = None - """the Zone name of the storage pool""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/enableUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/enableUser.py deleted file mode 100644 index 7aaa5036444..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/enableUser.py +++ /dev/null @@ -1,66 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Enables a user account""" -from baseCmd import * -from baseResponse import * -class enableUserCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Enables user by user ID.""" - """Required""" - self.id = None - self.required = ["id",] - -class enableUserResponse (baseResponse): - def __init__(self): - """the user ID""" - self.id = None - """the account name of the user""" - self.account = None - """the account ID of the user""" - self.accountid = None - """the account type of the user""" - self.accounttype = None - """the api key of the user""" - self.apikey = None - """the date and time the user account was created""" - self.created = None - """the domain name of the user""" - self.domain = None - """the domain ID of the user""" - self.domainid = None - """the user email address""" - self.email = None - """the user firstname""" - self.firstname = None - """the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """true if user is default, false otherwise""" - self.isdefault = None - """the user lastname""" - self.lastname = None - """the secret key of the user""" - self.secretkey = None - """the user state""" - self.state = None - """the timezone user was created in""" - self.timezone = None - """the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/extractIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/extractIso.py deleted file mode 100644 index 56f9665e8f2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/extractIso.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. - - -"""Extracts an ISO""" -from baseCmd import * -from baseResponse import * -class extractIsoCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the ISO file""" - """Required""" - self.id = None - """the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD""" - """Required""" - self.mode = None - """the url to which the ISO would be extracted""" - self.url = None - """the ID of the zone where the ISO is originally located""" - self.zoneid = None - self.required = ["id","mode",] - -class extractIsoResponse (baseResponse): - def __init__(self): - """the id of extracted object""" - self.id = None - """the account id to which the extracted object belongs""" - self.accountid = None - """the time and date the object was created""" - self.created = None - """the upload id of extracted object""" - self.extractId = None - """the mode of extraction - upload or download""" - self.extractMode = None - """the name of the extracted object""" - self.name = None - """the state of the extracted object""" - self.state = None - """the status of the extraction""" - self.status = None - """type of the storage""" - self.storagetype = None - """the percentage of the entity uploaded to the specified location""" - self.uploadpercentage = None - """if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded""" - self.url = None - """zone ID the object was extracted from""" - self.zoneid = None - """zone name the object was extracted from""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/extractTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/extractTemplate.py deleted file mode 100644 index f27c09ead9f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/extractTemplate.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. - - -"""Extracts a template""" -from baseCmd import * -from baseResponse import * -class extractTemplateCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the template""" - """Required""" - self.id = None - """the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD""" - """Required""" - self.mode = None - """the url to which the ISO would be extracted""" - self.url = None - """the ID of the zone where the ISO is originally located""" - self.zoneid = None - self.required = ["id","mode",] - -class extractTemplateResponse (baseResponse): - def __init__(self): - """the id of extracted object""" - self.id = None - """the account id to which the extracted object belongs""" - self.accountid = None - """the time and date the object was created""" - self.created = None - """the upload id of extracted object""" - self.extractId = None - """the mode of extraction - upload or download""" - self.extractMode = None - """the name of the extracted object""" - self.name = None - """the state of the extracted object""" - self.state = None - """the status of the extraction""" - self.status = None - """type of the storage""" - self.storagetype = None - """the percentage of the entity uploaded to the specified location""" - self.uploadpercentage = None - """if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded""" - self.url = None - """zone ID the object was extracted from""" - self.zoneid = None - """zone name the object was extracted from""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/extractVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/extractVolume.py deleted file mode 100644 index 9596a81f568..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/extractVolume.py +++ /dev/null @@ -1,66 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Extracts volume""" -from baseCmd import * -from baseResponse import * -class extractVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the volume""" - """Required""" - self.id = None - """the mode of extraction - HTTP_DOWNLOAD or FTP_UPLOAD""" - """Required""" - self.mode = None - """the ID of the zone where the volume is located""" - """Required""" - self.zoneid = None - """the url to which the volume would be extracted""" - self.url = None - self.required = ["id","mode","zoneid",] - -class extractVolumeResponse (baseResponse): - def __init__(self): - """the id of extracted object""" - self.id = None - """the account id to which the extracted object belongs""" - self.accountid = None - """the time and date the object was created""" - self.created = None - """the upload id of extracted object""" - self.extractId = None - """the mode of extraction - upload or download""" - self.extractMode = None - """the name of the extracted object""" - self.name = None - """the state of the extracted object""" - self.state = None - """the status of the extraction""" - self.status = None - """type of the storage""" - self.storagetype = None - """the percentage of the entity uploaded to the specified location""" - self.uploadpercentage = None - """if mode = upload then url of the uploaded entity. if mode = download the url from which the entity can be downloaded""" - self.url = None - """zone ID the object was extracted from""" - self.zoneid = None - """zone name the object was extracted from""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/findHostsForMigration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/findHostsForMigration.py deleted file mode 100644 index cd6d34cef0f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/findHostsForMigration.py +++ /dev/null @@ -1,126 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Find hosts suitable for migrating a virtual machine.""" -from baseCmd import * -from baseResponse import * -class findHostsForMigrationCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """find hosts to which this VM can be migrated and flag the hosts with enough CPU/RAM to host the VM""" - """Required""" - self.virtualmachineid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["virtualmachineid",] - -class findHostsForMigrationResponse (baseResponse): - def __init__(self): - """the ID of the host""" - self.id = None - """the cpu average load on the host""" - self.averageload = None - """capabilities of the host""" - self.capabilities = None - """the cluster ID of the host""" - self.clusterid = None - """the cluster name of the host""" - self.clustername = None - """the cluster type of the cluster that host belongs to""" - self.clustertype = None - """the amount of the host's CPU currently allocated""" - self.cpuallocated = None - """the CPU number of the host""" - self.cpunumber = None - """the CPU speed of the host""" - self.cpuspeed = None - """the amount of the host's CPU currently used""" - self.cpuused = None - """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" - self.cpuwithoverprovisioning = None - """the date and time the host was created""" - self.created = None - """true if the host is disconnected. False otherwise.""" - self.disconnected = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the host""" - self.disksizetotal = None - """events available for the host""" - self.events = None - """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" - self.hahost = None - """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" - self.hasenoughcapacity = None - """comma-separated list of tags for the host""" - self.hosttags = None - """the host hypervisor""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the IP address of the host""" - self.ipaddress = None - """true if local storage is active, false otherwise""" - self.islocalstorageactive = None - """the date and time the host was last pinged""" - self.lastpinged = None - """the management server ID of the host""" - self.managementserverid = None - """the amount of the host's memory currently allocated""" - self.memoryallocated = None - """the memory total of the host""" - self.memorytotal = None - """the amount of the host's memory currently used""" - self.memoryused = None - """the name of the host""" - self.name = None - """the incoming network traffic on the host""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the OS category ID of the host""" - self.oscategoryid = None - """the OS category name of the host""" - self.oscategoryname = None - """the Pod ID of the host""" - self.podid = None - """the Pod name of the host""" - self.podname = None - """the date and time the host was removed""" - self.removed = None - """true if migrating a vm to this host requires storage motion, false otherwise""" - self.requiresStorageMotion = None - """the resource state of the host""" - self.resourcestate = None - """the state of the host""" - self.state = None - """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" - self.suitableformigration = None - """the host type""" - self.type = None - """the host version""" - self.version = None - """the Zone ID of the host""" - self.zoneid = None - """the Zone name of the host""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/findStoragePoolsForMigration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/findStoragePoolsForMigration.py deleted file mode 100644 index 71fda446ba7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/findStoragePoolsForMigration.py +++ /dev/null @@ -1,84 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists storage pools available for migration of a volume.""" -from baseCmd import * -from baseResponse import * -class findStoragePoolsForMigrationCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the volume""" - """Required""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["id",] - -class findStoragePoolsForMigrationResponse (baseResponse): - def __init__(self): - """the ID of the storage pool""" - self.id = None - """IOPS CloudStack can provision from this storage pool""" - self.capacityiops = None - """the ID of the cluster for the storage pool""" - self.clusterid = None - """the name of the cluster for the storage pool""" - self.clustername = None - """the date and time the storage pool was created""" - self.created = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the storage pool""" - self.disksizetotal = None - """the host's currently used disk size""" - self.disksizeused = None - """the hypervisor type of the storage pool""" - self.hypervisor = None - """the IP address of the storage pool""" - self.ipaddress = None - """the name of the storage pool""" - self.name = None - """the storage pool path""" - self.path = None - """the Pod ID of the storage pool""" - self.podid = None - """the Pod name of the storage pool""" - self.podname = None - """the scope of the storage pool""" - self.scope = None - """the state of the storage pool""" - self.state = None - """true if this pool is suitable to migrate a volume, false otherwise""" - self.suitableformigration = None - """the tags for the storage pool""" - self.tags = None - """the storage pool type""" - self.type = None - """the Zone ID of the storage pool""" - self.zoneid = None - """the Zone name of the storage pool""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/generateUsageRecords.py b/tools/marvin/build/lib/marvin/cloudstackAPI/generateUsageRecords.py deleted file mode 100644 index 26dbdbc93d7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/generateUsageRecords.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. - - -"""Generates usage records. This will generate records only if there any records to be generated, i.e if the scheduled usage job was not run or failed""" -from baseCmd import * -from baseResponse import * -class generateUsageRecordsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """End date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-03.""" - """Required""" - self.enddate = None - """Start date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-01.""" - """Required""" - self.startdate = None - """List events for the specified domain.""" - self.domainid = None - self.required = ["enddate","startdate",] - -class generateUsageRecordsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/getApiLimit.py b/tools/marvin/build/lib/marvin/cloudstackAPI/getApiLimit.py deleted file mode 100644 index 7b500fa1825..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/getApiLimit.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Get API limit count for the caller""" -from baseCmd import * -from baseResponse import * -class getApiLimitCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - self.required = [] - -class getApiLimitResponse (baseResponse): - def __init__(self): - """the account name of the api remaining count""" - self.account = None - """the account uuid of the api remaining count""" - self.accountid = None - """currently allowed number of apis""" - self.apiAllowed = None - """number of api already issued""" - self.apiIssued = None - """seconds left to reset counters""" - self.expireAfter = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/getCloudIdentifier.py b/tools/marvin/build/lib/marvin/cloudstackAPI/getCloudIdentifier.py deleted file mode 100644 index 42823a5e771..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/getCloudIdentifier.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. - - -"""Retrieves a cloud identifier.""" -from baseCmd import * -from baseResponse import * -class getCloudIdentifierCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the user ID for the cloud identifier""" - """Required""" - self.userid = None - self.required = ["userid",] - -class getCloudIdentifierResponse (baseResponse): - def __init__(self): - """the cloud identifier""" - self.cloudidentifier = None - """the signed response for the cloud identifier""" - self.signature = None - """the user ID for the cloud identifier""" - self.userid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/getUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/getUser.py deleted file mode 100644 index 88a5c3317cb..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/getUser.py +++ /dev/null @@ -1,66 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Find user account by API key""" -from baseCmd import * -from baseResponse import * -class getUserCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """API key of the user""" - """Required""" - self.userapikey = None - self.required = ["userapikey",] - -class getUserResponse (baseResponse): - def __init__(self): - """the user ID""" - self.id = None - """the account name of the user""" - self.account = None - """the account ID of the user""" - self.accountid = None - """the account type of the user""" - self.accounttype = None - """the api key of the user""" - self.apikey = None - """the date and time the user account was created""" - self.created = None - """the domain name of the user""" - self.domain = None - """the domain ID of the user""" - self.domainid = None - """the user email address""" - self.email = None - """the user firstname""" - self.firstname = None - """the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """true if user is default, false otherwise""" - self.isdefault = None - """the user lastname""" - self.lastname = None - """the secret key of the user""" - self.secretkey = None - """the user state""" - self.state = None - """the timezone user was created in""" - self.timezone = None - """the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/getVMPassword.py b/tools/marvin/build/lib/marvin/cloudstackAPI/getVMPassword.py deleted file mode 100644 index e4c519b5dbc..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/getVMPassword.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. - - -"""Returns an encrypted password for the VM""" -from baseCmd import * -from baseResponse import * -class getVMPasswordCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """The ID of the virtual machine""" - """Required""" - self.id = None - self.required = ["id",] - -class getVMPasswordResponse (baseResponse): - def __init__(self): - """The encrypted password of the VM""" - self.encryptedpassword = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/ldapCreateAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/ldapCreateAccount.py deleted file mode 100644 index d7c12861785..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/ldapCreateAccount.py +++ /dev/null @@ -1,190 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Creates an account from an LDAP user""" -from baseCmd import * -from baseResponse import * -class ldapCreateAccountCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Type of the account. Specify 0 for user, 1 for root admin, and 2 for domain admin""" - """Required""" - self.accounttype = None - """Unique username.""" - """Required""" - self.username = None - """Creates the user under the specified account. If no account is specified, the username will be used as the account name.""" - self.account = None - """details for account used to store specific parameters""" - self.accountdetails = [] - """Account UUID, required for adding account from external provisioning system""" - self.accountid = None - """Creates the user under the specified domain.""" - self.domainid = None - """Network domain for the account's networks""" - self.networkdomain = None - """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" - self.timezone = None - """User UUID, required for adding account from external provisioning system""" - self.userid = None - self.required = ["accounttype","username",] - -class ldapCreateAccountResponse (baseResponse): - def __init__(self): - """the id of the account""" - self.id = None - """details for the account""" - self.accountdetails = None - """account type (admin, domain-admin, user)""" - self.accounttype = None - """the total number of cpu cores available to be created for this account""" - self.cpuavailable = None - """the total number of cpu cores the account can own""" - self.cpulimit = None - """the total number of cpu cores owned by account""" - self.cputotal = None - """the default zone of the account""" - self.defaultzoneid = None - """name of the Domain the account belongs too""" - self.domain = None - """id of the Domain the account belongs too""" - self.domainid = None - """the total number of public ip addresses available for this account to acquire""" - self.ipavailable = None - """the total number of public ip addresses this account can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this account""" - self.iptotal = None - """true if the account requires cleanup""" - self.iscleanuprequired = None - """true if account is default, false otherwise""" - self.isdefault = None - """the total memory (in MB) available to be created for this account""" - self.memoryavailable = None - """the total memory (in MB) the account can own""" - self.memorylimit = None - """the total memory (in MB) owned by account""" - self.memorytotal = None - """the name of the account""" - self.name = None - """the total number of networks available to be created for this account""" - self.networkavailable = None - """the network domain""" - self.networkdomain = None - """the total number of networks the account can own""" - self.networklimit = None - """the total number of networks owned by account""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this account""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the account can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by account""" - self.primarystoragetotal = None - """the total number of projects available for administration by this account""" - self.projectavailable = None - """the total number of projects the account can own""" - self.projectlimit = None - """the total number of projects being administrated by this account""" - self.projecttotal = None - """the total number of network traffic bytes received""" - self.receivedbytes = None - """the total secondary storage space (in GiB) available to be used for this account""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the account can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by account""" - self.secondarystoragetotal = None - """the total number of network traffic bytes sent""" - self.sentbytes = None - """the total number of snapshots available for this account""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this account""" - self.snapshotlimit = None - """the total number of snapshots stored by this account""" - self.snapshottotal = None - """the state of the account""" - self.state = None - """the total number of templates available to be created by this account""" - self.templateavailable = None - """the total number of templates which can be created by this account""" - self.templatelimit = None - """the total number of templates which have been created by this account""" - self.templatetotal = None - """the total number of virtual machines available for this account to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this account""" - self.vmlimit = None - """the total number of virtual machines running for this account""" - self.vmrunning = None - """the total number of virtual machines stopped for this account""" - self.vmstopped = None - """the total number of virtual machines deployed by this account""" - self.vmtotal = None - """the total volume available for this account""" - self.volumeavailable = None - """the total volume which can be used by this account""" - self.volumelimit = None - """the total volume being used by this account""" - self.volumetotal = None - """the total number of vpcs available to be created for this account""" - self.vpcavailable = None - """the total number of vpcs the account can own""" - self.vpclimit = None - """the total number of vpcs owned by account""" - self.vpctotal = None - """the list of users associated with account""" - self.user = [] - -class user: - def __init__(self): - """"the user ID""" - self.id = None - """"the account name of the user""" - self.account = None - """"the account ID of the user""" - self.accountid = None - """"the account type of the user""" - self.accounttype = None - """"the api key of the user""" - self.apikey = None - """"the date and time the user account was created""" - self.created = None - """"the domain name of the user""" - self.domain = None - """"the domain ID of the user""" - self.domainid = None - """"the user email address""" - self.email = None - """"the user firstname""" - self.firstname = None - """"the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """"true if user is default, false otherwise""" - self.isdefault = None - """"the user lastname""" - self.lastname = None - """"the secret key of the user""" - self.secretkey = None - """"the user state""" - self.state = None - """"the timezone user was created in""" - self.timezone = None - """"the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAccounts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAccounts.py deleted file mode 100644 index 85a75a625cf..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listAccounts.py +++ /dev/null @@ -1,192 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists accounts and provides detailed account information for listed accounts""" -from baseCmd import * -from baseResponse import * -class listAccountsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list accounts by account type. Valid account types are 1 (admin), 2 (domain-admin), and 0 (user).""" - self.accounttype = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list account by account ID""" - self.id = None - """list accounts by cleanuprequred attribute (values are true or false)""" - self.iscleanuprequired = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """list account by account name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list accounts by state. Valid states are enabled, disabled, and locked.""" - self.state = None - self.required = [] - -class listAccountsResponse (baseResponse): - def __init__(self): - """the id of the account""" - self.id = None - """details for the account""" - self.accountdetails = None - """account type (admin, domain-admin, user)""" - self.accounttype = None - """the total number of cpu cores available to be created for this account""" - self.cpuavailable = None - """the total number of cpu cores the account can own""" - self.cpulimit = None - """the total number of cpu cores owned by account""" - self.cputotal = None - """the default zone of the account""" - self.defaultzoneid = None - """name of the Domain the account belongs too""" - self.domain = None - """id of the Domain the account belongs too""" - self.domainid = None - """the total number of public ip addresses available for this account to acquire""" - self.ipavailable = None - """the total number of public ip addresses this account can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this account""" - self.iptotal = None - """true if the account requires cleanup""" - self.iscleanuprequired = None - """true if account is default, false otherwise""" - self.isdefault = None - """the total memory (in MB) available to be created for this account""" - self.memoryavailable = None - """the total memory (in MB) the account can own""" - self.memorylimit = None - """the total memory (in MB) owned by account""" - self.memorytotal = None - """the name of the account""" - self.name = None - """the total number of networks available to be created for this account""" - self.networkavailable = None - """the network domain""" - self.networkdomain = None - """the total number of networks the account can own""" - self.networklimit = None - """the total number of networks owned by account""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this account""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the account can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by account""" - self.primarystoragetotal = None - """the total number of projects available for administration by this account""" - self.projectavailable = None - """the total number of projects the account can own""" - self.projectlimit = None - """the total number of projects being administrated by this account""" - self.projecttotal = None - """the total number of network traffic bytes received""" - self.receivedbytes = None - """the total secondary storage space (in GiB) available to be used for this account""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the account can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by account""" - self.secondarystoragetotal = None - """the total number of network traffic bytes sent""" - self.sentbytes = None - """the total number of snapshots available for this account""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this account""" - self.snapshotlimit = None - """the total number of snapshots stored by this account""" - self.snapshottotal = None - """the state of the account""" - self.state = None - """the total number of templates available to be created by this account""" - self.templateavailable = None - """the total number of templates which can be created by this account""" - self.templatelimit = None - """the total number of templates which have been created by this account""" - self.templatetotal = None - """the total number of virtual machines available for this account to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this account""" - self.vmlimit = None - """the total number of virtual machines running for this account""" - self.vmrunning = None - """the total number of virtual machines stopped for this account""" - self.vmstopped = None - """the total number of virtual machines deployed by this account""" - self.vmtotal = None - """the total volume available for this account""" - self.volumeavailable = None - """the total volume which can be used by this account""" - self.volumelimit = None - """the total volume being used by this account""" - self.volumetotal = None - """the total number of vpcs available to be created for this account""" - self.vpcavailable = None - """the total number of vpcs the account can own""" - self.vpclimit = None - """the total number of vpcs owned by account""" - self.vpctotal = None - """the list of users associated with account""" - self.user = [] - -class user: - def __init__(self): - """"the user ID""" - self.id = None - """"the account name of the user""" - self.account = None - """"the account ID of the user""" - self.accountid = None - """"the account type of the user""" - self.accounttype = None - """"the api key of the user""" - self.apikey = None - """"the date and time the user account was created""" - self.created = None - """"the domain name of the user""" - self.domain = None - """"the domain ID of the user""" - self.domainid = None - """"the user email address""" - self.email = None - """"the user firstname""" - self.firstname = None - """"the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """"true if user is default, false otherwise""" - self.isdefault = None - """"the user lastname""" - self.lastname = None - """"the secret key of the user""" - self.secretkey = None - """"the user state""" - self.state = None - """"the timezone user was created in""" - self.timezone = None - """"the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroupTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroupTypes.py deleted file mode 100644 index 091d39126c2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroupTypes.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. - - -"""Lists affinity group types available""" -from baseCmd import * -from baseResponse import * -class listAffinityGroupTypesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listAffinityGroupTypesResponse (baseResponse): - def __init__(self): - """the type of the affinity group""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroups.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroups.py deleted file mode 100644 index b74791ea738..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listAffinityGroups.py +++ /dev/null @@ -1,67 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists affinity groups""" -from baseCmd import * -from baseResponse import * -class listAffinityGroupsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list the affinity group by the id provided""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """lists affinity groups by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """lists affinity groups by type""" - self.type = None - """lists affinity groups by virtual machine id""" - self.virtualmachineid = None - self.required = [] - -class listAffinityGroupsResponse (baseResponse): - def __init__(self): - """the ID of the affinity group""" - self.id = None - """the account owning the affinity group""" - self.account = None - """the description of the affinity group""" - self.description = None - """the domain name of the affinity group""" - self.domain = None - """the domain ID of the affinity group""" - self.domainid = None - """the name of the affinity group""" - self.name = None - """the type of the affinity group""" - self.type = None - """virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAlerts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAlerts.py deleted file mode 100644 index bcbd1cfc6e4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listAlerts.py +++ /dev/null @@ -1,47 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all alerts.""" -from baseCmd import * -from baseResponse import * -class listAlertsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the alert""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """list by alert type""" - self.type = None - self.required = [] - -class listAlertsResponse (baseResponse): - def __init__(self): - """the id of the alert""" - self.id = None - """description of the alert""" - self.description = None - """the date and time the alert was sent""" - self.sent = None - """One of the following alert types: MEMORY = 0, CPU = 1, STORAGE = 2, STORAGE_ALLOCATED = 3, PUBLIC_IP = 4, PRIVATE_IP = 5, HOST = 6, USERVM = 7, DOMAIN_ROUTER = 8, CONSOLE_PROXY = 9, ROUTING = 10: lost connection to default route (to the gateway), STORAGE_MISC = 11: lost connection to default route (to the gateway), USAGE_SERVER = 12: lost connection to default route (to the gateway), MANAGMENT_NODE = 13: lost connection to default route (to the gateway), DOMAIN_ROUTER_MIGRATE = 14, CONSOLE_PROXY_MIGRATE = 15, USERVM_MIGRATE = 16, VLAN = 17, SSVM = 18, USAGE_SERVER_RESULT = 19""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listApis.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listApis.py deleted file mode 100644 index 99269698d08..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listApis.py +++ /dev/null @@ -1,75 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""lists all available apis on the server, provided by the Api Discovery plugin""" -from baseCmd import * -from baseResponse import * -class listApisCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """API name""" - self.name = None - self.required = [] - -class listApisResponse (baseResponse): - def __init__(self): - """description of the api""" - self.description = None - """true if api is asynchronous""" - self.isasync = None - """the name of the api command""" - self.name = None - """comma separated related apis""" - self.related = None - """version of CloudStack the api was introduced in""" - self.since = None - """response field type""" - self.type = None - """the list params the api accepts""" - self.params = [] - """api response fields""" - self.response = [] - -class params: - def __init__(self): - """"description of the api parameter""" - self.description = None - """"length of the parameter""" - self.length = None - """"the name of the api parameter""" - self.name = None - """"comma separated related apis to get the parameter""" - self.related = None - """"true if this parameter is required for the api request""" - self.required = None - """"version of CloudStack the api was introduced in""" - self.since = None - """"parameter type""" - self.type = None - -class response: - def __init__(self): - """"description of the api response field""" - self.description = None - """"the name of the api response field""" - self.name = None - """"api response fields""" - self.response = None - """"response field type""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAsyncJobs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAsyncJobs.py deleted file mode 100644 index 7670845ea50..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listAsyncJobs.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. - - -"""Lists all pending asynchronous jobs for the account.""" -from baseCmd import * -from baseResponse import * -class listAsyncJobsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """the start date of the async job""" - self.startdate = None - self.required = [] - -class listAsyncJobsResponse (baseResponse): - def __init__(self): - """the account that executed the async command""" - self.accountid = None - """the async command executed""" - self.cmd = None - """the created date of the job""" - self.created = None - """the unique ID of the instance/entity object related to the job""" - self.jobinstanceid = None - """the instance/entity object related to the job""" - self.jobinstancetype = None - """the progress information of the PENDING job""" - self.jobprocstatus = None - """the result reason""" - self.jobresult = None - """the result code for the job""" - self.jobresultcode = None - """the result type""" - self.jobresulttype = None - """the current job status-should be 0 for PENDING""" - self.jobstatus = None - """the user that executed the async command""" - self.userid = None - """the ID of the async job""" - self.jobid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScalePolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScalePolicies.py deleted file mode 100644 index a579b5cf0cd..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScalePolicies.py +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists autoscale policies.""" -from baseCmd import * -from baseResponse import * -class listAutoScalePoliciesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """the action to be executed if all the conditions evaluate to true for the specified duration.""" - self.action = None - """the ID of the condition of the policy""" - self.conditionid = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the ID of the autoscale policy""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """the ID of the autoscale vm group""" - self.vmgroupid = None - self.required = [] - -class listAutoScalePoliciesResponse (baseResponse): - def __init__(self): - """the autoscale policy ID""" - self.id = None - """the account owning the autoscale policy""" - self.account = None - """the action to be executed if all the conditions evaluate to true for the specified duration.""" - self.action = None - """the list of IDs of the conditions that are being evaluated on every interval""" - self.conditions = None - """the domain name of the autoscale policy""" - self.domain = None - """the domain ID of the autoscale policy""" - self.domainid = None - """the duration for which the conditions have to be true before action is taken""" - self.duration = None - """the project name of the autoscale policy""" - self.project = None - """the project id autoscale policy""" - self.projectid = None - """the cool down period for which the policy should not be evaluated after the action has been taken""" - self.quiettime = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmGroups.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmGroups.py deleted file mode 100644 index 04e79e44357..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmGroups.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. - - -"""Lists autoscale vm groups.""" -from baseCmd import * -from baseResponse import * -class listAutoScaleVmGroupsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the ID of the autoscale vm group""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """the ID of the loadbalancer""" - self.lbruleid = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """the ID of the policy""" - self.policyid = None - """list objects by project""" - self.projectid = None - """the ID of the profile""" - self.vmprofileid = None - """the availability zone ID""" - self.zoneid = None - self.required = [] - -class listAutoScaleVmGroupsResponse (baseResponse): - def __init__(self): - """the autoscale vm group ID""" - self.id = None - """the account owning the instance group""" - self.account = None - """the domain name of the vm profile""" - self.domain = None - """the domain ID of the vm profile""" - self.domainid = None - """the frequency at which the conditions have to be evaluated""" - self.interval = None - """the load balancer rule ID""" - self.lbruleid = None - """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" - self.maxmembers = None - """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" - self.minmembers = None - """the project name of the vm profile""" - self.project = None - """the project id vm profile""" - self.projectid = None - """list of scaledown autoscale policies""" - self.scaledownpolicies = None - """list of scaleup autoscale policies""" - self.scaleuppolicies = None - """the current state of the AutoScale Vm Group""" - self.state = None - """the autoscale profile that contains information about the vms in the vm group.""" - self.vmprofileid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmProfiles.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmProfiles.py deleted file mode 100644 index 6e3244d0671..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listAutoScaleVmProfiles.py +++ /dev/null @@ -1,75 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists autoscale vm profiles.""" -from baseCmd import * -from baseResponse import * -class listAutoScaleVmProfilesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the ID of the autoscale vm profile""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """the otherdeployparameters of the autoscale vm profile""" - self.otherdeployparams = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """the templateid of the autoscale vm profile""" - self.templateid = None - self.required = [] - -class listAutoScaleVmProfilesResponse (baseResponse): - def __init__(self): - """the autoscale vm profile ID""" - self.id = None - """the account owning the instance group""" - self.account = None - """the ID of the user used to launch and destroy the VMs""" - self.autoscaleuserid = None - """the time allowed for existing connections to get closed before a vm is destroyed""" - self.destroyvmgraceperiod = None - """the domain name of the vm profile""" - self.domain = None - """the domain ID of the vm profile""" - self.domainid = None - """parameters other than zoneId/serviceOfferringId/templateId to be used while deploying a virtual machine""" - self.otherdeployparams = None - """the project name of the vm profile""" - self.project = None - """the project id vm profile""" - self.projectid = None - """the service offering to be used while deploying a virtual machine""" - self.serviceofferingid = None - """the template to be used while deploying a virtual machine""" - self.templateid = None - """the availability zone to be used while deploying a virtual machine""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalDhcp.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalDhcp.py deleted file mode 100644 index 073706dc2df..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalDhcp.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. - - -"""list baremetal dhcp servers""" -from baseCmd import * -from baseResponse import * -class listBaremetalDhcpCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Type of DHCP device""" - self.dhcpservertype = None - """DHCP server device ID""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listBaremetalDhcpResponse (baseResponse): - def __init__(self): - """device id of""" - self.id = None - """name of the provider""" - self.dhcpservertype = None - """the physical network to which this external dhcp device belongs to""" - self.physicalnetworkid = None - """name of the provider""" - self.provider = None - """url""" - self.url = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalPxeServers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalPxeServers.py deleted file mode 100644 index 5b9bb22257d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listBaremetalPxeServers.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. - - -"""list baremetal pxe server""" -from baseCmd import * -from baseResponse import * -class listBaremetalPxeServersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Pxe server device ID""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listBaremetalPxeServersResponse (baseResponse): - def __init__(self): - """device id of""" - self.id = None - """the physical network to which this external dhcp device belongs to""" - self.physicalnetworkid = None - """name of the provider""" - self.provider = None - """url""" - self.url = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listBigSwitchVnsDevices.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listBigSwitchVnsDevices.py deleted file mode 100644 index 6f7bc8177d3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listBigSwitchVnsDevices.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. - - -"""Lists BigSwitch Vns devices""" -from baseCmd import * -from baseResponse import * -class listBigSwitchVnsDevicesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """the Physical Network ID""" - self.physicalnetworkid = None - """bigswitch vns device ID""" - self.vnsdeviceid = None - self.required = [] - -class listBigSwitchVnsDevicesResponse (baseResponse): - def __init__(self): - """device name""" - self.bigswitchdevicename = None - """the controller Ip address""" - self.hostname = None - """the physical network to which this BigSwitch Vns belongs to""" - self.physicalnetworkid = None - """name of the provider""" - self.provider = None - """device id of the BigSwitch Vns""" - self.vnsdeviceid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listCapabilities.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listCapabilities.py deleted file mode 100644 index 317ff24a128..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listCapabilities.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. - - -"""Lists capabilities""" -from baseCmd import * -from baseResponse import * -class listCapabilitiesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - self.required = [] - -class listCapabilitiesResponse (baseResponse): - def __init__(self): - """true if regular user is allowed to create projects""" - self.allowusercreateprojects = None - """time interval (in seconds) to reset api count""" - self.apilimitinterval = None - """Max allowed number of api requests within the specified interval""" - self.apilimitmax = None - """version of the cloud stack""" - self.cloudstackversion = None - """maximum size that can be specified when create disk from disk offering with custom size""" - self.customdiskofferingmaxsize = None - """If invitation confirmation is required when add account to project""" - self.projectinviterequired = None - """true if region wide secondary is enabled, false otherwise""" - self.regionsecondaryenabled = None - """true if security groups support is enabled, false otherwise""" - self.securitygroupsenabled = None - """true if region supports elastic load balancer on basic zones""" - self.supportELB = None - """true if user and domain admins can set templates to be shared, false otherwise""" - self.userpublictemplateenabled = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listCapacity.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listCapacity.py deleted file mode 100644 index adf6452dc6c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listCapacity.py +++ /dev/null @@ -1,67 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all the system wide capacities.""" -from baseCmd import * -from baseResponse import * -class listCapacityCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """lists capacity by the Cluster ID""" - self.clusterid = None - """recalculate capacities and fetch the latest""" - self.fetchlatest = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """lists capacity by the Pod ID""" - self.podid = None - """Sort the results. Available values: Usage""" - self.sortby = None - """lists capacity by type* CAPACITY_TYPE_MEMORY = 0* CAPACITY_TYPE_CPU = 1* CAPACITY_TYPE_STORAGE = 2* CAPACITY_TYPE_STORAGE_ALLOCATED = 3* CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP = 4* CAPACITY_TYPE_PRIVATE_IP = 5* CAPACITY_TYPE_SECONDARY_STORAGE = 6* CAPACITY_TYPE_VLAN = 7* CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8* CAPACITY_TYPE_LOCAL_STORAGE = 9.""" - self.type = None - """lists capacity by the Zone ID""" - self.zoneid = None - self.required = [] - -class listCapacityResponse (baseResponse): - def __init__(self): - """the total capacity available""" - self.capacitytotal = None - """the capacity currently in use""" - self.capacityused = None - """the Cluster ID""" - self.clusterid = None - """the Cluster name""" - self.clustername = None - """the percentage of capacity currently in use""" - self.percentused = None - """the Pod ID""" - self.podid = None - """the Pod name""" - self.podname = None - """the capacity type""" - self.type = None - """the Zone ID""" - self.zoneid = None - """the Zone name""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listClusters.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listClusters.py deleted file mode 100644 index c0cc067cde6..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listClusters.py +++ /dev/null @@ -1,102 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists clusters.""" -from baseCmd import * -from baseResponse import * -class listClustersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """lists clusters by allocation state""" - self.allocationstate = None - """lists clusters by cluster type""" - self.clustertype = None - """lists clusters by hypervisor type""" - self.hypervisor = None - """lists clusters by the cluster ID""" - self.id = None - """List by keyword""" - self.keyword = None - """whether this cluster is managed by cloudstack""" - self.managedstate = None - """lists clusters by the cluster name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """lists clusters by Pod ID""" - self.podid = None - """flag to display the capacity of the clusters""" - self.showcapacities = None - """lists clusters by Zone ID""" - self.zoneid = None - self.required = [] - -class listClustersResponse (baseResponse): - def __init__(self): - """the cluster ID""" - self.id = None - """the allocation state of the cluster""" - self.allocationstate = None - """the type of the cluster""" - self.clustertype = None - """The cpu overcommit ratio of the cluster""" - self.cpuovercommitratio = None - """the hypervisor type of the cluster""" - self.hypervisortype = None - """whether this cluster is managed by cloudstack""" - self.managedstate = None - """The memory overcommit ratio of the cluster""" - self.memoryovercommitratio = None - """the cluster name""" - self.name = None - """the Pod ID of the cluster""" - self.podid = None - """the Pod name of the cluster""" - self.podname = None - """the Zone ID of the cluster""" - self.zoneid = None - """the Zone name of the cluster""" - self.zonename = None - """the capacity of the Cluster""" - self.capacity = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listConditions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listConditions.py deleted file mode 100644 index f19c205cdd8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listConditions.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. - - -"""List Conditions for the specific user""" -from baseCmd import * -from baseResponse import * -class listConditionsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """Counter-id of the condition.""" - self.counterid = None - """list only resources belonging to the domain specified""" - self.domainid = None - """ID of the Condition.""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """the ID of the policy""" - self.policyid = None - self.required = [] - -class listConditionsResponse (baseResponse): - def __init__(self): - """the id of the Condition""" - self.id = None - """the owner of the Condition.""" - self.account = None - """Details of the Counter.""" - self.counter = None - """the domain name of the owner.""" - self.domain = None - """the domain id of the Condition owner""" - self.domainid = None - """the project name of the Condition""" - self.project = None - """the project id of the Condition.""" - self.projectid = None - """Relational Operator to be used with threshold.""" - self.relationaloperator = None - """Threshold Value for the counter.""" - self.threshold = None - """zone id of counter""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listConfigurations.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listConfigurations.py deleted file mode 100644 index 538232370bf..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listConfigurations.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. - - -"""Lists all configurations.""" -from baseCmd import * -from baseResponse import * -class listConfigurationsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the Account to update the parameter value for corresponding account""" - self.accountid = None - """lists configurations by category""" - self.category = None - """the ID of the Cluster to update the parameter value for corresponding cluster""" - self.clusterid = None - """List by keyword""" - self.keyword = None - """lists configuration by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the ID of the Storage pool to update the parameter value for corresponding storage pool""" - self.storageid = None - """the ID of the Zone to update the parameter value for corresponding zone""" - self.zoneid = None - self.required = [] - -class listConfigurationsResponse (baseResponse): - def __init__(self): - """the value of the configuration""" - self.id = None - """the category of the configuration""" - self.category = None - """the description of the configuration""" - self.description = None - """the name of the configuration""" - self.name = None - """scope(zone/cluster/pool/account) of the parameter that needs to be updated""" - self.scope = None - """the value of the configuration""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listCounters.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listCounters.py deleted file mode 100644 index 105b2feb197..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listCounters.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. - - -"""List the counters""" -from baseCmd import * -from baseResponse import * -class listCountersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """ID of the Counter.""" - self.id = None - """List by keyword""" - self.keyword = None - """Name of the counter.""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """Source of the counter.""" - self.source = None - self.required = [] - -class listCountersResponse (baseResponse): - def __init__(self): - """the id of the Counter""" - self.id = None - """Name of the counter.""" - self.name = None - """Source of the counter.""" - self.source = None - """Value in case of snmp or other specific counters.""" - self.value = None - """zone id of counter""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedClusters.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedClusters.py deleted file mode 100644 index 6afffa4a440..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedClusters.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists dedicated clusters.""" -from baseCmd import * -from baseResponse import * -class listDedicatedClustersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the name of the account associated with the cluster. Must be used with domainId.""" - self.account = None - """list dedicated clusters by affinity group""" - self.affinitygroupid = None - """the ID of the cluster""" - self.clusterid = None - """the ID of the domain associated with the cluster""" - self.domainid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listDedicatedClustersResponse (baseResponse): - def __init__(self): - """the ID of the dedicated resource""" - self.id = None - """the Account ID of the cluster""" - self.accountid = None - """the Dedication Affinity Group ID of the cluster""" - self.affinitygroupid = None - """the ID of the cluster""" - self.clusterid = None - """the name of the cluster""" - self.clustername = None - """the domain ID of the cluster""" - self.domainid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedGuestVlanRanges.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedGuestVlanRanges.py deleted file mode 100644 index 9cb0d570da5..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedGuestVlanRanges.py +++ /dev/null @@ -1,67 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists dedicated guest vlan ranges""" -from baseCmd import * -from baseResponse import * -class listDedicatedGuestVlanRangesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the account with which the guest VLAN range is associated. Must be used with the domainId parameter.""" - self.account = None - """the domain ID with which the guest VLAN range is associated. If used with the account parameter, returns all guest VLAN ranges for that account in the specified domain.""" - self.domainid = None - """the dedicated guest vlan range""" - self.guestvlanrange = None - """list dedicated guest vlan ranges by id""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """physical network id of the guest VLAN range""" - self.physicalnetworkid = None - """project who will own the guest VLAN range""" - self.projectid = None - """zone of the guest VLAN range""" - self.zoneid = None - self.required = [] - -class listDedicatedGuestVlanRangesResponse (baseResponse): - def __init__(self): - """the ID of the guest VLAN range""" - self.id = None - """the account of the guest VLAN range""" - self.account = None - """the domain name of the guest VLAN range""" - self.domain = None - """the domain ID of the guest VLAN range""" - self.domainid = None - """the guest VLAN range""" - self.guestvlanrange = None - """the physical network of the guest vlan range""" - self.physicalnetworkid = None - """the project name of the guest vlan range""" - self.project = None - """the project id of the guest vlan range""" - self.projectid = None - """the zone of the guest vlan range""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedHosts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedHosts.py deleted file mode 100644 index d2f8aaf5e87..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedHosts.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists dedicated hosts.""" -from baseCmd import * -from baseResponse import * -class listDedicatedHostsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the name of the account associated with the host. Must be used with domainId.""" - self.account = None - """list dedicated hosts by affinity group""" - self.affinitygroupid = None - """the ID of the domain associated with the host""" - self.domainid = None - """the ID of the host""" - self.hostid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listDedicatedHostsResponse (baseResponse): - def __init__(self): - """the ID of the dedicated resource""" - self.id = None - """the Account ID of the host""" - self.accountid = None - """the Dedication Affinity Group ID of the host""" - self.affinitygroupid = None - """the domain ID of the host""" - self.domainid = None - """the ID of the host""" - self.hostid = None - """the name of the host""" - self.hostname = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedPods.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedPods.py deleted file mode 100644 index 245f0e36eff..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedPods.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists dedicated pods.""" -from baseCmd import * -from baseResponse import * -class listDedicatedPodsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the name of the account associated with the pod. Must be used with domainId.""" - self.account = None - """list dedicated pods by affinity group""" - self.affinitygroupid = None - """the ID of the domain associated with the pod""" - self.domainid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """the ID of the pod""" - self.podid = None - self.required = [] - -class listDedicatedPodsResponse (baseResponse): - def __init__(self): - """the ID of the dedicated resource""" - self.id = None - """the Account Id to which the Pod is dedicated""" - self.accountid = None - """the Dedication Affinity Group ID of the pod""" - self.affinitygroupid = None - """the domain ID to which the Pod is dedicated""" - self.domainid = None - """the ID of the Pod""" - self.podid = None - """the Name of the Pod""" - self.podname = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedZones.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedZones.py deleted file mode 100644 index d287010ae72..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDedicatedZones.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List dedicated zones.""" -from baseCmd import * -from baseResponse import * -class listDedicatedZonesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the name of the account associated with the zone. Must be used with domainId.""" - self.account = None - """list dedicated zones by affinity group""" - self.affinitygroupid = None - """the ID of the domain associated with the zone""" - self.domainid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """the ID of the Zone""" - self.zoneid = None - self.required = [] - -class listDedicatedZonesResponse (baseResponse): - def __init__(self): - """the ID of the dedicated resource""" - self.id = None - """the Account Id to which the Zone is dedicated""" - self.accountid = None - """the Dedication Affinity Group ID of the zone""" - self.affinitygroupid = None - """the domain ID to which the Zone is dedicated""" - self.domainid = None - """the ID of the Zone""" - self.zoneid = None - """the Name of the Zone""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDeploymentPlanners.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDeploymentPlanners.py deleted file mode 100644 index 6adefdc4d33..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDeploymentPlanners.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. - - -"""Lists all DeploymentPlanners available.""" -from baseCmd import * -from baseResponse import * -class listDeploymentPlannersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listDeploymentPlannersResponse (baseResponse): - def __init__(self): - """Deployment Planner name""" - self.name = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDiskOfferings.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDiskOfferings.py deleted file mode 100644 index c49758d2750..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDiskOfferings.py +++ /dev/null @@ -1,77 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all available disk offerings.""" -from baseCmd import * -from baseResponse import * -class listDiskOfferingsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the domain of the disk offering.""" - self.domainid = None - """ID of the disk offering""" - self.id = None - """List by keyword""" - self.keyword = None - """name of the disk offering""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listDiskOfferingsResponse (baseResponse): - def __init__(self): - """unique ID of the disk offering""" - self.id = None - """the date this disk offering was created""" - self.created = None - """bytes read rate of the disk offering""" - self.diskBytesReadRate = None - """bytes write rate of the disk offering""" - self.diskBytesWriteRate = None - """io requests read rate of the disk offering""" - self.diskIopsReadRate = None - """io requests write rate of the disk offering""" - self.diskIopsWriteRate = None - """the size of the disk offering in GB""" - self.disksize = None - """whether to display the offering to the end user or not.""" - self.displayoffering = None - """an alternate display text of the disk offering.""" - self.displaytext = None - """the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.""" - self.domain = None - """the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.""" - self.domainid = None - """true if disk offering uses custom size, false otherwise""" - self.iscustomized = None - """true if disk offering uses custom iops, false otherwise""" - self.iscustomizediops = None - """the max iops of the disk offering""" - self.maxiops = None - """the min iops of the disk offering""" - self.miniops = None - """the name of the disk offering""" - self.name = None - """the storage type for this disk offering""" - self.storagetype = None - """the tags for the disk offering""" - self.tags = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDomainChildren.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDomainChildren.py deleted file mode 100644 index 83c1fb9abbf..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDomainChildren.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. - - -"""Lists all children domains belonging to a specified domain""" -from baseCmd import * -from baseResponse import * -class listDomainChildrenCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list children domain by parent domain ID.""" - self.id = None - """to return the entire tree, use the value "true". To return the first level children, use the value "false".""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """list children domains by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listDomainChildrenResponse (baseResponse): - def __init__(self): - """the ID of the domain""" - self.id = None - """whether the domain has one or more sub-domains""" - self.haschild = None - """the level of the domain""" - self.level = None - """the name of the domain""" - self.name = None - """the network domain""" - self.networkdomain = None - """the domain ID of the parent domain""" - self.parentdomainid = None - """the domain name of the parent domain""" - self.parentdomainname = None - """the path of the domain""" - self.path = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listDomains.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listDomains.py deleted file mode 100644 index 1f8c929b317..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listDomains.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. - - -"""Lists domains and provides detailed information for listed domains""" -from baseCmd import * -from baseResponse import * -class listDomainsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List domain by domain ID.""" - self.id = None - """List by keyword""" - self.keyword = None - """List domains by domain level.""" - self.level = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """List domain by domain name.""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listDomainsResponse (baseResponse): - def __init__(self): - """the ID of the domain""" - self.id = None - """whether the domain has one or more sub-domains""" - self.haschild = None - """the level of the domain""" - self.level = None - """the name of the domain""" - self.name = None - """the network domain""" - self.networkdomain = None - """the domain ID of the parent domain""" - self.parentdomainid = None - """the domain name of the parent domain""" - self.parentdomainname = None - """the path of the domain""" - self.path = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listEgressFirewallRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listEgressFirewallRules.py deleted file mode 100644 index 38f169c54f7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listEgressFirewallRules.py +++ /dev/null @@ -1,102 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all egress firewall rules for network id.""" -from baseCmd import * -from baseResponse import * -class listEgressFirewallRulesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """Lists rule with the specified ID.""" - self.id = None - """Lists rule with the specified ID.""" - self.id = None - """the id of IP address of the firwall services""" - self.ipaddressid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """the id network network for the egress firwall services""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - self.required = [] - -class listEgressFirewallRulesResponse (baseResponse): - def __init__(self): - """the ID of the firewall rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the ending port of firewall rule's port range""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """the public ip address for the firewall rule""" - self.ipaddress = None - """the public ip address id for the firewall rule""" - self.ipaddressid = None - """the network id of the firewall rule""" - self.networkid = None - """the protocol of the firewall rule""" - self.protocol = None - """the starting port of firewall rule's port range""" - self.startport = None - """the state of the rule""" - self.state = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listEventTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listEventTypes.py deleted file mode 100644 index 46a1341df19..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listEventTypes.py +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List Event Types""" -from baseCmd import * -from baseResponse import * -class listEventTypesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - self.required = [] - -class listEventTypesResponse (baseResponse): - def __init__(self): - """Event Type""" - self.name = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listEvents.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listEvents.py deleted file mode 100644 index 5e4646f29d1..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listEvents.py +++ /dev/null @@ -1,85 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""A command to list events.""" -from baseCmd import * -from baseResponse import * -class listEventsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the duration of the event""" - self.duration = None - """the end date range of the list you want to retrieve (use format "yyyy-MM-dd" or the new format "yyyy-MM-dd HH:mm:ss")""" - self.enddate = None - """the time the event was entered""" - self.entrytime = None - """the ID of the event""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """the event level (INFO, WARN, ERROR)""" - self.level = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """the start date range of the list you want to retrieve (use format "yyyy-MM-dd" or the new format "yyyy-MM-dd HH:mm:ss")""" - self.startdate = None - """the event type (see event types)""" - self.type = None - self.required = [] - -class listEventsResponse (baseResponse): - def __init__(self): - """the ID of the event""" - self.id = None - """the account name for the account that owns the object being acted on in the event (e.g. the owner of the virtual machine, ip address, or security group)""" - self.account = None - """the date the event was created""" - self.created = None - """a brief description of the event""" - self.description = None - """the name of the account's domain""" - self.domain = None - """the id of the account's domain""" - self.domainid = None - """the event level (INFO, WARN, ERROR)""" - self.level = None - """whether the event is parented""" - self.parentid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the state of the event""" - self.state = None - """the type of the event (see event types)""" - self.type = None - """the name of the user who performed the action (can be different from the account if an admin is performing an action for a user, e.g. starting/stopping a user's virtual machine)""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listFirewallRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listFirewallRules.py deleted file mode 100644 index bb19ca1ec15..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listFirewallRules.py +++ /dev/null @@ -1,98 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all firewall rules for an IP address.""" -from baseCmd import * -from baseResponse import * -class listFirewallRulesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """Lists rule with the specified ID.""" - self.id = None - """the id of IP address of the firwall services""" - self.ipaddressid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - self.required = [] - -class listFirewallRulesResponse (baseResponse): - def __init__(self): - """the ID of the firewall rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the ending port of firewall rule's port range""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """the public ip address for the firewall rule""" - self.ipaddress = None - """the public ip address id for the firewall rule""" - self.ipaddressid = None - """the network id of the firewall rule""" - self.networkid = None - """the protocol of the firewall rule""" - self.protocol = None - """the starting port of firewall rule's port range""" - self.startport = None - """the state of the rule""" - self.state = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listGlobalLoadBalancerRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listGlobalLoadBalancerRules.py deleted file mode 100644 index ac55b10901b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listGlobalLoadBalancerRules.py +++ /dev/null @@ -1,161 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists load balancer rules.""" -from baseCmd import * -from baseResponse import * -class listGlobalLoadBalancerRulesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the ID of the global load balancer rule""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """region ID""" - self.regionid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - self.required = [] - -class listGlobalLoadBalancerRulesResponse (baseResponse): - def __init__(self): - """global load balancer rule ID""" - self.id = None - """the account of the load balancer rule""" - self.account = None - """the description of the global load balancer rule""" - self.description = None - """the domain of the load balancer rule""" - self.domain = None - """the domain ID of the load balancer rule""" - self.domainid = None - """DNS domain name given for the global load balancer""" - self.gslbdomainname = None - """Load balancing method used for the global load balancer""" - self.gslblbmethod = None - """GSLB service type""" - self.gslbservicetype = None - """session persistence method used for the global load balancer""" - self.gslbstickysessionmethodname = None - """name of the global load balancer rule""" - self.name = None - """the project name of the load balancer""" - self.project = None - """the project id of the load balancer""" - self.projectid = None - """Region Id in which global load balancer is created""" - self.regionid = None - """List of load balancer rules that are part of GSLB rule""" - self.loadbalancerrule = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class loadbalancerrule: - def __init__(self): - """"the load balancer rule ID""" - self.id = None - """"the account of the load balancer rule""" - self.account = None - """"the load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """"the cidr list to forward traffic from""" - self.cidrlist = None - """"the description of the load balancer""" - self.description = None - """"the domain of the load balancer rule""" - self.domain = None - """"the domain ID of the load balancer rule""" - self.domainid = None - """"the name of the load balancer""" - self.name = None - """"the id of the guest network the lb rule belongs to""" - self.networkid = None - """"the private port""" - self.privateport = None - """"the project name of the load balancer""" - self.project = None - """"the project id of the load balancer""" - self.projectid = None - """"the public ip address""" - self.publicip = None - """"the public ip address id""" - self.publicipid = None - """"the public port""" - self.publicport = None - """"the state of the rule""" - self.state = None - """"the id of the zone the rule belongs to""" - self.zoneid = None - """"the list of resource tags associated with load balancer""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listHosts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listHosts.py deleted file mode 100644 index 5b74a59db01..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listHosts.py +++ /dev/null @@ -1,147 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists hosts.""" -from baseCmd import * -from baseResponse import * -class listHostsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """lists hosts existing in particular cluster""" - self.clusterid = None - """comma separated list of host details requested, value can be a list of [ min, all, capacity, events, stats]""" - self.details = [] - """if true, list only hosts dedicated to HA""" - self.hahost = None - """the id of the host""" - self.id = None - """List by keyword""" - self.keyword = None - """the name of the host""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the Pod ID for the host""" - self.podid = None - """list hosts by resource state. Resource state represents current state determined by admin of host, valule can be one of [Enabled, Disabled, Unmanaged, PrepareForMaintenance, ErrorInMaintenance, Maintenance, Error]""" - self.resourcestate = None - """the state of the host""" - self.state = None - """the host type""" - self.type = None - """lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM""" - self.virtualmachineid = None - """the Zone ID for the host""" - self.zoneid = None - self.required = [] - -class listHostsResponse (baseResponse): - def __init__(self): - """the ID of the host""" - self.id = None - """the cpu average load on the host""" - self.averageload = None - """capabilities of the host""" - self.capabilities = None - """the cluster ID of the host""" - self.clusterid = None - """the cluster name of the host""" - self.clustername = None - """the cluster type of the cluster that host belongs to""" - self.clustertype = None - """the amount of the host's CPU currently allocated""" - self.cpuallocated = None - """the CPU number of the host""" - self.cpunumber = None - """the CPU speed of the host""" - self.cpuspeed = None - """the amount of the host's CPU currently used""" - self.cpuused = None - """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" - self.cpuwithoverprovisioning = None - """the date and time the host was created""" - self.created = None - """true if the host is disconnected. False otherwise.""" - self.disconnected = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the host""" - self.disksizetotal = None - """events available for the host""" - self.events = None - """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" - self.hahost = None - """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" - self.hasenoughcapacity = None - """comma-separated list of tags for the host""" - self.hosttags = None - """the host hypervisor""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the IP address of the host""" - self.ipaddress = None - """true if local storage is active, false otherwise""" - self.islocalstorageactive = None - """the date and time the host was last pinged""" - self.lastpinged = None - """the management server ID of the host""" - self.managementserverid = None - """the amount of the host's memory currently allocated""" - self.memoryallocated = None - """the memory total of the host""" - self.memorytotal = None - """the amount of the host's memory currently used""" - self.memoryused = None - """the name of the host""" - self.name = None - """the incoming network traffic on the host""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the OS category ID of the host""" - self.oscategoryid = None - """the OS category name of the host""" - self.oscategoryname = None - """the Pod ID of the host""" - self.podid = None - """the Pod name of the host""" - self.podname = None - """the date and time the host was removed""" - self.removed = None - """the resource state of the host""" - self.resourcestate = None - """the state of the host""" - self.state = None - """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" - self.suitableformigration = None - """the host type""" - self.type = None - """the host version""" - self.version = None - """the Zone ID of the host""" - self.zoneid = None - """the Zone name of the host""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisorCapabilities.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisorCapabilities.py deleted file mode 100644 index 3547f276ffe..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisorCapabilities.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all hypervisor capabilities.""" -from baseCmd import * -from baseResponse import * -class listHypervisorCapabilitiesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the hypervisor for which to restrict the search""" - self.hypervisor = None - """ID of the hypervisor capability""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listHypervisorCapabilitiesResponse (baseResponse): - def __init__(self): - """the ID of the hypervisor capabilities row""" - self.id = None - """the hypervisor type""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the maximum number of Data Volumes that can be attached for this hypervisor""" - self.maxdatavolumeslimit = None - """the maximum number of guest vms recommended for this hypervisor""" - self.maxguestslimit = None - """the maximum number of Hosts per cluster for this hypervisor""" - self.maxhostspercluster = None - """true if security group is supported""" - self.securitygroupenabled = None - """true if storage motion is supported""" - self.storagemotionenabled = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisors.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisors.py deleted file mode 100644 index a49dc5018f9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listHypervisors.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. - - -"""List hypervisors""" -from baseCmd import * -from baseResponse import * -class listHypervisorsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the zone id for listing hypervisors.""" - self.zoneid = None - self.required = [] - -class listHypervisorsResponse (baseResponse): - def __init__(self): - """Hypervisor name""" - self.name = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listImageStores.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listImageStores.py deleted file mode 100644 index 21c649b7712..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listImageStores.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. - - -"""Lists image stores.""" -from baseCmd import * -from baseResponse import * -class listImageStoresCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the storage pool""" - self.id = None - """List by keyword""" - self.keyword = None - """the name of the image store""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the image store protocol""" - self.protocol = None - """the image store provider""" - self.provider = None - """the Zone ID for the image store""" - self.zoneid = None - self.required = [] - -class listImageStoresResponse (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listInstanceGroups.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listInstanceGroups.py deleted file mode 100644 index 6a0bbaebf29..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listInstanceGroups.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. - - -"""Lists vm groups""" -from baseCmd import * -from baseResponse import * -class listInstanceGroupsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list instance groups by ID""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """list instance groups by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - self.required = [] - -class listInstanceGroupsResponse (baseResponse): - def __init__(self): - """the id of the instance group""" - self.id = None - """the account owning the instance group""" - self.account = None - """time and date the instance group was created""" - self.created = None - """the domain name of the instance group""" - self.domain = None - """the domain ID of the instance group""" - self.domainid = None - """the name of the instance group""" - self.name = None - """the project name of the group""" - self.project = None - """the project id of the group""" - self.projectid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerElements.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerElements.py deleted file mode 100644 index 794edada374..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerElements.py +++ /dev/null @@ -1,47 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all available Internal Load Balancer elements.""" -from baseCmd import * -from baseResponse import * -class listInternalLoadBalancerElementsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list internal load balancer elements by enabled state""" - self.enabled = None - """list internal load balancer elements by id""" - self.id = None - """List by keyword""" - self.keyword = None - """list internal load balancer elements by network service provider id""" - self.nspid = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listInternalLoadBalancerElementsResponse (baseResponse): - def __init__(self): - """the id of the internal load balancer element""" - self.id = None - """Enabled/Disabled the element""" - self.enabled = None - """the physical network service provider id of the element""" - self.nspid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerVMs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerVMs.py deleted file mode 100644 index eee1d66f533..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listInternalLoadBalancerVMs.py +++ /dev/null @@ -1,182 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List internal LB VMs.""" -from baseCmd import * -from baseResponse import * -class listInternalLoadBalancerVMsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """if true is passed for this parameter, list only VPC Internal LB VMs""" - self.forvpc = None - """the host ID of the Internal LB VM""" - self.hostid = None - """the ID of the Internal LB VM""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """the name of the Internal LB VM""" - self.name = None - """list by network id""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """the Pod ID of the Internal LB VM""" - self.podid = None - """list objects by project""" - self.projectid = None - """the state of the Internal LB VM""" - self.state = None - """List Internal LB VMs by VPC""" - self.vpcid = None - """the Zone ID of the Internal LB VM""" - self.zoneid = None - self.required = [] - -class listInternalLoadBalancerVMsResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listIpForwardingRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listIpForwardingRules.py deleted file mode 100644 index 73838a2313d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listIpForwardingRules.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. - - -"""List the ip forwarding rules""" -from baseCmd import * -from baseResponse import * -class listIpForwardingRulesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """Lists rule with the specified ID.""" - self.id = None - """list the rule belonging to this public ip address""" - self.ipaddressid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """Lists all rules applied to the specified Vm.""" - self.virtualmachineid = None - self.required = [] - -class listIpForwardingRulesResponse (baseResponse): - def __init__(self): - """the ID of the port forwarding rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the public ip address for the port forwarding rule""" - self.ipaddress = None - """the public ip address id for the port forwarding rule""" - self.ipaddressid = None - """the ending port of port forwarding rule's private port range""" - self.privateendport = None - """the starting port of port forwarding rule's private port range""" - self.privateport = None - """the protocol of the port forwarding rule""" - self.protocol = None - """the ending port of port forwarding rule's private port range""" - self.publicendport = None - """the starting port of port forwarding rule's public port range""" - self.publicport = None - """the state of the rule""" - self.state = None - """the VM display name for the port forwarding rule""" - self.virtualmachinedisplayname = None - """the VM ID for the port forwarding rule""" - self.virtualmachineid = None - """the VM name for the port forwarding rule""" - self.virtualmachinename = None - """the vm ip address for the port forwarding rule""" - self.vmguestip = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listIsoPermissions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listIsoPermissions.py deleted file mode 100644 index 0ad16c0eba4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listIsoPermissions.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. - - -"""List iso visibility and all accounts that have permissions to view this iso.""" -from baseCmd import * -from baseResponse import * -class listIsoPermissionsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the template ID""" - """Required""" - self.id = None - self.required = ["id",] - -class listIsoPermissionsResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the list of accounts the template is available for""" - self.account = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """the list of projects the template is available for""" - self.projectids = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listIsos.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listIsos.py deleted file mode 100644 index 9394c0556f7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listIsos.py +++ /dev/null @@ -1,162 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all available ISO files.""" -from baseCmd import * -from baseResponse import * -class listIsosCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the hypervisor for which to restrict the search""" - self.hypervisor = None - """list ISO by id""" - self.id = None - """possible values are "featured", "self", "selfexecutable","sharedexecutable","executable", and "community". * featured : templates that have been marked as featured and public. * self : templates that have been registered or created by the calling user. * selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. * sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. * executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. * community : templates that have been marked as public but not featured. * all : all templates (only usable by admins).""" - self.isofilter = None - """true if the ISO is publicly available to all users, false otherwise.""" - self.ispublic = None - """true if this ISO is ready to be deployed""" - self.isready = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """list all isos by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """the ID of the zone""" - self.zoneid = None - self.required = [] - -class listIsosResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLBHealthCheckPolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLBHealthCheckPolicies.py deleted file mode 100644 index 03c312d8352..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listLBHealthCheckPolicies.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. - - -"""Lists load balancer HealthCheck policies.""" -from baseCmd import * -from baseResponse import * -class listLBHealthCheckPoliciesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the load balancer rule""" - """Required""" - self.lbruleid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["lbruleid",] - -class listLBHealthCheckPoliciesResponse (baseResponse): - def __init__(self): - """the account of the HealthCheck policy""" - self.account = None - """the domain of the HealthCheck policy""" - self.domain = None - """the domain ID of the HealthCheck policy""" - self.domainid = None - """the LB rule ID""" - self.lbruleid = None - """the id of the zone the HealthCheck policy belongs to""" - self.zoneid = None - """the list of healthcheckpolicies""" - self.healthcheckpolicy = [] - -class healthcheckpolicy: - def __init__(self): - """"the LB HealthCheck policy ID""" - self.id = None - """"the description of the healthcheck policy""" - self.description = None - """"Amount of time between health checks""" - self.healthcheckinterval = None - """"Number of consecutive health check success before declaring an instance healthy""" - self.healthcheckthresshold = None - """"the pingpath of the healthcheck policy""" - self.pingpath = None - """"Time to wait when receiving a response from the health check""" - self.responsetime = None - """"the state of the policy""" - self.state = None - """"Number of consecutive health check failures before declaring an instance unhealthy.""" - self.unhealthcheckthresshold = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLBStickinessPolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLBStickinessPolicies.py deleted file mode 100644 index 1d3c7cbe551..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listLBStickinessPolicies.py +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists LBStickiness policies.""" -from baseCmd import * -from baseResponse import * -class listLBStickinessPoliciesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the load balancer rule""" - """Required""" - self.lbruleid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["lbruleid",] - -class listLBStickinessPoliciesResponse (baseResponse): - def __init__(self): - """the account of the Stickiness policy""" - self.account = None - """the description of the Stickiness policy""" - self.description = None - """the domain of the Stickiness policy""" - self.domain = None - """the domain ID of the Stickiness policy""" - self.domainid = None - """the LB rule ID""" - self.lbruleid = None - """the name of the Stickiness policy""" - self.name = None - """the state of the policy""" - self.state = None - """the id of the zone the Stickiness policy belongs to""" - self.zoneid = None - """the list of stickinesspolicies""" - self.stickinesspolicy = [] - -class stickinesspolicy: - def __init__(self): - """"the LB Stickiness policy ID""" - self.id = None - """"the description of the Stickiness policy""" - self.description = None - """"the method name of the Stickiness policy""" - self.methodname = None - """"the name of the Stickiness policy""" - self.name = None - """"the params of the policy""" - self.params = None - """"the state of the policy""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapConfigurations.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapConfigurations.py deleted file mode 100644 index 3203a05f33c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapConfigurations.py +++ /dev/null @@ -1,43 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all LDAP configurations""" -from baseCmd import * -from baseResponse import * -class listLdapConfigurationsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Hostname""" - self.hostname = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """Port""" - self.port = None - self.required = [] - -class listLdapConfigurationsResponse (baseResponse): - def __init__(self): - """hostname""" - self.hostname = None - """port""" - self.port = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapUsers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapUsers.py deleted file mode 100644 index 0dec30e103b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listLdapUsers.py +++ /dev/null @@ -1,47 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all LDAP Users""" -from baseCmd import * -from baseResponse import * -class listLdapUsersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """Determines whether all ldap users are returned or just non-cloudstack users""" - self.listtype = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listLdapUsersResponse (baseResponse): - def __init__(self): - """The user's email""" - self.email = None - """The user's firstname""" - self.firstname = None - """The user's lastname""" - self.lastname = None - """The user's principle""" - self.principal = None - """The user's username""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRuleInstances.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRuleInstances.py deleted file mode 100644 index 908ff440146..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRuleInstances.py +++ /dev/null @@ -1,377 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List all virtual machine instances that are assigned to a load balancer rule.""" -from baseCmd import * -from baseResponse import * -class listLoadBalancerRuleInstancesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the load balancer rule""" - """Required""" - self.id = None - """true if listing all virtual machines currently applied to the load balancer rule; default is true""" - self.applied = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["id",] - -class listLoadBalancerRuleInstancesResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRules.py deleted file mode 100644 index 770f3b3a88b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancerRules.py +++ /dev/null @@ -1,118 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists load balancer rules.""" -from baseCmd import * -from baseResponse import * -class listLoadBalancerRulesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the ID of the load balancer rule""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """the name of the load balancer rule""" - self.name = None - """list by network id the rule belongs to""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """the public IP address id of the load balancer rule""" - self.publicipid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """the ID of the virtual machine of the load balancer rule""" - self.virtualmachineid = None - """the availability zone ID""" - self.zoneid = None - self.required = [] - -class listLoadBalancerRulesResponse (baseResponse): - def __init__(self): - """the load balancer rule ID""" - self.id = None - """the account of the load balancer rule""" - self.account = None - """the load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the description of the load balancer""" - self.description = None - """the domain of the load balancer rule""" - self.domain = None - """the domain ID of the load balancer rule""" - self.domainid = None - """the name of the load balancer""" - self.name = None - """the id of the guest network the lb rule belongs to""" - self.networkid = None - """the private port""" - self.privateport = None - """the project name of the load balancer""" - self.project = None - """the project id of the load balancer""" - self.projectid = None - """the public ip address""" - self.publicip = None - """the public ip address id""" - self.publicipid = None - """the public port""" - self.publicport = None - """the state of the rule""" - self.state = None - """the id of the zone the rule belongs to""" - self.zoneid = None - """the list of resource tags associated with load balancer""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancers.py deleted file mode 100644 index 5cde328286e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listLoadBalancers.py +++ /dev/null @@ -1,132 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists Load Balancers""" -from baseCmd import * -from baseResponse import * -class listLoadBalancersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the ID of the Load Balancer""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """the name of the Load Balancer""" - self.name = None - """the network id of the Load Balancer""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """the scheme of the Load Balancer. Supported value is Internal in the current release""" - self.scheme = None - """the source ip address of the Load Balancer""" - self.sourceipaddress = None - """the network id of the source ip address""" - self.sourceipaddressnetworkid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - self.required = [] - -class listLoadBalancersResponse (baseResponse): - def __init__(self): - """the Load Balancer ID""" - self.id = None - """the account of the Load Balancer""" - self.account = None - """the load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """the description of the Load Balancer""" - self.description = None - """the domain of the Load Balancer""" - self.domain = None - """the domain ID of the Load Balancer""" - self.domainid = None - """the name of the Load Balancer""" - self.name = None - """Load Balancer network id""" - self.networkid = None - """the project name of the Load Balancer""" - self.project = None - """the project id of the Load Balancer""" - self.projectid = None - """Load Balancer source ip""" - self.sourceipaddress = None - """Load Balancer source ip network id""" - self.sourceipaddressnetworkid = None - """the list of instances associated with the Load Balancer""" - self.loadbalancerinstance = [] - """the list of rules associated with the Load Balancer""" - self.loadbalancerrule = [] - """the list of resource tags associated with the Load Balancer""" - self.tags = [] - -class loadbalancerinstance: - def __init__(self): - """"the instance ID""" - self.id = None - """"the ip address of the instance""" - self.ipaddress = None - """"the name of the instance""" - self.name = None - """"the state of the instance""" - self.state = None - -class loadbalancerrule: - def __init__(self): - """"instance port of the load balancer rule""" - self.instanceport = None - """"source port of the load balancer rule""" - self.sourceport = None - """"the state of the load balancer rule""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLLists.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLLists.py deleted file mode 100644 index a7bc92bf0d1..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLLists.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. - - -"""Lists all network ACLs""" -from baseCmd import * -from baseResponse import * -class listNetworkACLListsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Lists network ACL with the specified ID.""" - self.id = None - """List by keyword""" - self.keyword = None - """list network ACLs by specified name""" - self.name = None - """list network ACLs by network Id""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """list network ACLs by Vpc Id""" - self.vpcid = None - self.required = [] - -class listNetworkACLListsResponse (baseResponse): - def __init__(self): - """the ID of the ACL""" - self.id = None - """Description of the ACL""" - self.description = None - """the Name of the ACL""" - self.name = None - """Id of the VPC this ACL is associated with""" - self.vpcid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLs.py deleted file mode 100644 index 10dd3163772..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkACLs.py +++ /dev/null @@ -1,108 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all network ACL items""" -from baseCmd import * -from baseResponse import * -class listNetworkACLsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list network ACL Items by ACL Id""" - self.aclid = None - """list network ACL Items by Action""" - self.action = None - """list only resources belonging to the domain specified""" - self.domainid = None - """Lists network ACL Item with the specified ID""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """list network ACL Items by network Id""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """list network ACL Items by Protocol""" - self.protocol = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """list network ACL Items by traffic type - Ingress or Egress""" - self.traffictype = None - self.required = [] - -class listNetworkACLsResponse (baseResponse): - def __init__(self): - """the ID of the ACL Item""" - self.id = None - """the ID of the ACL this item belongs to""" - self.aclid = None - """Action of ACL Item. Allow/Deny""" - self.action = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the ending port of ACL's port range""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """Number of the ACL Item""" - self.number = None - """the protocol of the ACL""" - self.protocol = None - """the starting port of ACL's port range""" - self.startport = None - """the state of the rule""" - self.state = None - """the traffic type for the ACL""" - self.traffictype = None - """the list of resource tags associated with the network ACLs""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkDevice.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkDevice.py deleted file mode 100644 index a1199c6c42e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkDevice.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. - - -"""List network devices""" -from baseCmd import * -from baseResponse import * -class listNetworkDeviceCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """parameters for network device""" - self.networkdeviceparameterlist = [] - """Network device type, now supports ExternalDhcp, PxeServer, NetscalerMPXLoadBalancer, NetscalerVPXLoadBalancer, NetscalerSDXLoadBalancer, F5BigIpLoadBalancer, JuniperSRXFirewall""" - self.networkdevicetype = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listNetworkDeviceResponse (baseResponse): - def __init__(self): - """the ID of the network device""" - self.id = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkIsolationMethods.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkIsolationMethods.py deleted file mode 100644 index 67ed7fdd4ce..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkIsolationMethods.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. - - -"""Lists supported methods of network isolation""" -from baseCmd import * -from baseResponse import * -class listNetworkIsolationMethodsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listNetworkIsolationMethodsResponse (baseResponse): - def __init__(self): - """Network isolation method name""" - self.name = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkOfferings.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkOfferings.py deleted file mode 100644 index a36f46dd825..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkOfferings.py +++ /dev/null @@ -1,166 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all available network offerings.""" -from baseCmd import * -from baseResponse import * -class listNetworkOfferingsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the availability of network offering. Default value is Required""" - self.availability = None - """list network offerings by display text""" - self.displaytext = None - """the network offering can be used only for network creation inside the VPC""" - self.forvpc = None - """list network offerings by guest type: Shared or Isolated""" - self.guestiptype = None - """list network offerings by id""" - self.id = None - """true if need to list only default network offerings. Default value is false""" - self.isdefault = None - """true if offering has tags specified""" - self.istagged = None - """List by keyword""" - self.keyword = None - """list network offerings by name""" - self.name = None - """the ID of the network. Pass this in if you want to see the available network offering that a network can be changed to.""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """true if need to list only netwok offerings where source nat is supported, false otherwise""" - self.sourcenatsupported = None - """true if need to list only network offerings which support specifying ip ranges""" - self.specifyipranges = None - """the tags for the network offering.""" - self.specifyvlan = None - """list network offerings by state""" - self.state = None - """list network offerings supporting certain services""" - self.supportedservices = [] - """list network offerings by tags""" - self.tags = None - """list by traffic type""" - self.traffictype = None - """list netowrk offerings available for network creation in specific zone""" - self.zoneid = None - self.required = [] - -class listNetworkOfferingsResponse (baseResponse): - def __init__(self): - """the id of the network offering""" - self.id = None - """availability of the network offering""" - self.availability = None - """true if network offering is ip conserve mode enabled""" - self.conservemode = None - """the date this network offering was created""" - self.created = None - """additional key/value details tied with network offering""" - self.details = None - """an alternate display text of the network offering.""" - self.displaytext = None - """true if network offering supports persistent networks, false otherwise""" - self.egressdefaultpolicy = None - """true if network offering can be used by VPC networks only""" - self.forvpc = None - """guest type of the network offering, can be Shared or Isolated""" - self.guestiptype = None - """true if network offering is default, false otherwise""" - self.isdefault = None - """true if network offering supports persistent networks, false otherwise""" - self.ispersistent = None - """maximum number of concurrents connections to be handled by lb""" - self.maxconnections = None - """the name of the network offering""" - self.name = None - """data transfer rate in megabits per second allowed.""" - self.networkrate = None - """the ID of the service offering used by virtual router provider""" - self.serviceofferingid = None - """true if network offering supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """true if network offering supports vlans, false otherwise""" - self.specifyvlan = None - """state of the network offering. Can be Disabled/Enabled/Inactive""" - self.state = None - """the tags for the network offering""" - self.tags = None - """the traffic type for the network offering, supported types are Public, Management, Control, Guest, Vlan or Storage.""" - self.traffictype = None - """the list of supported services""" - self.service = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkServiceProviders.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkServiceProviders.py deleted file mode 100644 index 287401e689a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworkServiceProviders.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists network serviceproviders for a given physical network.""" -from baseCmd import * -from baseResponse import * -class listNetworkServiceProvidersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """list providers by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the Physical Network ID""" - self.physicalnetworkid = None - """list providers by state""" - self.state = None - self.required = [] - -class listNetworkServiceProvidersResponse (baseResponse): - def __init__(self): - """uuid of the network provider""" - self.id = None - """true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """the destination physical network""" - self.destinationphysicalnetworkid = None - """the provider name""" - self.name = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """services for this provider""" - self.servicelist = None - """state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworks.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworks.py deleted file mode 100644 index 60e451699b4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNetworks.py +++ /dev/null @@ -1,243 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all available networks.""" -from baseCmd import * -from baseResponse import * -class listNetworksCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list networks by ACL (access control list) type. Supported values are Account and Domain""" - self.acltype = None - """list networks available for vm deployment""" - self.canusefordeploy = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the network belongs to vpc""" - self.forvpc = None - """list networks by id""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """true if network is system, false otherwise""" - self.issystem = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list networks by physical network id""" - self.physicalnetworkid = None - """list objects by project""" - self.projectid = None - """list networks by restartRequired""" - self.restartrequired = None - """true if need to list only networks which support specifying ip ranges""" - self.specifyipranges = None - """list networks supporting certain services""" - self.supportedservices = [] - """List resources by tags (key/value pairs)""" - self.tags = [] - """type of the traffic""" - self.traffictype = None - """the type of the network. Supported values are: Isolated and Shared""" - self.type = None - """List networks by VPC""" - self.vpcid = None - """the Zone ID of the network""" - self.zoneid = None - self.required = [] - -class listNetworksResponse (baseResponse): - def __init__(self): - """the id of the network""" - self.id = None - """the owner of the network""" - self.account = None - """ACL Id associated with the VPC network""" - self.aclid = None - """acl type - access type to the network""" - self.acltype = None - """Broadcast domain type of the network""" - self.broadcastdomaintype = None - """broadcast uri of the network. This parameter is visible to ROOT admins only""" - self.broadcasturi = None - """list networks available for vm deployment""" - self.canusefordeploy = None - """Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" - self.cidr = None - """an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """the displaytext of the network""" - self.displaytext = None - """the first DNS for the network""" - self.dns1 = None - """the second DNS for the network""" - self.dns2 = None - """the domain name of the network owner""" - self.domain = None - """the domain id of the network owner""" - self.domainid = None - """the network's gateway""" - self.gateway = None - """the cidr of IPv6 network""" - self.ip6cidr = None - """the gateway of IPv6 network""" - self.ip6gateway = None - """true if network is default, false otherwise""" - self.isdefault = None - """list networks that are persistent""" - self.ispersistent = None - """true if network is system, false otherwise""" - self.issystem = None - """the name of the network""" - self.name = None - """the network's netmask""" - self.netmask = None - """the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" - self.networkcidr = None - """the network domain""" - self.networkdomain = None - """availability of the network offering the network is created from""" - self.networkofferingavailability = None - """true if network offering is ip conserve mode enabled""" - self.networkofferingconservemode = None - """display text of the network offering the network is created from""" - self.networkofferingdisplaytext = None - """network offering id the network is created from""" - self.networkofferingid = None - """name of the network offering the network is created from""" - self.networkofferingname = None - """the physical network id""" - self.physicalnetworkid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """related to what other network configuration""" - self.related = None - """the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" - self.reservediprange = None - """true network requires restart""" - self.restartrequired = None - """true if network supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """state of the network""" - self.state = None - """true if users from subdomains can access the domain level network""" - self.subdomainaccess = None - """the traffic type of the network""" - self.traffictype = None - """the type of the network""" - self.type = None - """The vlan of the network. This parameter is visible to ROOT admins only""" - self.vlan = None - """VPC the network belongs to""" - self.vpcid = None - """zone id of the network""" - self.zoneid = None - """the name of the zone the network belongs to""" - self.zonename = None - """the list of services""" - self.service = [] - """the list of resource tags associated with network""" - self.tags = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDeviceNetworks.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDeviceNetworks.py deleted file mode 100644 index d19ba547469..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDeviceNetworks.py +++ /dev/null @@ -1,208 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""lists network that are using a nicira nvp device""" -from baseCmd import * -from baseResponse import * -class listNiciraNvpDeviceNetworksCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """nicira nvp device ID""" - """Required""" - self.nvpdeviceid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["nvpdeviceid",] - -class listNiciraNvpDeviceNetworksResponse (baseResponse): - def __init__(self): - """the id of the network""" - self.id = None - """the owner of the network""" - self.account = None - """ACL Id associated with the VPC network""" - self.aclid = None - """acl type - access type to the network""" - self.acltype = None - """Broadcast domain type of the network""" - self.broadcastdomaintype = None - """broadcast uri of the network. This parameter is visible to ROOT admins only""" - self.broadcasturi = None - """list networks available for vm deployment""" - self.canusefordeploy = None - """Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" - self.cidr = None - """an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """the displaytext of the network""" - self.displaytext = None - """the first DNS for the network""" - self.dns1 = None - """the second DNS for the network""" - self.dns2 = None - """the domain name of the network owner""" - self.domain = None - """the domain id of the network owner""" - self.domainid = None - """the network's gateway""" - self.gateway = None - """the cidr of IPv6 network""" - self.ip6cidr = None - """the gateway of IPv6 network""" - self.ip6gateway = None - """true if network is default, false otherwise""" - self.isdefault = None - """list networks that are persistent""" - self.ispersistent = None - """true if network is system, false otherwise""" - self.issystem = None - """the name of the network""" - self.name = None - """the network's netmask""" - self.netmask = None - """the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" - self.networkcidr = None - """the network domain""" - self.networkdomain = None - """availability of the network offering the network is created from""" - self.networkofferingavailability = None - """true if network offering is ip conserve mode enabled""" - self.networkofferingconservemode = None - """display text of the network offering the network is created from""" - self.networkofferingdisplaytext = None - """network offering id the network is created from""" - self.networkofferingid = None - """name of the network offering the network is created from""" - self.networkofferingname = None - """the physical network id""" - self.physicalnetworkid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """related to what other network configuration""" - self.related = None - """the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" - self.reservediprange = None - """true network requires restart""" - self.restartrequired = None - """true if network supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """state of the network""" - self.state = None - """true if users from subdomains can access the domain level network""" - self.subdomainaccess = None - """the traffic type of the network""" - self.traffictype = None - """the type of the network""" - self.type = None - """The vlan of the network. This parameter is visible to ROOT admins only""" - self.vlan = None - """VPC the network belongs to""" - self.vpcid = None - """zone id of the network""" - self.zoneid = None - """the name of the zone the network belongs to""" - self.zonename = None - """the list of services""" - self.service = [] - """the list of resource tags associated with network""" - self.tags = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDevices.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDevices.py deleted file mode 100644 index fde71953f4f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNiciraNvpDevices.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. - - -"""Lists Nicira NVP devices""" -from baseCmd import * -from baseResponse import * -class listNiciraNvpDevicesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """nicira nvp device ID""" - self.nvpdeviceid = None - """""" - self.page = None - """""" - self.pagesize = None - """the Physical Network ID""" - self.physicalnetworkid = None - self.required = [] - -class listNiciraNvpDevicesResponse (baseResponse): - def __init__(self): - """the controller Ip address""" - self.hostname = None - """this L3 gateway service Uuid""" - self.l3gatewayserviceuuid = None - """device name""" - self.niciradevicename = None - """device id of the Nicire Nvp""" - self.nvpdeviceid = None - """the physical network to which this Nirica Nvp belongs to""" - self.physicalnetworkid = None - """name of the provider""" - self.provider = None - """the transport zone Uuid""" - self.transportzoneuuid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listNics.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listNics.py deleted file mode 100644 index d2a663a612e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listNics.py +++ /dev/null @@ -1,72 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""list the vm nics IP to NIC""" -from baseCmd import * -from baseResponse import * -class listNicsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the vm""" - """Required""" - self.virtualmachineid = None - """List by keyword""" - self.keyword = None - """the ID of the nic to to list IPs""" - self.nicid = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["virtualmachineid",] - -class listNicsResponse (baseResponse): - def __init__(self): - """the ID of the nic""" - self.id = None - """the broadcast uri of the nic""" - self.broadcasturi = None - """the gateway of the nic""" - self.gateway = None - """the IPv6 address of network""" - self.ip6address = None - """the cidr of IPv6 network""" - self.ip6cidr = None - """the gateway of IPv6 network""" - self.ip6gateway = None - """the ip address of the nic""" - self.ipaddress = None - """true if nic is default, false otherwise""" - self.isdefault = None - """the isolation uri of the nic""" - self.isolationuri = None - """true if nic is default, false otherwise""" - self.macaddress = None - """the netmask of the nic""" - self.netmask = None - """the ID of the corresponding network""" - self.networkid = None - """the name of the corresponding network""" - self.networkname = None - """the Secondary ipv4 addr of nic""" - self.secondaryip = None - """the traffic type of the nic""" - self.traffictype = None - """the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listOsCategories.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listOsCategories.py deleted file mode 100644 index 6289315c19e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listOsCategories.py +++ /dev/null @@ -1,43 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all supported OS categories for this cloud.""" -from baseCmd import * -from baseResponse import * -class listOsCategoriesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list Os category by id""" - self.id = None - """List by keyword""" - self.keyword = None - """list os category by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listOsCategoriesResponse (baseResponse): - def __init__(self): - """the ID of the OS category""" - self.id = None - """the name of the OS category""" - self.name = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listOsTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listOsTypes.py deleted file mode 100644 index 426a32d1fae..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listOsTypes.py +++ /dev/null @@ -1,47 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all supported OS types for this cloud.""" -from baseCmd import * -from baseResponse import * -class listOsTypesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list os by description""" - self.description = None - """list by Os type Id""" - self.id = None - """List by keyword""" - self.keyword = None - """list by Os Category id""" - self.oscategoryid = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listOsTypesResponse (baseResponse): - def __init__(self): - """the ID of the OS type""" - self.id = None - """the name/description of the OS type""" - self.description = None - """the ID of the OS category""" - self.oscategoryid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPhysicalNetworks.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPhysicalNetworks.py deleted file mode 100644 index 4cc716471ac..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listPhysicalNetworks.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. - - -"""Lists physical networks""" -from baseCmd import * -from baseResponse import * -class listPhysicalNetworksCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list physical network by id""" - self.id = None - """List by keyword""" - self.keyword = None - """search by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the Zone ID for the physical network""" - self.zoneid = None - self.required = [] - -class listPhysicalNetworksResponse (baseResponse): - def __init__(self): - """the uuid of the physical network""" - self.id = None - """Broadcast domain range of the physical network""" - self.broadcastdomainrange = None - """the domain id of the physical network owner""" - self.domainid = None - """isolation methods""" - self.isolationmethods = None - """name of the physical network""" - self.name = None - """the speed of the physical network""" - self.networkspeed = None - """state of the physical network""" - self.state = None - """comma separated tag""" - self.tags = None - """the vlan of the physical network""" - self.vlan = None - """zone id of the physical network""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPods.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPods.py deleted file mode 100644 index 64868d9b501..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listPods.py +++ /dev/null @@ -1,88 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all Pods.""" -from baseCmd import * -from baseResponse import * -class listPodsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list pods by allocation state""" - self.allocationstate = None - """list Pods by ID""" - self.id = None - """List by keyword""" - self.keyword = None - """list Pods by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """flag to display the capacity of the pods""" - self.showcapacities = None - """list Pods by Zone ID""" - self.zoneid = None - self.required = [] - -class listPodsResponse (baseResponse): - def __init__(self): - """the ID of the Pod""" - self.id = None - """the allocation state of the Pod""" - self.allocationstate = None - """the ending IP for the Pod""" - self.endip = None - """the gateway of the Pod""" - self.gateway = None - """the name of the Pod""" - self.name = None - """the netmask of the Pod""" - self.netmask = None - """the starting IP for the Pod""" - self.startip = None - """the Zone ID of the Pod""" - self.zoneid = None - """the Zone name of the Pod""" - self.zonename = None - """the capacity of the Pod""" - self.capacity = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPortForwardingRules.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPortForwardingRules.py deleted file mode 100644 index 02e9666b32e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listPortForwardingRules.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. - - -"""Lists all port forwarding rules for an IP address.""" -from baseCmd import * -from baseResponse import * -class listPortForwardingRulesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """Lists rule with the specified ID.""" - self.id = None - """the id of IP address of the port forwarding services""" - self.ipaddressid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - self.required = [] - -class listPortForwardingRulesResponse (baseResponse): - def __init__(self): - """the ID of the port forwarding rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the public ip address for the port forwarding rule""" - self.ipaddress = None - """the public ip address id for the port forwarding rule""" - self.ipaddressid = None - """the ending port of port forwarding rule's private port range""" - self.privateendport = None - """the starting port of port forwarding rule's private port range""" - self.privateport = None - """the protocol of the port forwarding rule""" - self.protocol = None - """the ending port of port forwarding rule's private port range""" - self.publicendport = None - """the starting port of port forwarding rule's public port range""" - self.publicport = None - """the state of the rule""" - self.state = None - """the VM display name for the port forwarding rule""" - self.virtualmachinedisplayname = None - """the VM ID for the port forwarding rule""" - self.virtualmachineid = None - """the VM name for the port forwarding rule""" - self.virtualmachinename = None - """the vm ip address for the port forwarding rule""" - self.vmguestip = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPortableIpRanges.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPortableIpRanges.py deleted file mode 100644 index 8f1c4d95298..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listPortableIpRanges.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. - - -"""list portable IP ranges""" -from baseCmd import * -from baseResponse import * -class listPortableIpRangesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Id of the portable ip range""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """Id of a Region""" - self.regionid = None - self.required = [] - -class listPortableIpRangesResponse (baseResponse): - def __init__(self): - """portable IP range ID""" - self.id = None - """the end ip of the portable IP range""" - self.endip = None - """the gateway of the VLAN IP range""" - self.gateway = None - """the netmask of the VLAN IP range""" - self.netmask = None - """Region Id in which portable ip range is provisioned""" - self.regionid = None - """the start ip of the portable IP range""" - self.startip = None - """the ID or VID of the VLAN.""" - self.vlan = None - """List of portable IP and association with zone/network/vpc details that are part of GSLB rule""" - self.portableipaddress = [] - -class portableipaddress: - def __init__(self): - """"the account ID the portable IP address is associated with""" - self.accountid = None - """"date the portal IP address was acquired""" - self.allocated = None - """"the domain ID the portable IP address is associated with""" - self.domainid = None - """"public IP address""" - self.ipaddress = None - """"the ID of the Network where ip belongs to""" - self.networkid = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"Region Id in which global load balancer is created""" - self.regionid = None - """"State of the ip address. Can be: Allocatin, Allocated and Releasing""" - self.state = None - """"VPC the ip belongs to""" - self.vpcid = None - """"the ID of the zone the public IP address belongs to""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPrivateGateways.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPrivateGateways.py deleted file mode 100644 index 86695f2ab76..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listPrivateGateways.py +++ /dev/null @@ -1,89 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List private gateways""" -from baseCmd import * -from baseResponse import * -class listPrivateGatewaysCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list private gateway by id""" - self.id = None - """list gateways by ip address""" - self.ipaddress = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """list gateways by state""" - self.state = None - """list gateways by vlan""" - self.vlan = None - """list gateways by vpc""" - self.vpcid = None - self.required = [] - -class listPrivateGatewaysResponse (baseResponse): - def __init__(self): - """the id of the private gateway""" - self.id = None - """the account associated with the private gateway""" - self.account = None - """ACL Id set for private gateway""" - self.aclid = None - """the domain associated with the private gateway""" - self.domain = None - """the ID of the domain associated with the private gateway""" - self.domainid = None - """the gateway""" - self.gateway = None - """the private gateway's ip address""" - self.ipaddress = None - """the private gateway's netmask""" - self.netmask = None - """the physical network id""" - self.physicalnetworkid = None - """the project name of the private gateway""" - self.project = None - """the project id of the private gateway""" - self.projectid = None - """Souce Nat enable status""" - self.sourcenatsupported = None - """State of the gateway, can be Creating, Ready, Deleting""" - self.state = None - """the network implementation uri for the private gateway""" - self.vlan = None - """VPC the private gateaway belongs to""" - self.vpcid = None - """zone id of the private gateway""" - self.zoneid = None - """the name of the zone the private gateway belongs to""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectAccounts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectAccounts.py deleted file mode 100644 index 2b085c3bbed..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectAccounts.py +++ /dev/null @@ -1,151 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists project's accounts""" -from baseCmd import * -from baseResponse import * -class listProjectAccountsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """id of the project""" - """Required""" - self.projectid = None - """list accounts of the project by account name""" - self.account = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """list accounts of the project by role""" - self.role = None - self.required = ["projectid",] - -class listProjectAccountsResponse (baseResponse): - def __init__(self): - """the id of the project""" - self.id = None - """the account name of the project's owner""" - self.account = None - """the total number of cpu cores available to be created for this project""" - self.cpuavailable = None - """the total number of cpu cores the project can own""" - self.cpulimit = None - """the total number of cpu cores owned by project""" - self.cputotal = None - """the displaytext of the project""" - self.displaytext = None - """the domain name where the project belongs to""" - self.domain = None - """the domain id the project belongs to""" - self.domainid = None - """the total number of public ip addresses available for this project to acquire""" - self.ipavailable = None - """the total number of public ip addresses this project can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this project""" - self.iptotal = None - """the total memory (in MB) available to be created for this project""" - self.memoryavailable = None - """the total memory (in MB) the project can own""" - self.memorylimit = None - """the total memory (in MB) owned by project""" - self.memorytotal = None - """the name of the project""" - self.name = None - """the total number of networks available to be created for this project""" - self.networkavailable = None - """the total number of networks the project can own""" - self.networklimit = None - """the total number of networks owned by project""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this project""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the project can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by project""" - self.primarystoragetotal = None - """the total secondary storage space (in GiB) available to be used for this project""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the project can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by project""" - self.secondarystoragetotal = None - """the total number of snapshots available for this project""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this project""" - self.snapshotlimit = None - """the total number of snapshots stored by this project""" - self.snapshottotal = None - """the state of the project""" - self.state = None - """the total number of templates available to be created by this project""" - self.templateavailable = None - """the total number of templates which can be created by this project""" - self.templatelimit = None - """the total number of templates which have been created by this project""" - self.templatetotal = None - """the total number of virtual machines available for this project to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this project""" - self.vmlimit = None - """the total number of virtual machines running for this project""" - self.vmrunning = None - """the total number of virtual machines stopped for this project""" - self.vmstopped = None - """the total number of virtual machines deployed by this project""" - self.vmtotal = None - """the total volume available for this project""" - self.volumeavailable = None - """the total volume which can be used by this project""" - self.volumelimit = None - """the total volume being used by this project""" - self.volumetotal = None - """the total number of vpcs available to be created for this project""" - self.vpcavailable = None - """the total number of vpcs the project can own""" - self.vpclimit = None - """the total number of vpcs owned by project""" - self.vpctotal = None - """the list of resource tags associated with vm""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectInvitations.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectInvitations.py deleted file mode 100644 index a5ef32b0d35..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjectInvitations.py +++ /dev/null @@ -1,67 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists projects and provides detailed information for listed projects""" -from baseCmd import * -from baseResponse import * -class listProjectInvitationsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """if true, list only active invitations - having Pending state and ones that are not timed out yet""" - self.activeonly = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list invitations by id""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list by project id""" - self.projectid = None - """list invitations by state""" - self.state = None - self.required = [] - -class listProjectInvitationsResponse (baseResponse): - def __init__(self): - """the id of the invitation""" - self.id = None - """the account name of the project's owner""" - self.account = None - """the domain name where the project belongs to""" - self.domain = None - """the domain id the project belongs to""" - self.domainid = None - """the email the invitation was sent to""" - self.email = None - """the name of the project""" - self.project = None - """the id of the project""" - self.projectid = None - """the invitation state""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjects.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listProjects.py deleted file mode 100644 index a60d3553abe..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listProjects.py +++ /dev/null @@ -1,162 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists projects and provides detailed information for listed projects""" -from baseCmd import * -from baseResponse import * -class listProjectsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list projects by display text""" - self.displaytext = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list projects by project ID""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """list projects by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list projects by state""" - self.state = None - """List projects by tags (key/value pairs)""" - self.tags = [] - self.required = [] - -class listProjectsResponse (baseResponse): - def __init__(self): - """the id of the project""" - self.id = None - """the account name of the project's owner""" - self.account = None - """the total number of cpu cores available to be created for this project""" - self.cpuavailable = None - """the total number of cpu cores the project can own""" - self.cpulimit = None - """the total number of cpu cores owned by project""" - self.cputotal = None - """the displaytext of the project""" - self.displaytext = None - """the domain name where the project belongs to""" - self.domain = None - """the domain id the project belongs to""" - self.domainid = None - """the total number of public ip addresses available for this project to acquire""" - self.ipavailable = None - """the total number of public ip addresses this project can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this project""" - self.iptotal = None - """the total memory (in MB) available to be created for this project""" - self.memoryavailable = None - """the total memory (in MB) the project can own""" - self.memorylimit = None - """the total memory (in MB) owned by project""" - self.memorytotal = None - """the name of the project""" - self.name = None - """the total number of networks available to be created for this project""" - self.networkavailable = None - """the total number of networks the project can own""" - self.networklimit = None - """the total number of networks owned by project""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this project""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the project can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by project""" - self.primarystoragetotal = None - """the total secondary storage space (in GiB) available to be used for this project""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the project can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by project""" - self.secondarystoragetotal = None - """the total number of snapshots available for this project""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this project""" - self.snapshotlimit = None - """the total number of snapshots stored by this project""" - self.snapshottotal = None - """the state of the project""" - self.state = None - """the total number of templates available to be created by this project""" - self.templateavailable = None - """the total number of templates which can be created by this project""" - self.templatelimit = None - """the total number of templates which have been created by this project""" - self.templatetotal = None - """the total number of virtual machines available for this project to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this project""" - self.vmlimit = None - """the total number of virtual machines running for this project""" - self.vmrunning = None - """the total number of virtual machines stopped for this project""" - self.vmstopped = None - """the total number of virtual machines deployed by this project""" - self.vmtotal = None - """the total volume available for this project""" - self.volumeavailable = None - """the total volume which can be used by this project""" - self.volumelimit = None - """the total volume being used by this project""" - self.volumetotal = None - """the total number of vpcs available to be created for this project""" - self.vpcavailable = None - """the total number of vpcs the project can own""" - self.vpclimit = None - """the total number of vpcs owned by project""" - self.vpctotal = None - """the list of resource tags associated with vm""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listPublicIpAddresses.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listPublicIpAddresses.py deleted file mode 100644 index 79913f82963..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listPublicIpAddresses.py +++ /dev/null @@ -1,156 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all public ip addresses""" -from baseCmd import * -from baseResponse import * -class listPublicIpAddressesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """limits search results to allocated public IP addresses""" - self.allocatedonly = None - """lists all public IP addresses associated to the network specified""" - self.associatednetworkid = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list only ips used for load balancing""" - self.forloadbalancing = None - """the virtual network for the IP address""" - self.forvirtualnetwork = None - """lists ip address by id""" - self.id = None - """lists the specified IP address""" - self.ipaddress = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """list only source nat ip addresses""" - self.issourcenat = None - """list only static nat ip addresses""" - self.isstaticnat = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """lists all public IP addresses by physical network id""" - self.physicalnetworkid = None - """list objects by project""" - self.projectid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """lists all public IP addresses by VLAN ID""" - self.vlanid = None - """List ips belonging to the VPC""" - self.vpcid = None - """lists all public IP addresses by Zone ID""" - self.zoneid = None - self.required = [] - -class listPublicIpAddressesResponse (baseResponse): - def __init__(self): - """public IP address id""" - self.id = None - """the account the public IP address is associated with""" - self.account = None - """date the public IP address was acquired""" - self.allocated = None - """the ID of the Network associated with the IP address""" - self.associatednetworkid = None - """the name of the Network associated with the IP address""" - self.associatednetworkname = None - """the domain the public IP address is associated with""" - self.domain = None - """the domain ID the public IP address is associated with""" - self.domainid = None - """the virtual network for the IP address""" - self.forvirtualnetwork = None - """public IP address""" - self.ipaddress = None - """is public IP portable across the zones""" - self.isportable = None - """true if the IP address is a source nat address, false otherwise""" - self.issourcenat = None - """true if this ip is for static nat, false otherwise""" - self.isstaticnat = None - """true if this ip is system ip (was allocated as a part of deployVm or createLbRule)""" - self.issystem = None - """the ID of the Network where ip belongs to""" - self.networkid = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value""" - self.purpose = None - """State of the ip address. Can be: Allocatin, Allocated and Releasing""" - self.state = None - """virutal machine display name the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachinedisplayname = None - """virutal machine id the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachineid = None - """virutal machine name the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachinename = None - """the ID of the VLAN associated with the IP address. This parameter is visible to ROOT admins only""" - self.vlanid = None - """the VLAN associated with the IP address""" - self.vlanname = None - """virutal machine (dnat) ip address (not null only for static nat Ip)""" - self.vmipaddress = None - """VPC the ip belongs to""" - self.vpcid = None - """the ID of the zone the public IP address belongs to""" - self.zoneid = None - """the name of the zone the public IP address belongs to""" - self.zonename = None - """the list of resource tags associated with ip address""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listRegions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listRegions.py deleted file mode 100644 index 85499456154..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listRegions.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. - - -"""Lists Regions""" -from baseCmd import * -from baseResponse import * -class listRegionsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List Region by region ID.""" - self.id = None - """List by keyword""" - self.keyword = None - """List Region by region name.""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listRegionsResponse (baseResponse): - def __init__(self): - """the ID of the region""" - self.id = None - """the end point of the region""" - self.endpoint = None - """true if GSLB service is enabled in the region, false otherwise""" - self.gslbserviceenabled = None - """the name of the region""" - self.name = None - """true if security groups support is enabled, false otherwise""" - self.portableipserviceenabled = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listRemoteAccessVpns.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listRemoteAccessVpns.py deleted file mode 100644 index dfedf4add18..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listRemoteAccessVpns.py +++ /dev/null @@ -1,70 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists remote access vpns""" -from baseCmd import * -from baseResponse import * -class listRemoteAccessVpnsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """public ip address id of the vpn server""" - """Required""" - self.publicipid = None - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - self.required = ["publicipid",] - -class listRemoteAccessVpnsResponse (baseResponse): - def __init__(self): - """the id of the remote access vpn""" - self.id = None - """the account of the remote access vpn""" - self.account = None - """the domain name of the account of the remote access vpn""" - self.domain = None - """the domain id of the account of the remote access vpn""" - self.domainid = None - """the range of ips to allocate to the clients""" - self.iprange = None - """the ipsec preshared key""" - self.presharedkey = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the public ip address of the vpn server""" - self.publicip = None - """the public ip address of the vpn server""" - self.publicipid = None - """the state of the rule""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceDetails.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceDetails.py deleted file mode 100644 index 133e4897650..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceDetails.py +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List resource detail(s)""" -from baseCmd import * -from baseResponse import * -class listResourceDetailsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """list by key""" - self.key = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """list by resource id""" - self.resourceid = None - """list by resource type""" - self.resourcetype = None - self.required = [] - -class listResourceDetailsResponse (baseResponse): - def __init__(self): - """the account associated with the tag""" - self.account = None - """customer associated with the tag""" - self.customer = None - """the domain associated with the tag""" - self.domain = None - """the ID of the domain associated with the tag""" - self.domainid = None - """tag key name""" - self.key = None - """the project name where tag belongs to""" - self.project = None - """the project id the tag belongs to""" - self.projectid = None - """id of the resource""" - self.resourceid = None - """resource type""" - self.resourcetype = None - """tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceLimits.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceLimits.py deleted file mode 100644 index d608f3448d5..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listResourceLimits.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. - - -"""Lists resource limits.""" -from baseCmd import * -from baseResponse import * -class listResourceLimitsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """Lists resource limits by ID.""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """Type of resource to update. Values are 0, 1, 2, 3, and 4.0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses an account can own. 2 - Volume. Number of disk volumes an account can own.3 - Snapshot. Number of snapshots an account can own.4 - Template. Number of templates an account can register/create.5 - Project. Number of projects an account can own.6 - Network. Number of networks an account can own.7 - VPC. Number of VPC an account can own.8 - CPU. Number of CPU an account can allocate for his resources.9 - Memory. Amount of RAM an account can allocate for his resources.10 - Primary Storage. Amount of Primary storage an account can allocate for his resoruces.11 - Secondary Storage. Amount of Secondary storage an account can allocate for his resources.""" - self.resourcetype = None - self.required = [] - -class listResourceLimitsResponse (baseResponse): - def __init__(self): - """the account of the resource limit""" - self.account = None - """the domain name of the resource limit""" - self.domain = None - """the domain ID of the resource limit""" - self.domainid = None - """the maximum number of the resource. A -1 means the resource currently has no limit.""" - self.max = None - """the project name of the resource limit""" - self.project = None - """the project id of the resource limit""" - self.projectid = None - """resource type. Values include 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11. See the resourceType parameter for more information on these values.""" - self.resourcetype = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listRouters.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listRouters.py deleted file mode 100644 index a640aaef458..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listRouters.py +++ /dev/null @@ -1,182 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List routers.""" -from baseCmd import * -from baseResponse import * -class listRoutersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """if true is passed for this parameter, list only VPC routers""" - self.forvpc = None - """the host ID of the router""" - self.hostid = None - """the ID of the disk router""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """the name of the router""" - self.name = None - """list by network id""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """the Pod ID of the router""" - self.podid = None - """list objects by project""" - self.projectid = None - """the state of the router""" - self.state = None - """List networks by VPC""" - self.vpcid = None - """the Zone ID of the router""" - self.zoneid = None - self.required = [] - -class listRoutersResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listS3s.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listS3s.py deleted file mode 100644 index 602411e431c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listS3s.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. - - -"""Lists S3s""" -from baseCmd import * -from baseResponse import * -class listS3sCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listS3sResponse (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSSHKeyPairs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSSHKeyPairs.py deleted file mode 100644 index 8f38bec00a8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listSSHKeyPairs.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List registered keypairs""" -from baseCmd import * -from baseResponse import * -class listSSHKeyPairsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """A public key fingerprint to look for""" - self.fingerprint = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """A key pair name to look for""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - self.required = [] - -class listSSHKeyPairsResponse (baseResponse): - def __init__(self): - """Fingerprint of the public key""" - self.fingerprint = None - """Name of the keypair""" - self.name = None - """Private key""" - self.privatekey = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSecondaryStagingStores.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSecondaryStagingStores.py deleted file mode 100644 index 0fa06962f27..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listSecondaryStagingStores.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. - - -"""Lists secondary staging stores.""" -from baseCmd import * -from baseResponse import * -class listSecondaryStagingStoresCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the staging store""" - self.id = None - """List by keyword""" - self.keyword = None - """the name of the staging store""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the staging store protocol""" - self.protocol = None - """the staging store provider""" - self.provider = None - """the Zone ID for the staging store""" - self.zoneid = None - self.required = [] - -class listSecondaryStagingStoresResponse (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSecurityGroups.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSecurityGroups.py deleted file mode 100644 index d3cf2cd4845..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listSecurityGroups.py +++ /dev/null @@ -1,144 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists security groups""" -from baseCmd import * -from baseResponse import * -class listSecurityGroupsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list the security group by the id provided""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """lists security groups by name""" - self.securitygroupname = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """lists security groups by virtual machine id""" - self.virtualmachineid = None - self.required = [] - -class listSecurityGroupsResponse (baseResponse): - def __init__(self): - """the ID of the security group""" - self.id = None - """the account owning the security group""" - self.account = None - """the description of the security group""" - self.description = None - """the domain name of the security group""" - self.domain = None - """the domain ID of the security group""" - self.domainid = None - """the name of the security group""" - self.name = None - """the project name of the group""" - self.project = None - """the project id of the group""" - self.projectid = None - """the list of egress rules associated with the security group""" - self.egressrule = [] - """the list of ingress rules associated with the security group""" - self.ingressrule = [] - """the list of resource tags associated with the rule""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listServiceOfferings.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listServiceOfferings.py deleted file mode 100644 index 17580c028aa..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listServiceOfferings.py +++ /dev/null @@ -1,124 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all available service offerings.""" -from baseCmd import * -from baseResponse import * -class listServiceOfferingsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the domain associated with the service offering""" - self.domainid = None - """ID of the service offering""" - self.id = None - """is this a system vm offering""" - self.issystem = None - """List by keyword""" - self.keyword = None - """name of the service offering""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """List service offerings by resource tags (key/value pairs)""" - self.resourcetags = [] - """the system VM type. Possible types are "consoleproxy", "secondarystoragevm" or "domainrouter".""" - self.systemvmtype = None - """the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to.""" - self.virtualmachineid = None - self.required = [] - -class listServiceOfferingsResponse (baseResponse): - def __init__(self): - """the id of the service offering""" - self.id = None - """the number of CPU""" - self.cpunumber = None - """the clock rate CPU speed in Mhz""" - self.cpuspeed = None - """the date this service offering was created""" - self.created = None - """is this a default system vm offering""" - self.defaultuse = None - """deployment strategy used to deploy VM.""" - self.deploymentplanner = None - """bytes read rate of the service offering""" - self.diskBytesReadRate = None - """bytes write rate of the service offering""" - self.diskBytesWriteRate = None - """io requests read rate of the service offering""" - self.diskIopsReadRate = None - """io requests write rate of the service offering""" - self.diskIopsWriteRate = None - """an alternate display text of the service offering.""" - self.displaytext = None - """Domain name for the offering""" - self.domain = None - """the domain id of the service offering""" - self.domainid = None - """the host tag for the service offering""" - self.hosttags = None - """is this a system vm offering""" - self.issystem = None - """true if the vm needs to be volatile, i.e., on every reboot of vm from API root disk is discarded and creates a new root disk""" - self.isvolatile = None - """restrict the CPU usage to committed service offering""" - self.limitcpuuse = None - """the memory in MB""" - self.memory = None - """the name of the service offering""" - self.name = None - """data transfer rate in megabits per second allowed.""" - self.networkrate = None - """the ha support in the service offering""" - self.offerha = None - """additional key/value details tied with this service offering""" - self.serviceofferingdetails = None - """the storage type for this service offering""" - self.storagetype = None - """is this a the systemvm type for system vm offering""" - self.systemvmtype = None - """the tags for the service offering""" - self.tags = None - """the list of resource tags associated with service offering. The resource tags are not used for Volume/VM placement on the specific host.""" - self.resourcetags = [] - -class resourcetags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshotPolicies.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshotPolicies.py deleted file mode 100644 index 7c8ef7941bb..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshotPolicies.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. - - -"""Lists snapshot policies.""" -from baseCmd import * -from baseResponse import * -class listSnapshotPoliciesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the disk volume""" - """Required""" - self.volumeid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["volumeid",] - -class listSnapshotPoliciesResponse (baseResponse): - def __init__(self): - """the ID of the snapshot policy""" - self.id = None - """the interval type of the snapshot policy""" - self.intervaltype = None - """maximum number of snapshots retained""" - self.maxsnaps = None - """time the snapshot is scheduled to be taken.""" - self.schedule = None - """the time zone of the snapshot policy""" - self.timezone = None - """the ID of the disk volume""" - self.volumeid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshots.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshots.py deleted file mode 100644 index 79213eabd06..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listSnapshots.py +++ /dev/null @@ -1,118 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all available snapshots for the account.""" -from baseCmd import * -from baseResponse import * -class listSnapshotsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """lists snapshot by snapshot ID""" - self.id = None - """valid values are HOURLY, DAILY, WEEKLY, and MONTHLY.""" - self.intervaltype = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """lists snapshot by snapshot name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """valid values are MANUAL or RECURRING.""" - self.snapshottype = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """the ID of the disk volume""" - self.volumeid = None - """list snapshots by zone id""" - self.zoneid = None - self.required = [] - -class listSnapshotsResponse (baseResponse): - def __init__(self): - """ID of the snapshot""" - self.id = None - """the account associated with the snapshot""" - self.account = None - """the date the snapshot was created""" - self.created = None - """the domain name of the snapshot's account""" - self.domain = None - """the domain ID of the snapshot's account""" - self.domainid = None - """valid types are hourly, daily, weekly, monthy, template, and none.""" - self.intervaltype = None - """name of the snapshot""" - self.name = None - """the project name of the snapshot""" - self.project = None - """the project id of the snapshot""" - self.projectid = None - """the type of the snapshot""" - self.snapshottype = None - """the state of the snapshot. BackedUp means that snapshot is ready to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp - the snapshot is being backed up on secondary storage""" - self.state = None - """ID of the disk volume""" - self.volumeid = None - """name of the disk volume""" - self.volumename = None - """type of the disk volume""" - self.volumetype = None - """id of the availability zone""" - self.zoneid = None - """the list of resource tags associated with snapshot""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listStaticRoutes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listStaticRoutes.py deleted file mode 100644 index f965e111575..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listStaticRoutes.py +++ /dev/null @@ -1,98 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all static routes""" -from baseCmd import * -from baseResponse import * -class listStaticRoutesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list static routes by gateway id""" - self.gatewayid = None - """list static route by id""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """list static routes by vpc id""" - self.vpcid = None - self.required = [] - -class listStaticRoutesResponse (baseResponse): - def __init__(self): - """the ID of static route""" - self.id = None - """the account associated with the static route""" - self.account = None - """static route CIDR""" - self.cidr = None - """the domain associated with the static route""" - self.domain = None - """the ID of the domain associated with the static route""" - self.domainid = None - """VPC gateway the route is created for""" - self.gatewayid = None - """the project name of the static route""" - self.project = None - """the project id of the static route""" - self.projectid = None - """the state of the static route""" - self.state = None - """VPC the static route belongs to""" - self.vpcid = None - """the list of resource tags associated with static route""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageNetworkIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageNetworkIpRange.py deleted file mode 100644 index 83807c4b9f9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageNetworkIpRange.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. - - -"""List a storage network IP range.""" -from baseCmd import * -from baseResponse import * -class listStorageNetworkIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """optional parameter. Storaget network IP range uuid, if specicied, using it to search the range.""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """optional parameter. Pod uuid, if specicied and range uuid is absent, using it to search the range.""" - self.podid = None - """optional parameter. Zone uuid, if specicied and both pod uuid and range uuid are absent, using it to search the range.""" - self.zoneid = None - self.required = [] - -class listStorageNetworkIpRangeResponse (baseResponse): - def __init__(self): - """the uuid of storage network IP range.""" - self.id = None - """the end ip of the storage network IP range""" - self.endip = None - """the gateway of the storage network IP range""" - self.gateway = None - """the netmask of the storage network IP range""" - self.netmask = None - """the network uuid of storage network IP range""" - self.networkid = None - """the Pod uuid for the storage network IP range""" - self.podid = None - """the start ip of the storage network IP range""" - self.startip = None - """the ID or VID of the VLAN.""" - self.vlan = None - """the Zone uuid of the storage network IP range""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listStoragePools.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listStoragePools.py deleted file mode 100644 index 7f211a68654..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listStoragePools.py +++ /dev/null @@ -1,97 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists storage pools.""" -from baseCmd import * -from baseResponse import * -class listStoragePoolsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list storage pools belongig to the specific cluster""" - self.clusterid = None - """the ID of the storage pool""" - self.id = None - """the IP address for the storage pool""" - self.ipaddress = None - """List by keyword""" - self.keyword = None - """the name of the storage pool""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the storage pool path""" - self.path = None - """the Pod ID for the storage pool""" - self.podid = None - """the ID of the storage pool""" - self.scope = None - """the Zone ID for the storage pool""" - self.zoneid = None - self.required = [] - -class listStoragePoolsResponse (baseResponse): - def __init__(self): - """the ID of the storage pool""" - self.id = None - """IOPS CloudStack can provision from this storage pool""" - self.capacityiops = None - """the ID of the cluster for the storage pool""" - self.clusterid = None - """the name of the cluster for the storage pool""" - self.clustername = None - """the date and time the storage pool was created""" - self.created = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the storage pool""" - self.disksizetotal = None - """the host's currently used disk size""" - self.disksizeused = None - """the hypervisor type of the storage pool""" - self.hypervisor = None - """the IP address of the storage pool""" - self.ipaddress = None - """the name of the storage pool""" - self.name = None - """the storage pool path""" - self.path = None - """the Pod ID of the storage pool""" - self.podid = None - """the Pod name of the storage pool""" - self.podname = None - """the scope of the storage pool""" - self.scope = None - """the state of the storage pool""" - self.state = None - """true if this pool is suitable to migrate a volume, false otherwise""" - self.suitableformigration = None - """the tags for the storage pool""" - self.tags = None - """the storage pool type""" - self.type = None - """the Zone ID of the storage pool""" - self.zoneid = None - """the Zone name of the storage pool""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageProviders.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageProviders.py deleted file mode 100644 index 264496c901c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listStorageProviders.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. - - -"""Lists storage providers.""" -from baseCmd import * -from baseResponse import * -class listStorageProvidersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the type of storage provider: either primary or image""" - """Required""" - self.type = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["type",] - -class listStorageProvidersResponse (baseResponse): - def __init__(self): - """the name of the storage provider""" - self.name = None - """the type of the storage provider: primary or image provider""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSupportedNetworkServices.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSupportedNetworkServices.py deleted file mode 100644 index f9624d6fcc1..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listSupportedNetworkServices.py +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all network services provided by CloudStack or for the given Provider.""" -from baseCmd import * -from baseResponse import * -class listSupportedNetworkServicesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """network service provider name""" - self.provider = None - """network service name to list providers and capabilities of""" - self.service = None - self.required = [] - -class listSupportedNetworkServicesResponse (baseResponse): - def __init__(self): - """the service name""" - self.name = None - """the list of capabilities""" - self.capability = [] - """the service provider name""" - self.provider = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSwifts.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSwifts.py deleted file mode 100644 index b80ac788b30..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listSwifts.py +++ /dev/null @@ -1,55 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List Swift.""" -from baseCmd import * -from baseResponse import * -class listSwiftsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the id of the swift""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listSwiftsResponse (baseResponse): - def __init__(self): - """the ID of the image store""" - self.id = None - """the details of the image store""" - self.details = None - """the name of the image store""" - self.name = None - """the protocol of the image store""" - self.protocol = None - """the provider name of the image store""" - self.providername = None - """the scope of the image store""" - self.scope = None - """the url of the image store""" - self.url = None - """the Zone ID of the image store""" - self.zoneid = None - """the Zone name of the image store""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listSystemVms.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listSystemVms.py deleted file mode 100644 index 13e54ce329d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listSystemVms.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. - - -"""List system virtual machines.""" -from baseCmd import * -from baseResponse import * -class listSystemVmsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the host ID of the system VM""" - self.hostid = None - """the ID of the system VM""" - self.id = None - """List by keyword""" - self.keyword = None - """the name of the system VM""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the Pod ID of the system VM""" - self.podid = None - """the state of the system VM""" - self.state = None - """the storage ID where vm's volumes belong to""" - self.storageid = None - """the system VM type. Possible types are "consoleproxy" and "secondarystoragevm".""" - self.systemvmtype = None - """the Zone ID of the system VM""" - self.zoneid = None - self.required = [] - -class listSystemVmsResponse (baseResponse): - def __init__(self): - """the ID of the system VM""" - self.id = None - """the number of active console sessions for the console proxy system vm""" - self.activeviewersessions = None - """the date and time the system VM was created""" - self.created = None - """the first DNS for the system VM""" - self.dns1 = None - """the second DNS for the system VM""" - self.dns2 = None - """the gateway for the system VM""" - self.gateway = None - """the host ID for the system VM""" - self.hostid = None - """the hostname for the system VM""" - self.hostname = None - """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobid = None - """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobstatus = None - """the link local IP address for the system vm""" - self.linklocalip = None - """the link local MAC address for the system vm""" - self.linklocalmacaddress = None - """the link local netmask for the system vm""" - self.linklocalnetmask = None - """the name of the system VM""" - self.name = None - """the network domain for the system VM""" - self.networkdomain = None - """the Pod ID for the system VM""" - self.podid = None - """the private IP address for the system VM""" - self.privateip = None - """the private MAC address for the system VM""" - self.privatemacaddress = None - """the private netmask for the system VM""" - self.privatenetmask = None - """the public IP address for the system VM""" - self.publicip = None - """the public MAC address for the system VM""" - self.publicmacaddress = None - """the public netmask for the system VM""" - self.publicnetmask = None - """the state of the system VM""" - self.state = None - """the system VM type""" - self.systemvmtype = None - """the template ID for the system VM""" - self.templateid = None - """the Zone ID for the system VM""" - self.zoneid = None - """the Zone name for the system VM""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTags.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTags.py deleted file mode 100644 index 805a1f19b2c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listTags.py +++ /dev/null @@ -1,75 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List resource tag(s)""" -from baseCmd import * -from baseResponse import * -class listTagsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list by customer name""" - self.customer = None - """list only resources belonging to the domain specified""" - self.domainid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """list by key""" - self.key = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """list by resource id""" - self.resourceid = None - """list by resource type""" - self.resourcetype = None - """list by value""" - self.value = None - self.required = [] - -class listTagsResponse (baseResponse): - def __init__(self): - """the account associated with the tag""" - self.account = None - """customer associated with the tag""" - self.customer = None - """the domain associated with the tag""" - self.domain = None - """the ID of the domain associated with the tag""" - self.domainid = None - """tag key name""" - self.key = None - """the project name where tag belongs to""" - self.project = None - """the project id the tag belongs to""" - self.projectid = None - """id of the resource""" - self.resourceid = None - """resource type""" - self.resourcetype = None - """tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplatePermissions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplatePermissions.py deleted file mode 100644 index 9ce101ecc01..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplatePermissions.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. - - -"""List template visibility and all accounts that have permissions to view this template.""" -from baseCmd import * -from baseResponse import * -class listTemplatePermissionsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the template ID""" - """Required""" - self.id = None - self.required = ["id",] - -class listTemplatePermissionsResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the list of accounts the template is available for""" - self.account = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """the list of projects the template is available for""" - self.projectids = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplates.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplates.py deleted file mode 100644 index 1e02b7af44b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listTemplates.py +++ /dev/null @@ -1,157 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List all public, private, and privileged templates.""" -from baseCmd import * -from baseResponse import * -class listTemplatesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """possible values are "featured", "self", "selfexecutable","sharedexecutable","executable", and "community". * featured : templates that have been marked as featured and public. * self : templates that have been registered or created by the calling user. * selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. * sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. * executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. * community : templates that have been marked as public but not featured. * all : all templates (only usable by admins).""" - """Required""" - self.templatefilter = None - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """the hypervisor for which to restrict the search""" - self.hypervisor = None - """the template ID""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """the template name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """list templates by zoneId""" - self.zoneid = None - self.required = ["templatefilter",] - -class listTemplatesResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficMonitors.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficMonitors.py deleted file mode 100644 index 6d94e2fe958..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficMonitors.py +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List traffic monitor Hosts.""" -from baseCmd import * -from baseResponse import * -class listTrafficMonitorsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """zone Id""" - """Required""" - self.zoneid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["zoneid",] - -class listTrafficMonitorsResponse (baseResponse): - def __init__(self): - """the ID of the external firewall""" - self.id = None - """the management IP address of the external firewall""" - self.ipaddress = None - """the number of times to retry requests to the external firewall""" - self.numretries = None - """the timeout (in seconds) for requests to the external firewall""" - self.timeout = None - """the zone ID of the external firewall""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypeImplementors.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypeImplementors.py deleted file mode 100644 index 282c3bcd803..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypeImplementors.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. - - -"""Lists implementors of implementor of a network traffic type or implementors of all network traffic types""" -from baseCmd import * -from baseResponse import * -class listTrafficTypeImplementorsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """Optional. The network traffic type, if specified, return its implementor. Otherwise, return all traffic types with their implementor""" - self.traffictype = None - self.required = [] - -class listTrafficTypeImplementorsResponse (baseResponse): - def __init__(self): - """network traffic type""" - self.traffictype = None - """implementor of network traffic type""" - self.traffictypeimplementor = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypes.py deleted file mode 100644 index 2fda712605f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listTrafficTypes.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. - - -"""Lists traffic types of a given physical network.""" -from baseCmd import * -from baseResponse import * -class listTrafficTypesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the Physical Network ID""" - """Required""" - self.physicalnetworkid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["physicalnetworkid",] - -class listTrafficTypesResponse (baseResponse): - def __init__(self): - """uuid of the network provider""" - self.id = None - """true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """the destination physical network""" - self.destinationphysicalnetworkid = None - """the provider name""" - self.name = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """services for this provider""" - self.servicelist = None - """state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsBlades.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsBlades.py deleted file mode 100644 index c5a3c091524..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsBlades.py +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List ucs blades""" -from baseCmd import * -from baseResponse import * -class listUcsBladesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """ucs manager id""" - """Required""" - self.ucsmanagerid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["ucsmanagerid",] - -class listUcsBladesResponse (baseResponse): - def __init__(self): - """ucs blade id""" - self.id = None - """ucs blade dn""" - self.bladedn = None - """cloudstack host id this blade associates to""" - self.hostid = None - """associated ucs profile dn""" - self.profiledn = None - """ucs manager id""" - self.ucsmanagerid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsManagers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsManagers.py deleted file mode 100644 index e18a61e6f6d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsManagers.py +++ /dev/null @@ -1,47 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List ucs manager""" -from baseCmd import * -from baseResponse import * -class listUcsManagersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the ucs manager""" - self.id = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """the zone id""" - self.zoneid = None - self.required = [] - -class listUcsManagersResponse (baseResponse): - def __init__(self): - """the ID of the ucs manager""" - self.id = None - """the name of ucs manager""" - self.name = None - """the url of ucs manager""" - self.url = None - """the zone ID of ucs manager""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsProfiles.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsProfiles.py deleted file mode 100644 index 249fc8eec5f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listUcsProfiles.py +++ /dev/null @@ -1,40 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List profile in ucs manager""" -from baseCmd import * -from baseResponse import * -class listUcsProfilesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the id for the ucs manager""" - """Required""" - self.ucsmanagerid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = ["ucsmanagerid",] - -class listUcsProfilesResponse (baseResponse): - def __init__(self): - """ucs profile dn""" - self.ucsdn = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageRecords.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageRecords.py deleted file mode 100644 index 83131a06e7e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageRecords.py +++ /dev/null @@ -1,101 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists usage records for accounts""" -from baseCmd import * -from baseResponse import * -class listUsageRecordsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """End date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-03.""" - """Required""" - self.enddate = None - """Start date range for usage record query. Use yyyy-MM-dd as the date format, e.g. startDate=2009-06-01.""" - """Required""" - self.startdate = None - """List usage records for the specified user.""" - self.account = None - """List usage records for the specified account""" - self.accountid = None - """List usage records for the specified domain.""" - self.domainid = None - """List by keyword""" - self.keyword = None - """""" - self.page = None - """""" - self.pagesize = None - """List usage records for specified project""" - self.projectid = None - """List usage records for the specified usage type""" - self.type = None - self.required = ["enddate","startdate",] - -class listUsageRecordsResponse (baseResponse): - def __init__(self): - """the user account name""" - self.account = None - """the user account Id""" - self.accountid = None - """description of the usage record""" - self.description = None - """the domain the resource is associated with""" - self.domain = None - """the domain ID""" - self.domainid = None - """end date of the usage record""" - self.enddate = None - """True if the resource is default""" - self.isdefault = None - """True if the IPAddress is source NAT""" - self.issourcenat = None - """True if the IPAddress is system IP - allocated during vm deploy or lb rule create""" - self.issystem = None - """virtual machine name""" - self.name = None - """id of the network""" - self.networkid = None - """offering ID""" - self.offeringid = None - """the project name of the resource""" - self.project = None - """the project id of the resource""" - self.projectid = None - """raw usage in hours""" - self.rawusage = None - """resource size""" - self.size = None - """start date of the usage record""" - self.startdate = None - """template ID""" - self.templateid = None - """resource type""" - self.type = None - """usage in hours""" - self.usage = None - """id of the resource""" - self.usageid = None - """usage type ID""" - self.usagetype = None - """virtual machine ID""" - self.virtualmachineid = None - """virtual size of resource""" - self.virtualsize = None - """the zone ID""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageTypes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageTypes.py deleted file mode 100644 index 787a41674fc..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsageTypes.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. - - -"""List Usage Types""" -from baseCmd import * -from baseResponse import * -class listUsageTypesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - self.required = [] - -class listUsageTypesResponse (baseResponse): - def __init__(self): - """description of usage type""" - self.description = None - """usage type""" - self.usagetypeid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listUsers.py deleted file mode 100644 index 88dce3bcb25..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listUsers.py +++ /dev/null @@ -1,85 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists user accounts""" -from baseCmd import * -from baseResponse import * -class listUsersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """List users by account type. Valid types include admin, domain-admin, read-only-admin, or user.""" - self.accounttype = None - """list only resources belonging to the domain specified""" - self.domainid = None - """List user by ID.""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """List users by state of the user account.""" - self.state = None - """List user by the username""" - self.username = None - self.required = [] - -class listUsersResponse (baseResponse): - def __init__(self): - """the user ID""" - self.id = None - """the account name of the user""" - self.account = None - """the account ID of the user""" - self.accountid = None - """the account type of the user""" - self.accounttype = None - """the api key of the user""" - self.apikey = None - """the date and time the user account was created""" - self.created = None - """the domain name of the user""" - self.domain = None - """the domain ID of the user""" - self.domainid = None - """the user email address""" - self.email = None - """the user firstname""" - self.firstname = None - """the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """true if user is default, false otherwise""" - self.isdefault = None - """the user lastname""" - self.lastname = None - """the secret key of the user""" - self.secretkey = None - """the user state""" - self.state = None - """the timezone user was created in""" - self.timezone = None - """the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVMSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVMSnapshot.py deleted file mode 100644 index 340580747fd..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVMSnapshot.py +++ /dev/null @@ -1,89 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List virtual machine snapshot by conditions""" -from baseCmd import * -from baseResponse import * -class listVMSnapshotCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """lists snapshot by snapshot name or display name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """state of the virtual machine snapshot""" - self.state = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """the ID of the vm""" - self.virtualmachineid = None - """The ID of the VM snapshot""" - self.vmsnapshotid = None - self.required = [] - -class listVMSnapshotResponse (baseResponse): - def __init__(self): - """the ID of the vm snapshot""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the create date of the vm snapshot""" - self.created = None - """indiates if this is current snapshot""" - self.current = None - """the description of the vm snapshot""" - self.description = None - """the display name of the vm snapshot""" - self.displayname = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """the name of the vm snapshot""" - self.name = None - """the parent ID of the vm snapshot""" - self.parent = None - """the parent displayName of the vm snapshot""" - self.parentName = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the state of the vm snapshot""" - self.state = None - """VM Snapshot type""" - self.type = None - """the vm ID of the vm snapshot""" - self.virtualmachineid = None - """the Zone ID of the vm snapshot""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCOfferings.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCOfferings.py deleted file mode 100644 index 0c707c1a5d9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCOfferings.py +++ /dev/null @@ -1,116 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists VPC offerings""" -from baseCmd import * -from baseResponse import * -class listVPCOfferingsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list VPC offerings by display text""" - self.displaytext = None - """list VPC offerings by id""" - self.id = None - """true if need to list only default VPC offerings. Default value is false""" - self.isdefault = None - """List by keyword""" - self.keyword = None - """list VPC offerings by name""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list VPC offerings by state""" - self.state = None - """list VPC offerings supporting certain services""" - self.supportedservices = [] - self.required = [] - -class listVPCOfferingsResponse (baseResponse): - def __init__(self): - """the id of the vpc offering""" - self.id = None - """the date this vpc offering was created""" - self.created = None - """an alternate display text of the vpc offering.""" - self.displaytext = None - """true if vpc offering is default, false otherwise""" - self.isdefault = None - """the name of the vpc offering""" - self.name = None - """state of the vpc offering. Can be Disabled/Enabled""" - self.state = None - """the list of supported services""" - self.service = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCs.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCs.py deleted file mode 100644 index 51a3b4cdb43..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVPCs.py +++ /dev/null @@ -1,426 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists VPCs""" -from baseCmd import * -from baseResponse import * -class listVPCsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list by cidr of the VPC. All VPC guest networks' cidrs should be within this CIDR""" - self.cidr = None - """List by display text of the VPC""" - self.displaytext = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list VPC by id""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """list by name of the VPC""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """list VPCs by restartRequired option""" - self.restartrequired = None - """list VPCs by state""" - self.state = None - """list VPC supporting certain services""" - self.supportedservices = [] - """List resources by tags (key/value pairs)""" - self.tags = [] - """list by ID of the VPC offering""" - self.vpcofferingid = None - """list by zone""" - self.zoneid = None - self.required = [] - -class listVPCsResponse (baseResponse): - def __init__(self): - """the id of the VPC""" - self.id = None - """the owner of the VPC""" - self.account = None - """the cidr the VPC""" - self.cidr = None - """the date this VPC was created""" - self.created = None - """an alternate display text of the VPC.""" - self.displaytext = None - """the domain name of the owner""" - self.domain = None - """the domain id of the VPC owner""" - self.domainid = None - """the name of the VPC""" - self.name = None - """the network domain of the VPC""" - self.networkdomain = None - """the project name of the VPC""" - self.project = None - """the project id of the VPC""" - self.projectid = None - """true VPC requires restart""" - self.restartrequired = None - """state of the VPC. Can be Inactive/Enabled""" - self.state = None - """vpc offering id the VPC is created from""" - self.vpcofferingid = None - """zone id of the vpc""" - self.zoneid = None - """the name of the zone the VPC belongs to""" - self.zonename = None - """the list of networks belongign to the VPC""" - self.network = [] - """the list of supported services""" - self.service = [] - """the list of resource tags associated with the project""" - self.tags = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class network: - def __init__(self): - """"the id of the network""" - self.id = None - """"the owner of the network""" - self.account = None - """"ACL Id associated with the VPC network""" - self.aclid = None - """"acl type - access type to the network""" - self.acltype = None - """"Broadcast domain type of the network""" - self.broadcastdomaintype = None - """"broadcast uri of the network. This parameter is visible to ROOT admins only""" - self.broadcasturi = None - """"list networks available for vm deployment""" - self.canusefordeploy = None - """"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" - self.cidr = None - """"an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """"the displaytext of the network""" - self.displaytext = None - """"the first DNS for the network""" - self.dns1 = None - """"the second DNS for the network""" - self.dns2 = None - """"the domain name of the network owner""" - self.domain = None - """"the domain id of the network owner""" - self.domainid = None - """"the network's gateway""" - self.gateway = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"true if network is default, false otherwise""" - self.isdefault = None - """"list networks that are persistent""" - self.ispersistent = None - """"true if network is system, false otherwise""" - self.issystem = None - """"the name of the network""" - self.name = None - """"the network's netmask""" - self.netmask = None - """"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" - self.networkcidr = None - """"the network domain""" - self.networkdomain = None - """"availability of the network offering the network is created from""" - self.networkofferingavailability = None - """"true if network offering is ip conserve mode enabled""" - self.networkofferingconservemode = None - """"display text of the network offering the network is created from""" - self.networkofferingdisplaytext = None - """"network offering id the network is created from""" - self.networkofferingid = None - """"name of the network offering the network is created from""" - self.networkofferingname = None - """"the physical network id""" - self.physicalnetworkid = None - """"the project name of the address""" - self.project = None - """"the project id of the ipaddress""" - self.projectid = None - """"related to what other network configuration""" - self.related = None - """"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" - self.reservediprange = None - """"true network requires restart""" - self.restartrequired = None - """"true if network supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """"state of the network""" - self.state = None - """"true if users from subdomains can access the domain level network""" - self.subdomainaccess = None - """"the traffic type of the network""" - self.traffictype = None - """"the type of the network""" - self.type = None - """"The vlan of the network. This parameter is visible to ROOT admins only""" - self.vlan = None - """"VPC the network belongs to""" - self.vpcid = None - """"zone id of the network""" - self.zoneid = None - """"the name of the zone the network belongs to""" - self.zonename = None - """"the list of services""" - self.service = [] - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - """"the list of resource tags associated with network""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualMachines.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualMachines.py deleted file mode 100644 index 525532c3a9f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualMachines.py +++ /dev/null @@ -1,416 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""List the virtual machines owned by the account.""" -from baseCmd import * -from baseResponse import * -class listVirtualMachinesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list vms by affinity group""" - self.affinitygroupid = None - """comma separated list of host details requested, value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min, affgrp]. If no parameter is passed in, the details will be defaulted to all""" - self.details = [] - """list only resources belonging to the domain specified""" - self.domainid = None - """list by network type; true if need to list vms using Virtual Network, false otherwise""" - self.forvirtualnetwork = None - """the group ID""" - self.groupid = None - """the host ID""" - self.hostid = None - """the target hypervisor for the template""" - self.hypervisor = None - """the ID of the virtual machine""" - self.id = None - """list vms by iso""" - self.isoid = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """name of the virtual machine""" - self.name = None - """list by network id""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """the pod ID""" - self.podid = None - """list objects by project""" - self.projectid = None - """state of the virtual machine""" - self.state = None - """the storage ID where vm's volumes belong to""" - self.storageid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """list vms by template""" - self.templateid = None - """list vms by vpc""" - self.vpcid = None - """the availability zone ID""" - self.zoneid = None - self.required = [] - -class listVirtualMachinesResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualRouterElements.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualRouterElements.py deleted file mode 100644 index abfe93a397a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVirtualRouterElements.py +++ /dev/null @@ -1,57 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all available virtual router elements.""" -from baseCmd import * -from baseResponse import * -class listVirtualRouterElementsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list network offerings by enabled state""" - self.enabled = None - """list virtual router elements by id""" - self.id = None - """List by keyword""" - self.keyword = None - """list virtual router elements by network service provider id""" - self.nspid = None - """""" - self.page = None - """""" - self.pagesize = None - self.required = [] - -class listVirtualRouterElementsResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the provider""" - self.account = None - """the domain associated with the provider""" - self.domain = None - """the domain ID associated with the provider""" - self.domainid = None - """Enabled/Disabled the service provider""" - self.enabled = None - """the physical network service provider id of the provider""" - self.nspid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVlanIpRanges.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVlanIpRanges.py deleted file mode 100644 index 2d7ac4a24a6..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVlanIpRanges.py +++ /dev/null @@ -1,99 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all VLAN IP ranges.""" -from baseCmd import * -from baseResponse import * -class listVlanIpRangesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the account with which the VLAN IP range is associated. Must be used with the domainId parameter.""" - self.account = None - """the domain ID with which the VLAN IP range is associated. If used with the account parameter, returns all VLAN IP ranges for that account in the specified domain.""" - self.domainid = None - """true if VLAN is of Virtual type, false if Direct""" - self.forvirtualnetwork = None - """the ID of the VLAN IP range""" - self.id = None - """List by keyword""" - self.keyword = None - """network id of the VLAN IP range""" - self.networkid = None - """""" - self.page = None - """""" - self.pagesize = None - """physical network id of the VLAN IP range""" - self.physicalnetworkid = None - """the Pod ID of the VLAN IP range""" - self.podid = None - """project who will own the VLAN""" - self.projectid = None - """the ID or VID of the VLAN. Default is an "untagged" VLAN.""" - self.vlan = None - """the Zone ID of the VLAN IP range""" - self.zoneid = None - self.required = [] - -class listVlanIpRangesResponse (baseResponse): - def __init__(self): - """the ID of the VLAN IP range""" - self.id = None - """the account of the VLAN IP range""" - self.account = None - """the description of the VLAN IP range""" - self.description = None - """the domain name of the VLAN IP range""" - self.domain = None - """the domain ID of the VLAN IP range""" - self.domainid = None - """the end ip of the VLAN IP range""" - self.endip = None - """the end ipv6 of the VLAN IP range""" - self.endipv6 = None - """the virtual network for the VLAN IP range""" - self.forvirtualnetwork = None - """the gateway of the VLAN IP range""" - self.gateway = None - """the cidr of IPv6 network""" - self.ip6cidr = None - """the gateway of IPv6 network""" - self.ip6gateway = None - """the netmask of the VLAN IP range""" - self.netmask = None - """the network id of vlan range""" - self.networkid = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """the Pod ID for the VLAN IP range""" - self.podid = None - """the Pod name for the VLAN IP range""" - self.podname = None - """the project name of the vlan range""" - self.project = None - """the project id of the vlan range""" - self.projectid = None - """the start ip of the VLAN IP range""" - self.startip = None - """the start ipv6 of the VLAN IP range""" - self.startipv6 = None - """the ID or VID of the VLAN.""" - self.vlan = None - """the Zone ID of the VLAN IP range""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVolumes.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVolumes.py deleted file mode 100644 index 39f514be531..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVolumes.py +++ /dev/null @@ -1,172 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists all volumes.""" -from baseCmd import * -from baseResponse import * -class listVolumesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """list volumes on specified host""" - self.hostid = None - """the ID of the disk volume""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """the name of the disk volume""" - self.name = None - """""" - self.page = None - """""" - self.pagesize = None - """the pod id the disk volume belongs to""" - self.podid = None - """list objects by project""" - self.projectid = None - """List resources by tags (key/value pairs)""" - self.tags = [] - """the type of disk volume""" - self.type = None - """the ID of the virtual machine""" - self.virtualmachineid = None - """the ID of the availability zone""" - self.zoneid = None - self.required = [] - -class listVolumesResponse (baseResponse): - def __init__(self): - """ID of the disk volume""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the date the volume was attached to a VM instance""" - self.attached = None - """the date the disk volume was created""" - self.created = None - """the boolean state of whether the volume is destroyed or not""" - self.destroyed = None - """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" - self.deviceid = None - """bytes read rate of the disk volume""" - self.diskBytesReadRate = None - """bytes write rate of the disk volume""" - self.diskBytesWriteRate = None - """io requests read rate of the disk volume""" - self.diskIopsReadRate = None - """io requests write rate of the disk volume""" - self.diskIopsWriteRate = None - """the display text of the disk offering""" - self.diskofferingdisplaytext = None - """ID of the disk offering""" - self.diskofferingid = None - """name of the disk offering""" - self.diskofferingname = None - """an optional field whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """Hypervisor the volume belongs to""" - self.hypervisor = None - """true if the volume is extractable, false otherwise""" - self.isextractable = None - """max iops of the disk volume""" - self.maxiops = None - """min iops of the disk volume""" - self.miniops = None - """name of the disk volume""" - self.name = None - """The path of the volume""" - self.path = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the display text of the service offering for root disk""" - self.serviceofferingdisplaytext = None - """ID of the service offering for root disk""" - self.serviceofferingid = None - """name of the service offering for root disk""" - self.serviceofferingname = None - """size of the disk volume""" - self.size = None - """ID of the snapshot from which this volume was created""" - self.snapshotid = None - """the state of the disk volume""" - self.state = None - """the status of the volume""" - self.status = None - """name of the primary storage hosting the disk volume""" - self.storage = None - """id of the primary storage hosting the disk volume; returned to admin user only""" - self.storageid = None - """shared or local storage""" - self.storagetype = None - """type of the disk volume (ROOT or DATADISK)""" - self.type = None - """id of the virtual machine""" - self.virtualmachineid = None - """display name of the virtual machine""" - self.vmdisplayname = None - """name of the virtual machine""" - self.vmname = None - """state of the virtual machine""" - self.vmstate = None - """ID of the availability zone""" - self.zoneid = None - """name of the availability zone""" - self.zonename = None - """the list of resource tags associated with volume""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnConnections.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnConnections.py deleted file mode 100644 index db94bca2940..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnConnections.py +++ /dev/null @@ -1,89 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists site to site vpn connection gateways""" -from baseCmd import * -from baseResponse import * -class listVpnConnectionsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """id of the vpn connection""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """id of vpc""" - self.vpcid = None - self.required = [] - -class listVpnConnectionsResponse (baseResponse): - def __init__(self): - """the vpn gateway ID""" - self.id = None - """the owner""" - self.account = None - """guest cidr list of the customer gateway""" - self.cidrlist = None - """the date and time the host was created""" - self.created = None - """the domain name of the owner""" - self.domain = None - """the domain id of the owner""" - self.domainid = None - """if DPD is enabled for customer gateway""" - self.dpd = None - """Lifetime of ESP SA of customer gateway""" - self.esplifetime = None - """ESP policy of the customer gateway""" - self.esppolicy = None - """public ip address id of the customer gateway""" - self.gateway = None - """Lifetime of IKE SA of customer gateway""" - self.ikelifetime = None - """IKE policy of the customer gateway""" - self.ikepolicy = None - """IPsec Preshared-Key of the customer gateway""" - self.ipsecpsk = None - """the project name""" - self.project = None - """the project id""" - self.projectid = None - """the public IP address""" - self.publicip = None - """the date and time the host was removed""" - self.removed = None - """the customer gateway ID""" - self.s2scustomergatewayid = None - """the vpn gateway ID""" - self.s2svpngatewayid = None - """State of vpn connection""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnCustomerGateways.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnCustomerGateways.py deleted file mode 100644 index c730db37559..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnCustomerGateways.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. - - -"""Lists site to site vpn customer gateways""" -from baseCmd import * -from baseResponse import * -class listVpnCustomerGatewaysCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """id of the customer gateway""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - self.required = [] - -class listVpnCustomerGatewaysResponse (baseResponse): - def __init__(self): - """the vpn gateway ID""" - self.id = None - """the owner""" - self.account = None - """guest cidr list of the customer gateway""" - self.cidrlist = None - """the domain name of the owner""" - self.domain = None - """the domain id of the owner""" - self.domainid = None - """if DPD is enabled for customer gateway""" - self.dpd = None - """Lifetime of ESP SA of customer gateway""" - self.esplifetime = None - """IPsec policy of customer gateway""" - self.esppolicy = None - """public ip address id of the customer gateway""" - self.gateway = None - """Lifetime of IKE SA of customer gateway""" - self.ikelifetime = None - """IKE policy of customer gateway""" - self.ikepolicy = None - """guest ip of the customer gateway""" - self.ipaddress = None - """IPsec preshared-key of customer gateway""" - self.ipsecpsk = None - """name of the customer gateway""" - self.name = None - """the project name""" - self.project = None - """the project id""" - self.projectid = None - """the date and time the host was removed""" - self.removed = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnGateways.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnGateways.py deleted file mode 100644 index 14fcb8f5730..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnGateways.py +++ /dev/null @@ -1,67 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists site 2 site vpn gateways""" -from baseCmd import * -from baseResponse import * -class listVpnGatewaysCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """id of the vpn gateway""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """id of vpc""" - self.vpcid = None - self.required = [] - -class listVpnGatewaysResponse (baseResponse): - def __init__(self): - """the vpn gateway ID""" - self.id = None - """the owner""" - self.account = None - """the domain name of the owner""" - self.domain = None - """the domain id of the owner""" - self.domainid = None - """the project name""" - self.project = None - """the project id""" - self.projectid = None - """the public IP address""" - self.publicip = None - """the date and time the host was removed""" - self.removed = None - """the vpc id of this gateway""" - self.vpcid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnUsers.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnUsers.py deleted file mode 100644 index 79ae68aea0d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listVpnUsers.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. - - -"""Lists vpn users""" -from baseCmd import * -from baseResponse import * -class listVpnUsersCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """list resources by account. Must be used with the domainId parameter.""" - self.account = None - """list only resources belonging to the domain specified""" - self.domainid = None - """The uuid of the Vpn user""" - self.id = None - """defaults to false, but if true, lists all resources from the parent specified by the domainId till leaves.""" - self.isrecursive = None - """List by keyword""" - self.keyword = None - """If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false""" - self.listall = None - """""" - self.page = None - """""" - self.pagesize = None - """list objects by project""" - self.projectid = None - """the username of the vpn user.""" - self.username = None - self.required = [] - -class listVpnUsersResponse (baseResponse): - def __init__(self): - """the vpn userID""" - self.id = None - """the account of the remote access vpn""" - self.account = None - """the domain name of the account of the remote access vpn""" - self.domain = None - """the domain id of the account of the remote access vpn""" - self.domainid = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the state of the Vpn User""" - self.state = None - """the username of the vpn user""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/listZones.py b/tools/marvin/build/lib/marvin/cloudstackAPI/listZones.py deleted file mode 100644 index 5e6ed5d6d23..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/listZones.py +++ /dev/null @@ -1,141 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Lists zones""" -from baseCmd import * -from baseResponse import * -class listZonesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """true if you want to retrieve all available Zones. False if you only want to return the Zones from which you have at least one VM. Default is false.""" - self.available = None - """the ID of the domain associated with the zone""" - self.domainid = None - """the ID of the zone""" - self.id = None - """List by keyword""" - self.keyword = None - """the name of the zone""" - self.name = None - """the network type of the zone that the virtual machine belongs to""" - self.networktype = None - """""" - self.page = None - """""" - self.pagesize = None - """flag to display the capacity of the zones""" - self.showcapacities = None - """List zones by resource tags (key/value pairs)""" - self.tags = [] - self.required = [] - -class listZonesResponse (baseResponse): - def __init__(self): - """Zone id""" - self.id = None - """the allocation state of the cluster""" - self.allocationstate = None - """Zone description""" - self.description = None - """the dhcp Provider for the Zone""" - self.dhcpprovider = None - """the display text of the zone""" - self.displaytext = None - """the first DNS for the Zone""" - self.dns1 = None - """the second DNS for the Zone""" - self.dns2 = None - """Network domain name for the networks in the zone""" - self.domain = None - """the UUID of the containing domain, null for public zones""" - self.domainid = None - """the name of the containing domain, null for public zones""" - self.domainname = None - """the guest CIDR address for the Zone""" - self.guestcidraddress = None - """the first internal DNS for the Zone""" - self.internaldns1 = None - """the second internal DNS for the Zone""" - self.internaldns2 = None - """the first IPv6 DNS for the Zone""" - self.ip6dns1 = None - """the second IPv6 DNS for the Zone""" - self.ip6dns2 = None - """true if local storage offering enabled, false otherwise""" - self.localstorageenabled = None - """Zone name""" - self.name = None - """the network type of the zone; can be Basic or Advanced""" - self.networktype = None - """true if security groups support is enabled, false otherwise""" - self.securitygroupsenabled = None - """the vlan range of the zone""" - self.vlan = None - """Zone Token""" - self.zonetoken = None - """the capacity of the Zone""" - self.capacity = [] - """the list of resource tags associated with zone.""" - self.tags = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/lockAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/lockAccount.py deleted file mode 100644 index d33f898550d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/lockAccount.py +++ /dev/null @@ -1,176 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Locks an account""" -from baseCmd import * -from baseResponse import * -class lockAccountCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Locks the specified account.""" - """Required""" - self.account = None - """Locks the specified account on this domain.""" - """Required""" - self.domainid = None - self.required = ["account","domainid",] - -class lockAccountResponse (baseResponse): - def __init__(self): - """the id of the account""" - self.id = None - """details for the account""" - self.accountdetails = None - """account type (admin, domain-admin, user)""" - self.accounttype = None - """the total number of cpu cores available to be created for this account""" - self.cpuavailable = None - """the total number of cpu cores the account can own""" - self.cpulimit = None - """the total number of cpu cores owned by account""" - self.cputotal = None - """the default zone of the account""" - self.defaultzoneid = None - """name of the Domain the account belongs too""" - self.domain = None - """id of the Domain the account belongs too""" - self.domainid = None - """the total number of public ip addresses available for this account to acquire""" - self.ipavailable = None - """the total number of public ip addresses this account can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this account""" - self.iptotal = None - """true if the account requires cleanup""" - self.iscleanuprequired = None - """true if account is default, false otherwise""" - self.isdefault = None - """the total memory (in MB) available to be created for this account""" - self.memoryavailable = None - """the total memory (in MB) the account can own""" - self.memorylimit = None - """the total memory (in MB) owned by account""" - self.memorytotal = None - """the name of the account""" - self.name = None - """the total number of networks available to be created for this account""" - self.networkavailable = None - """the network domain""" - self.networkdomain = None - """the total number of networks the account can own""" - self.networklimit = None - """the total number of networks owned by account""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this account""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the account can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by account""" - self.primarystoragetotal = None - """the total number of projects available for administration by this account""" - self.projectavailable = None - """the total number of projects the account can own""" - self.projectlimit = None - """the total number of projects being administrated by this account""" - self.projecttotal = None - """the total number of network traffic bytes received""" - self.receivedbytes = None - """the total secondary storage space (in GiB) available to be used for this account""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the account can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by account""" - self.secondarystoragetotal = None - """the total number of network traffic bytes sent""" - self.sentbytes = None - """the total number of snapshots available for this account""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this account""" - self.snapshotlimit = None - """the total number of snapshots stored by this account""" - self.snapshottotal = None - """the state of the account""" - self.state = None - """the total number of templates available to be created by this account""" - self.templateavailable = None - """the total number of templates which can be created by this account""" - self.templatelimit = None - """the total number of templates which have been created by this account""" - self.templatetotal = None - """the total number of virtual machines available for this account to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this account""" - self.vmlimit = None - """the total number of virtual machines running for this account""" - self.vmrunning = None - """the total number of virtual machines stopped for this account""" - self.vmstopped = None - """the total number of virtual machines deployed by this account""" - self.vmtotal = None - """the total volume available for this account""" - self.volumeavailable = None - """the total volume which can be used by this account""" - self.volumelimit = None - """the total volume being used by this account""" - self.volumetotal = None - """the total number of vpcs available to be created for this account""" - self.vpcavailable = None - """the total number of vpcs the account can own""" - self.vpclimit = None - """the total number of vpcs owned by account""" - self.vpctotal = None - """the list of users associated with account""" - self.user = [] - -class user: - def __init__(self): - """"the user ID""" - self.id = None - """"the account name of the user""" - self.account = None - """"the account ID of the user""" - self.accountid = None - """"the account type of the user""" - self.accounttype = None - """"the api key of the user""" - self.apikey = None - """"the date and time the user account was created""" - self.created = None - """"the domain name of the user""" - self.domain = None - """"the domain ID of the user""" - self.domainid = None - """"the user email address""" - self.email = None - """"the user firstname""" - self.firstname = None - """"the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """"true if user is default, false otherwise""" - self.isdefault = None - """"the user lastname""" - self.lastname = None - """"the secret key of the user""" - self.secretkey = None - """"the user state""" - self.state = None - """"the timezone user was created in""" - self.timezone = None - """"the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/lockUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/lockUser.py deleted file mode 100644 index 0372547ea82..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/lockUser.py +++ /dev/null @@ -1,66 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Locks a user account""" -from baseCmd import * -from baseResponse import * -class lockUserCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Locks user by user ID.""" - """Required""" - self.id = None - self.required = ["id",] - -class lockUserResponse (baseResponse): - def __init__(self): - """the user ID""" - self.id = None - """the account name of the user""" - self.account = None - """the account ID of the user""" - self.accountid = None - """the account type of the user""" - self.accounttype = None - """the api key of the user""" - self.apikey = None - """the date and time the user account was created""" - self.created = None - """the domain name of the user""" - self.domain = None - """the domain ID of the user""" - self.domainid = None - """the user email address""" - self.email = None - """the user firstname""" - self.firstname = None - """the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """true if user is default, false otherwise""" - self.isdefault = None - """the user lastname""" - self.lastname = None - """the secret key of the user""" - self.secretkey = None - """the user state""" - self.state = None - """the timezone user was created in""" - self.timezone = None - """the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/login.py b/tools/marvin/build/lib/marvin/cloudstackAPI/login.py deleted file mode 100644 index 003bd1143fe..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/login.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. - - -"""Logs a user into the CloudStack. A successful login attempt will generate a JSESSIONID cookie value that can be passed in subsequent Query command calls until the "logout" command has been issued or the session has expired.""" -from baseCmd import * -from baseResponse import * -class loginCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Username""" - """Required""" - self.username = None - """Hashed password (Default is MD5). If you wish to use any other hashing algorithm, you would need to write a custom authentication adapter See Docs section.""" - """Required""" - self.password = None - """path of the domain that the user belongs to. Example: domain=/com/cloud/internal. If no domain is passed in, the ROOT domain is assumed.""" - self.domain = None - """id of the domain that the user belongs to. If both domain and domainId are passed in, "domainId" parameter takes precendence""" - self.domainId = None - self.required = ["username","password",] - -class loginResponse (baseResponse): - def __init__(self): - """Username""" - self.username = None - """User id""" - self.userid = None - """Password""" - self.password = None - """domain ID that the user belongs to""" - self.domainid = None - """the time period before the session has expired""" - self.timeout = None - """the account name the user belongs to""" - self.account = None - """first name of the user""" - self.firstname = None - """last name of the user""" - self.lastname = None - """the account type (admin, domain-admin, read-only-admin, user)""" - self.type = None - """user time zone""" - self.timezone = None - """user time zone offset from UTC 00:00""" - self.timezoneoffset = None - """Session key that can be passed in subsequent Query command calls""" - self.sessionkey = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/logout.py b/tools/marvin/build/lib/marvin/cloudstackAPI/logout.py deleted file mode 100644 index 6bd43327fee..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/logout.py +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Logs out the user""" -from baseCmd import * -from baseResponse import * -class logoutCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - self.required = [] - -class logoutResponse (baseResponse): - def __init__(self): - """success if the logout action succeeded""" - self.description = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/markDefaultZoneForAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/markDefaultZoneForAccount.py deleted file mode 100644 index dcf2621ca5c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/markDefaultZoneForAccount.py +++ /dev/null @@ -1,179 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Marks a default zone for this account""" -from baseCmd import * -from baseResponse import * -class markDefaultZoneForAccountCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Name of the account that is to be marked.""" - """Required""" - self.account = None - """Marks the account that belongs to the specified domain.""" - """Required""" - self.domainid = None - """The Zone ID with which the account is to be marked.""" - """Required""" - self.zoneid = None - self.required = ["account","domainid","zoneid",] - -class markDefaultZoneForAccountResponse (baseResponse): - def __init__(self): - """the id of the account""" - self.id = None - """details for the account""" - self.accountdetails = None - """account type (admin, domain-admin, user)""" - self.accounttype = None - """the total number of cpu cores available to be created for this account""" - self.cpuavailable = None - """the total number of cpu cores the account can own""" - self.cpulimit = None - """the total number of cpu cores owned by account""" - self.cputotal = None - """the default zone of the account""" - self.defaultzoneid = None - """name of the Domain the account belongs too""" - self.domain = None - """id of the Domain the account belongs too""" - self.domainid = None - """the total number of public ip addresses available for this account to acquire""" - self.ipavailable = None - """the total number of public ip addresses this account can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this account""" - self.iptotal = None - """true if the account requires cleanup""" - self.iscleanuprequired = None - """true if account is default, false otherwise""" - self.isdefault = None - """the total memory (in MB) available to be created for this account""" - self.memoryavailable = None - """the total memory (in MB) the account can own""" - self.memorylimit = None - """the total memory (in MB) owned by account""" - self.memorytotal = None - """the name of the account""" - self.name = None - """the total number of networks available to be created for this account""" - self.networkavailable = None - """the network domain""" - self.networkdomain = None - """the total number of networks the account can own""" - self.networklimit = None - """the total number of networks owned by account""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this account""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the account can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by account""" - self.primarystoragetotal = None - """the total number of projects available for administration by this account""" - self.projectavailable = None - """the total number of projects the account can own""" - self.projectlimit = None - """the total number of projects being administrated by this account""" - self.projecttotal = None - """the total number of network traffic bytes received""" - self.receivedbytes = None - """the total secondary storage space (in GiB) available to be used for this account""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the account can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by account""" - self.secondarystoragetotal = None - """the total number of network traffic bytes sent""" - self.sentbytes = None - """the total number of snapshots available for this account""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this account""" - self.snapshotlimit = None - """the total number of snapshots stored by this account""" - self.snapshottotal = None - """the state of the account""" - self.state = None - """the total number of templates available to be created by this account""" - self.templateavailable = None - """the total number of templates which can be created by this account""" - self.templatelimit = None - """the total number of templates which have been created by this account""" - self.templatetotal = None - """the total number of virtual machines available for this account to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this account""" - self.vmlimit = None - """the total number of virtual machines running for this account""" - self.vmrunning = None - """the total number of virtual machines stopped for this account""" - self.vmstopped = None - """the total number of virtual machines deployed by this account""" - self.vmtotal = None - """the total volume available for this account""" - self.volumeavailable = None - """the total volume which can be used by this account""" - self.volumelimit = None - """the total volume being used by this account""" - self.volumetotal = None - """the total number of vpcs available to be created for this account""" - self.vpcavailable = None - """the total number of vpcs the account can own""" - self.vpclimit = None - """the total number of vpcs owned by account""" - self.vpctotal = None - """the list of users associated with account""" - self.user = [] - -class user: - def __init__(self): - """"the user ID""" - self.id = None - """"the account name of the user""" - self.account = None - """"the account ID of the user""" - self.accountid = None - """"the account type of the user""" - self.accounttype = None - """"the api key of the user""" - self.apikey = None - """"the date and time the user account was created""" - self.created = None - """"the domain name of the user""" - self.domain = None - """"the domain ID of the user""" - self.domainid = None - """"the user email address""" - self.email = None - """"the user firstname""" - self.firstname = None - """"the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """"true if user is default, false otherwise""" - self.isdefault = None - """"the user lastname""" - self.lastname = None - """"the secret key of the user""" - self.secretkey = None - """"the user state""" - self.state = None - """"the timezone user was created in""" - self.timezone = None - """"the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateSystemVm.py deleted file mode 100644 index ab2a7b544be..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateSystemVm.py +++ /dev/null @@ -1,89 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Attempts Migration of a system virtual machine to the host specified.""" -from baseCmd import * -from baseResponse import * -class migrateSystemVmCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """destination Host ID to migrate VM to""" - """Required""" - self.hostid = None - """the ID of the virtual machine""" - """Required""" - self.virtualmachineid = None - self.required = ["hostid","virtualmachineid",] - -class migrateSystemVmResponse (baseResponse): - def __init__(self): - """the ID of the system VM""" - self.id = None - """the number of active console sessions for the console proxy system vm""" - self.activeviewersessions = None - """the date and time the system VM was created""" - self.created = None - """the first DNS for the system VM""" - self.dns1 = None - """the second DNS for the system VM""" - self.dns2 = None - """the gateway for the system VM""" - self.gateway = None - """the host ID for the system VM""" - self.hostid = None - """the hostname for the system VM""" - self.hostname = None - """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobid = None - """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobstatus = None - """the link local IP address for the system vm""" - self.linklocalip = None - """the link local MAC address for the system vm""" - self.linklocalmacaddress = None - """the link local netmask for the system vm""" - self.linklocalnetmask = None - """the name of the system VM""" - self.name = None - """the network domain for the system VM""" - self.networkdomain = None - """the Pod ID for the system VM""" - self.podid = None - """the private IP address for the system VM""" - self.privateip = None - """the private MAC address for the system VM""" - self.privatemacaddress = None - """the private netmask for the system VM""" - self.privatenetmask = None - """the public IP address for the system VM""" - self.publicip = None - """the public MAC address for the system VM""" - self.publicmacaddress = None - """the public netmask for the system VM""" - self.publicnetmask = None - """the state of the system VM""" - self.state = None - """the system VM type""" - self.systemvmtype = None - """the template ID for the system VM""" - self.templateid = None - """the Zone ID for the system VM""" - self.zoneid = None - """the Zone name for the system VM""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachine.py deleted file mode 100644 index 6e72c72785a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachine.py +++ /dev/null @@ -1,373 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Attempts Migration of a VM to a different host or Root volume of the vm to a different storage pool""" -from baseCmd import * -from baseResponse import * -class migrateVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the virtual machine""" - """Required""" - self.virtualmachineid = None - """Destination Host ID to migrate VM to. Required for live migrating a VM from host to host""" - self.hostid = None - """Destination storage pool ID to migrate VM volumes to. Required for migrating the root disk volume""" - self.storageid = None - self.required = ["virtualmachineid",] - -class migrateVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachineWithVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachineWithVolume.py deleted file mode 100644 index f7e6c53dc2d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVirtualMachineWithVolume.py +++ /dev/null @@ -1,374 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Attempts Migration of a VM with its volumes to a different host""" -from baseCmd import * -from baseResponse import * -class migrateVirtualMachineWithVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Destination Host ID to migrate VM to.""" - """Required""" - self.hostid = None - """the ID of the virtual machine""" - """Required""" - self.virtualmachineid = None - """Map of pool to which each volume should be migrated (volume/pool pair)""" - self.migrateto = [] - self.required = ["hostid","virtualmachineid",] - -class migrateVirtualMachineWithVolumeResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVolume.py deleted file mode 100644 index 895876f727d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/migrateVolume.py +++ /dev/null @@ -1,148 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Migrate volume""" -from baseCmd import * -from baseResponse import * -class migrateVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """destination storage pool ID to migrate the volume to""" - """Required""" - self.storageid = None - """the ID of the volume""" - """Required""" - self.volumeid = None - """if the volume should be live migrated when it is attached to a running vm""" - self.livemigrate = None - self.required = ["storageid","volumeid",] - -class migrateVolumeResponse (baseResponse): - def __init__(self): - """ID of the disk volume""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the date the volume was attached to a VM instance""" - self.attached = None - """the date the disk volume was created""" - self.created = None - """the boolean state of whether the volume is destroyed or not""" - self.destroyed = None - """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" - self.deviceid = None - """bytes read rate of the disk volume""" - self.diskBytesReadRate = None - """bytes write rate of the disk volume""" - self.diskBytesWriteRate = None - """io requests read rate of the disk volume""" - self.diskIopsReadRate = None - """io requests write rate of the disk volume""" - self.diskIopsWriteRate = None - """the display text of the disk offering""" - self.diskofferingdisplaytext = None - """ID of the disk offering""" - self.diskofferingid = None - """name of the disk offering""" - self.diskofferingname = None - """an optional field whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """Hypervisor the volume belongs to""" - self.hypervisor = None - """true if the volume is extractable, false otherwise""" - self.isextractable = None - """max iops of the disk volume""" - self.maxiops = None - """min iops of the disk volume""" - self.miniops = None - """name of the disk volume""" - self.name = None - """The path of the volume""" - self.path = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the display text of the service offering for root disk""" - self.serviceofferingdisplaytext = None - """ID of the service offering for root disk""" - self.serviceofferingid = None - """name of the service offering for root disk""" - self.serviceofferingname = None - """size of the disk volume""" - self.size = None - """ID of the snapshot from which this volume was created""" - self.snapshotid = None - """the state of the disk volume""" - self.state = None - """the status of the volume""" - self.status = None - """name of the primary storage hosting the disk volume""" - self.storage = None - """id of the primary storage hosting the disk volume; returned to admin user only""" - self.storageid = None - """shared or local storage""" - self.storagetype = None - """type of the disk volume (ROOT or DATADISK)""" - self.type = None - """id of the virtual machine""" - self.virtualmachineid = None - """display name of the virtual machine""" - self.vmdisplayname = None - """name of the virtual machine""" - self.vmname = None - """state of the virtual machine""" - self.vmstate = None - """ID of the availability zone""" - self.zoneid = None - """name of the availability zone""" - self.zonename = None - """the list of resource tags associated with volume""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/prepareHostForMaintenance.py b/tools/marvin/build/lib/marvin/cloudstackAPI/prepareHostForMaintenance.py deleted file mode 100644 index 4e36902b4c6..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/prepareHostForMaintenance.py +++ /dev/null @@ -1,122 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Prepares a host for maintenance.""" -from baseCmd import * -from baseResponse import * -class prepareHostForMaintenanceCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the host ID""" - """Required""" - self.id = None - self.required = ["id",] - -class prepareHostForMaintenanceResponse (baseResponse): - def __init__(self): - """the ID of the host""" - self.id = None - """the cpu average load on the host""" - self.averageload = None - """capabilities of the host""" - self.capabilities = None - """the cluster ID of the host""" - self.clusterid = None - """the cluster name of the host""" - self.clustername = None - """the cluster type of the cluster that host belongs to""" - self.clustertype = None - """the amount of the host's CPU currently allocated""" - self.cpuallocated = None - """the CPU number of the host""" - self.cpunumber = None - """the CPU speed of the host""" - self.cpuspeed = None - """the amount of the host's CPU currently used""" - self.cpuused = None - """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" - self.cpuwithoverprovisioning = None - """the date and time the host was created""" - self.created = None - """true if the host is disconnected. False otherwise.""" - self.disconnected = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the host""" - self.disksizetotal = None - """events available for the host""" - self.events = None - """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" - self.hahost = None - """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" - self.hasenoughcapacity = None - """comma-separated list of tags for the host""" - self.hosttags = None - """the host hypervisor""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the IP address of the host""" - self.ipaddress = None - """true if local storage is active, false otherwise""" - self.islocalstorageactive = None - """the date and time the host was last pinged""" - self.lastpinged = None - """the management server ID of the host""" - self.managementserverid = None - """the amount of the host's memory currently allocated""" - self.memoryallocated = None - """the memory total of the host""" - self.memorytotal = None - """the amount of the host's memory currently used""" - self.memoryused = None - """the name of the host""" - self.name = None - """the incoming network traffic on the host""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the OS category ID of the host""" - self.oscategoryid = None - """the OS category name of the host""" - self.oscategoryname = None - """the Pod ID of the host""" - self.podid = None - """the Pod name of the host""" - self.podname = None - """the date and time the host was removed""" - self.removed = None - """the resource state of the host""" - self.resourcestate = None - """the state of the host""" - self.state = None - """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" - self.suitableformigration = None - """the host type""" - self.type = None - """the host version""" - self.version = None - """the Zone ID of the host""" - self.zoneid = None - """the Zone name of the host""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/prepareTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/prepareTemplate.py deleted file mode 100644 index 05a5827c57f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/prepareTemplate.py +++ /dev/null @@ -1,134 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""load template into primary storage""" -from baseCmd import * -from baseResponse import * -class prepareTemplateCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """template ID of the template to be prepared in primary storage(s).""" - """Required""" - self.templateid = None - """zone ID of the template to be prepared in primary storage(s).""" - """Required""" - self.zoneid = None - self.required = ["templateid","zoneid",] - -class prepareTemplateResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/queryAsyncJobResult.py b/tools/marvin/build/lib/marvin/cloudstackAPI/queryAsyncJobResult.py deleted file mode 100644 index c3396b52e26..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/queryAsyncJobResult.py +++ /dev/null @@ -1,56 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Retrieves the current status of asynchronous job.""" -from baseCmd import * -from baseResponse import * -class queryAsyncJobResultCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the asychronous job""" - """Required""" - self.jobid = None - self.required = ["jobid",] - -class queryAsyncJobResultResponse (baseResponse): - def __init__(self): - """the account that executed the async command""" - self.accountid = None - """the async command executed""" - self.cmd = None - """the created date of the job""" - self.created = None - """the unique ID of the instance/entity object related to the job""" - self.jobinstanceid = None - """the instance/entity object related to the job""" - self.jobinstancetype = None - """the progress information of the PENDING job""" - self.jobprocstatus = None - """the result reason""" - self.jobresult = None - """the result code for the job""" - self.jobresultcode = None - """the result type""" - self.jobresulttype = None - """the current job status-should be 0 for PENDING""" - self.jobstatus = None - """the user that executed the async command""" - self.userid = None - """the ID of the async job""" - self.jobid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootRouter.py deleted file mode 100644 index ad29a576f75..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootRouter.py +++ /dev/null @@ -1,151 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Starts a router.""" -from baseCmd import * -from baseResponse import * -class rebootRouterCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the router""" - """Required""" - self.id = None - self.required = ["id",] - -class rebootRouterResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootSystemVm.py deleted file mode 100644 index 871a1fee81d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootSystemVm.py +++ /dev/null @@ -1,86 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Reboots a system VM.""" -from baseCmd import * -from baseResponse import * -class rebootSystemVmCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the system virtual machine""" - """Required""" - self.id = None - self.required = ["id",] - -class rebootSystemVmResponse (baseResponse): - def __init__(self): - """the ID of the system VM""" - self.id = None - """the number of active console sessions for the console proxy system vm""" - self.activeviewersessions = None - """the date and time the system VM was created""" - self.created = None - """the first DNS for the system VM""" - self.dns1 = None - """the second DNS for the system VM""" - self.dns2 = None - """the gateway for the system VM""" - self.gateway = None - """the host ID for the system VM""" - self.hostid = None - """the hostname for the system VM""" - self.hostname = None - """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobid = None - """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobstatus = None - """the link local IP address for the system vm""" - self.linklocalip = None - """the link local MAC address for the system vm""" - self.linklocalmacaddress = None - """the link local netmask for the system vm""" - self.linklocalnetmask = None - """the name of the system VM""" - self.name = None - """the network domain for the system VM""" - self.networkdomain = None - """the Pod ID for the system VM""" - self.podid = None - """the private IP address for the system VM""" - self.privateip = None - """the private MAC address for the system VM""" - self.privatemacaddress = None - """the private netmask for the system VM""" - self.privatenetmask = None - """the public IP address for the system VM""" - self.publicip = None - """the public MAC address for the system VM""" - self.publicmacaddress = None - """the public netmask for the system VM""" - self.publicnetmask = None - """the state of the system VM""" - self.state = None - """the system VM type""" - self.systemvmtype = None - """the template ID for the system VM""" - self.templateid = None - """the Zone ID for the system VM""" - self.zoneid = None - """the Zone name for the system VM""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/rebootVirtualMachine.py deleted file mode 100644 index 265e8282af7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/rebootVirtualMachine.py +++ /dev/null @@ -1,369 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Reboots a virtual machine.""" -from baseCmd import * -from baseResponse import * -class rebootVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.id = None - self.required = ["id",] - -class rebootVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/reconnectHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/reconnectHost.py deleted file mode 100644 index 3d65772cb22..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/reconnectHost.py +++ /dev/null @@ -1,122 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Reconnects a host.""" -from baseCmd import * -from baseResponse import * -class reconnectHostCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the host ID""" - """Required""" - self.id = None - self.required = ["id",] - -class reconnectHostResponse (baseResponse): - def __init__(self): - """the ID of the host""" - self.id = None - """the cpu average load on the host""" - self.averageload = None - """capabilities of the host""" - self.capabilities = None - """the cluster ID of the host""" - self.clusterid = None - """the cluster name of the host""" - self.clustername = None - """the cluster type of the cluster that host belongs to""" - self.clustertype = None - """the amount of the host's CPU currently allocated""" - self.cpuallocated = None - """the CPU number of the host""" - self.cpunumber = None - """the CPU speed of the host""" - self.cpuspeed = None - """the amount of the host's CPU currently used""" - self.cpuused = None - """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" - self.cpuwithoverprovisioning = None - """the date and time the host was created""" - self.created = None - """true if the host is disconnected. False otherwise.""" - self.disconnected = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the host""" - self.disksizetotal = None - """events available for the host""" - self.events = None - """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" - self.hahost = None - """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" - self.hasenoughcapacity = None - """comma-separated list of tags for the host""" - self.hosttags = None - """the host hypervisor""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the IP address of the host""" - self.ipaddress = None - """true if local storage is active, false otherwise""" - self.islocalstorageactive = None - """the date and time the host was last pinged""" - self.lastpinged = None - """the management server ID of the host""" - self.managementserverid = None - """the amount of the host's memory currently allocated""" - self.memoryallocated = None - """the memory total of the host""" - self.memorytotal = None - """the amount of the host's memory currently used""" - self.memoryused = None - """the name of the host""" - self.name = None - """the incoming network traffic on the host""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the OS category ID of the host""" - self.oscategoryid = None - """the OS category name of the host""" - self.oscategoryname = None - """the Pod ID of the host""" - self.podid = None - """the Pod name of the host""" - self.podname = None - """the date and time the host was removed""" - self.removed = None - """the resource state of the host""" - self.resourcestate = None - """the state of the host""" - self.state = None - """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" - self.suitableformigration = None - """the host type""" - self.type = None - """the host version""" - self.version = None - """the Zone ID of the host""" - self.zoneid = None - """the Zone name of the host""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/recoverVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/recoverVirtualMachine.py deleted file mode 100644 index 969baa83d3a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/recoverVirtualMachine.py +++ /dev/null @@ -1,369 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Recovers a virtual machine.""" -from baseCmd import * -from baseResponse import * -class recoverVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """The ID of the virtual machine""" - """Required""" - self.id = None - self.required = ["id",] - -class recoverVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/registerIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/registerIso.py deleted file mode 100644 index 3303e83d457..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/registerIso.py +++ /dev/null @@ -1,162 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Registers an existing ISO into the CloudStack Cloud.""" -from baseCmd import * -from baseResponse import * -class registerIsoCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the display text of the ISO. This is usually used for display purposes.""" - """Required""" - self.displaytext = None - """the name of the ISO""" - """Required""" - self.name = None - """the URL to where the ISO is currently being hosted""" - """Required""" - self.url = None - """the ID of the zone you wish to register the ISO to.""" - """Required""" - self.zoneid = None - """an optional account name. Must be used with domainId.""" - self.account = None - """true if this ISO is bootable. If not passed explicitly its assumed to be true""" - self.bootable = None - """the MD5 checksum value of this ISO""" - self.checksum = None - """an optional domainId. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """Image store uuid""" - self.imagestoreuuid = None - """true if iso contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the iso or its derivatives are extractable; default is false""" - self.isextractable = None - """true if you want this ISO to be featured""" - self.isfeatured = None - """true if you want to register the ISO to be publicly available to all users, false otherwise.""" - self.ispublic = None - """the ID of the OS Type that best represents the OS of this ISO. If the iso is bootable this parameter needs to be passed""" - self.ostypeid = None - """Register iso for the project""" - self.projectid = None - self.required = ["displaytext","name","url","zoneid",] - -class registerIsoResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/registerSSHKeyPair.py b/tools/marvin/build/lib/marvin/cloudstackAPI/registerSSHKeyPair.py deleted file mode 100644 index 264c603af73..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/registerSSHKeyPair.py +++ /dev/null @@ -1,47 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Register a public key in a keypair under a certain name""" -from baseCmd import * -from baseResponse import * -class registerSSHKeyPairCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Name of the keypair""" - """Required""" - self.name = None - """Public key material of the keypair""" - """Required""" - self.publickey = None - """an optional account for the ssh key. Must be used with domainId.""" - self.account = None - """an optional domainId for the ssh key. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """an optional project for the ssh key""" - self.projectid = None - self.required = ["name","publickey",] - -class registerSSHKeyPairResponse (baseResponse): - def __init__(self): - """Fingerprint of the public key""" - self.fingerprint = None - """Name of the keypair""" - self.name = None - """Private key""" - self.privatekey = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/registerTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/registerTemplate.py deleted file mode 100644 index 83393ce8913..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/registerTemplate.py +++ /dev/null @@ -1,179 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Registers an existing template into the CloudStack cloud.""" -from baseCmd import * -from baseResponse import * -class registerTemplateCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the display text of the template. This is usually used for display purposes.""" - """Required""" - self.displaytext = None - """the format for the template. Possible values include QCOW2, RAW, and VHD.""" - """Required""" - self.format = None - """the target hypervisor for the template""" - """Required""" - self.hypervisor = None - """the name of the template""" - """Required""" - self.name = None - """the ID of the OS Type that best represents the OS of this template.""" - """Required""" - self.ostypeid = None - """the URL of where the template is hosted. Possible URL include http:// and https://""" - """Required""" - self.url = None - """the ID of the zone the template is to be hosted on""" - """Required""" - self.zoneid = None - """an optional accountName. Must be used with domainId.""" - self.account = None - """32 or 64 bits support. 64 by default""" - self.bits = None - """the MD5 checksum value of this template""" - self.checksum = None - """Template details in key/value pairs.""" - self.details = [] - """an optional domainId. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template or its derivatives are extractable; default is false""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if the template is available to all accounts; default is true""" - self.ispublic = None - """true if the template type is routing i.e., if template is used to deploy router""" - self.isrouting = None - """true if the template supports the password reset feature; default is false""" - self.passwordenabled = None - """Register template for the project""" - self.projectid = None - """true if this template requires HVM""" - self.requireshvm = None - """true if the template supports the sshkey upload feature; default is false""" - self.sshkeyenabled = None - """the tag for this template.""" - self.templatetag = None - self.required = ["displaytext","format","hypervisor","name","ostypeid","url","zoneid",] - -class registerTemplateResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/registerUserKeys.py b/tools/marvin/build/lib/marvin/cloudstackAPI/registerUserKeys.py deleted file mode 100644 index 6044b6a105d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/registerUserKeys.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user""" -from baseCmd import * -from baseResponse import * -class registerUserKeysCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """User id""" - """Required""" - self.id = None - self.required = ["id",] - -class registerUserKeysResponse (baseResponse): - def __init__(self): - """the api key of the registered user""" - self.apikey = None - """the secret key of the registered user""" - self.secretkey = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedCluster.py deleted file mode 100644 index 4354f6b6a53..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedCluster.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Release the dedication for cluster""" -from baseCmd import * -from baseResponse import * -class releaseDedicatedClusterCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the Cluster""" - """Required""" - self.clusterid = None - self.required = ["clusterid",] - -class releaseDedicatedClusterResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedGuestVlanRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedGuestVlanRange.py deleted file mode 100644 index b2f84011c45..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedGuestVlanRange.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Releases a dedicated guest vlan range to the system""" -from baseCmd import * -from baseResponse import * -class releaseDedicatedGuestVlanRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the dedicated guest vlan range""" - """Required""" - self.id = None - self.required = ["id",] - -class releaseDedicatedGuestVlanRangeResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedHost.py deleted file mode 100644 index 680cd4599d9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedHost.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Release the dedication for host""" -from baseCmd import * -from baseResponse import * -class releaseDedicatedHostCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the host""" - """Required""" - self.hostid = None - self.required = ["hostid",] - -class releaseDedicatedHostResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedPod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedPod.py deleted file mode 100644 index 2993ed7c59c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedPod.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Release the dedication for the pod""" -from baseCmd import * -from baseResponse import * -class releaseDedicatedPodCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the Pod""" - """Required""" - self.podid = None - self.required = ["podid",] - -class releaseDedicatedPodResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedZone.py deleted file mode 100644 index 0f895c0d3f5..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseDedicatedZone.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Release dedication of zone""" -from baseCmd import * -from baseResponse import * -class releaseDedicatedZoneCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the Zone""" - """Required""" - self.zoneid = None - self.required = ["zoneid",] - -class releaseDedicatedZoneResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseHostReservation.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releaseHostReservation.py deleted file mode 100644 index 56626a580d5..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/releaseHostReservation.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Releases host reservation.""" -from baseCmd import * -from baseResponse import * -class releaseHostReservationCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the host ID""" - """Required""" - self.id = None - self.required = ["id",] - -class releaseHostReservationResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/releasePublicIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/releasePublicIpRange.py deleted file mode 100644 index 02f2a60e293..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/releasePublicIpRange.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Releases a Public IP range back to the system pool""" -from baseCmd import * -from baseResponse import * -class releasePublicIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the id of the Public IP range""" - """Required""" - self.id = None - self.required = ["id",] - -class releasePublicIpRangeResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromGlobalLoadBalancerRule.py deleted file mode 100644 index b3efe409fc0..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromGlobalLoadBalancerRule.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Removes a load balancer rule association with global load balancer rule""" -from baseCmd import * -from baseResponse import * -class removeFromGlobalLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the load balancer rule""" - """Required""" - self.id = None - """the list load balancer rules that will be assigned to gloabal load balacner rule""" - """Required""" - self.loadbalancerrulelist = [] - self.required = ["id","loadbalancerrulelist",] - -class removeFromGlobalLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromLoadBalancerRule.py deleted file mode 100644 index ed1a714633e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/removeFromLoadBalancerRule.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Removes a virtual machine or a list of virtual machines from a load balancer rule.""" -from baseCmd import * -from baseResponse import * -class removeFromLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the load balancer rule""" - """Required""" - self.id = None - """the list of IDs of the virtual machines that are being removed from the load balancer rule (i.e. virtualMachineIds=1,2,3)""" - """Required""" - self.virtualmachineids = [] - self.required = ["id","virtualmachineids",] - -class removeFromLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeIpFromNic.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeIpFromNic.py deleted file mode 100644 index dfe2ef27417..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/removeIpFromNic.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Assigns secondary IP to NIC.""" -from baseCmd import * -from baseResponse import * -class removeIpFromNicCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the secondary ip address to nic""" - """Required""" - self.id = None - self.required = ["id",] - -class removeIpFromNicResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeNicFromVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeNicFromVirtualMachine.py deleted file mode 100644 index 8c13453c04c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/removeNicFromVirtualMachine.py +++ /dev/null @@ -1,372 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Removes VM from specified network by deleting a NIC""" -from baseCmd import * -from baseResponse import * -class removeNicFromVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """NIC ID""" - """Required""" - self.nicid = None - """Virtual Machine ID""" - """Required""" - self.virtualmachineid = None - self.required = ["nicid","virtualmachineid",] - -class removeNicFromVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeRegion.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeRegion.py deleted file mode 100644 index 101d51c209e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/removeRegion.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Removes specified region""" -from baseCmd import * -from baseResponse import * -class removeRegionCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """ID of the region to delete""" - """Required""" - self.id = None - self.required = ["id",] - -class removeRegionResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeResourceDetail.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeResourceDetail.py deleted file mode 100644 index 7d97028d48e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/removeResourceDetail.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. - - -"""Removes detail for the Resource.""" -from baseCmd import * -from baseResponse import * -class removeResourceDetailCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Delete details for resource id""" - """Required""" - self.resourceid = None - """Delete detail by resource type""" - """Required""" - self.resourcetype = None - """Delete details matching key/value pairs""" - self.key = None - self.required = ["resourceid","resourcetype",] - -class removeResourceDetailResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/removeVpnUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/removeVpnUser.py deleted file mode 100644 index 01ff16709cc..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/removeVpnUser.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. - - -"""Removes vpn user""" -from baseCmd import * -from baseResponse import * -class removeVpnUserCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """username for the vpn user""" - """Required""" - self.username = None - """an optional account for the vpn user. Must be used with domainId.""" - self.account = None - """an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """remove vpn user from the project""" - self.projectid = None - self.required = ["username",] - -class removeVpnUserResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/replaceNetworkACLList.py b/tools/marvin/build/lib/marvin/cloudstackAPI/replaceNetworkACLList.py deleted file mode 100644 index 658366d794e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/replaceNetworkACLList.py +++ /dev/null @@ -1,40 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Replaces ACL associated with a Network or private gateway""" -from baseCmd import * -from baseResponse import * -class replaceNetworkACLListCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the network ACL""" - """Required""" - self.aclid = None - """the ID of the private gateway""" - self.gatewayid = None - """the ID of the network""" - self.networkid = None - self.required = ["aclid",] - -class replaceNetworkACLListResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resetApiLimit.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resetApiLimit.py deleted file mode 100644 index 595f97b8769..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/resetApiLimit.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. - - -"""Reset api count""" -from baseCmd import * -from baseResponse import * -class resetApiLimitCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the acount whose limit to be reset""" - self.account = None - self.required = [] - -class resetApiLimitResponse (baseResponse): - def __init__(self): - """the account name of the api remaining count""" - self.account = None - """the account uuid of the api remaining count""" - self.accountid = None - """currently allowed number of apis""" - self.apiAllowed = None - """number of api already issued""" - self.apiIssued = None - """seconds left to reset counters""" - self.expireAfter = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resetPasswordForVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resetPasswordForVirtualMachine.py deleted file mode 100644 index 28953236e8d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/resetPasswordForVirtualMachine.py +++ /dev/null @@ -1,369 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Resets the password for virtual machine. The virtual machine must be in a "Stopped" state and the template must already support this feature for this command to take effect. [async]""" -from baseCmd import * -from baseResponse import * -class resetPasswordForVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.id = None - self.required = ["id",] - -class resetPasswordForVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resetSSHKeyForVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resetSSHKeyForVirtualMachine.py deleted file mode 100644 index fa8ba4ecc0a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/resetSSHKeyForVirtualMachine.py +++ /dev/null @@ -1,378 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Resets the SSH Key for virtual machine. The virtual machine must be in a "Stopped" state. [async]""" -from baseCmd import * -from baseResponse import * -class resetSSHKeyForVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.id = None - """name of the ssh key pair used to login to the virtual machine""" - """Required""" - self.keypair = None - """an optional account for the ssh key. Must be used with domainId.""" - self.account = None - """an optional domainId for the virtual machine. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """an optional project for the ssh key""" - self.projectid = None - self.required = ["id","keypair",] - -class resetSSHKeyForVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resetVpnConnection.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resetVpnConnection.py deleted file mode 100644 index b378b0cef0e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/resetVpnConnection.py +++ /dev/null @@ -1,76 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Reset site to site vpn connection""" -from baseCmd import * -from baseResponse import * -class resetVpnConnectionCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of vpn connection""" - """Required""" - self.id = None - """an optional account for connection. Must be used with domainId.""" - self.account = None - """an optional domainId for connection. If the account parameter is used, domainId must also be used.""" - self.domainid = None - self.required = ["id",] - -class resetVpnConnectionResponse (baseResponse): - def __init__(self): - """the vpn gateway ID""" - self.id = None - """the owner""" - self.account = None - """guest cidr list of the customer gateway""" - self.cidrlist = None - """the date and time the host was created""" - self.created = None - """the domain name of the owner""" - self.domain = None - """the domain id of the owner""" - self.domainid = None - """if DPD is enabled for customer gateway""" - self.dpd = None - """Lifetime of ESP SA of customer gateway""" - self.esplifetime = None - """ESP policy of the customer gateway""" - self.esppolicy = None - """public ip address id of the customer gateway""" - self.gateway = None - """Lifetime of IKE SA of customer gateway""" - self.ikelifetime = None - """IKE policy of the customer gateway""" - self.ikepolicy = None - """IPsec Preshared-Key of the customer gateway""" - self.ipsecpsk = None - """the project name""" - self.project = None - """the project id""" - self.projectid = None - """the public IP address""" - self.publicip = None - """the date and time the host was removed""" - self.removed = None - """the customer gateway ID""" - self.s2scustomergatewayid = None - """the vpn gateway ID""" - self.s2svpngatewayid = None - """State of vpn connection""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/resizeVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/resizeVolume.py deleted file mode 100644 index f63437c6942..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/resizeVolume.py +++ /dev/null @@ -1,148 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Resizes a volume""" -from baseCmd import * -from baseResponse import * -class resizeVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """new disk offering id""" - self.diskofferingid = None - """the ID of the disk volume""" - self.id = None - """Verify OK to Shrink""" - self.shrinkok = None - """New volume size in G""" - self.size = None - self.required = [] - -class resizeVolumeResponse (baseResponse): - def __init__(self): - """ID of the disk volume""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the date the volume was attached to a VM instance""" - self.attached = None - """the date the disk volume was created""" - self.created = None - """the boolean state of whether the volume is destroyed or not""" - self.destroyed = None - """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" - self.deviceid = None - """bytes read rate of the disk volume""" - self.diskBytesReadRate = None - """bytes write rate of the disk volume""" - self.diskBytesWriteRate = None - """io requests read rate of the disk volume""" - self.diskIopsReadRate = None - """io requests write rate of the disk volume""" - self.diskIopsWriteRate = None - """the display text of the disk offering""" - self.diskofferingdisplaytext = None - """ID of the disk offering""" - self.diskofferingid = None - """name of the disk offering""" - self.diskofferingname = None - """an optional field whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """Hypervisor the volume belongs to""" - self.hypervisor = None - """true if the volume is extractable, false otherwise""" - self.isextractable = None - """max iops of the disk volume""" - self.maxiops = None - """min iops of the disk volume""" - self.miniops = None - """name of the disk volume""" - self.name = None - """The path of the volume""" - self.path = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the display text of the service offering for root disk""" - self.serviceofferingdisplaytext = None - """ID of the service offering for root disk""" - self.serviceofferingid = None - """name of the service offering for root disk""" - self.serviceofferingname = None - """size of the disk volume""" - self.size = None - """ID of the snapshot from which this volume was created""" - self.snapshotid = None - """the state of the disk volume""" - self.state = None - """the status of the volume""" - self.status = None - """name of the primary storage hosting the disk volume""" - self.storage = None - """id of the primary storage hosting the disk volume; returned to admin user only""" - self.storageid = None - """shared or local storage""" - self.storagetype = None - """type of the disk volume (ROOT or DATADISK)""" - self.type = None - """id of the virtual machine""" - self.virtualmachineid = None - """display name of the virtual machine""" - self.vmdisplayname = None - """name of the virtual machine""" - self.vmname = None - """state of the virtual machine""" - self.vmstate = None - """ID of the availability zone""" - self.zoneid = None - """name of the availability zone""" - self.zonename = None - """the list of resource tags associated with volume""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/restartNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/restartNetwork.py deleted file mode 100644 index 9a8eb1af4c7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/restartNetwork.py +++ /dev/null @@ -1,119 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules""" -from baseCmd import * -from baseResponse import * -class restartNetworkCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The id of the network to restart.""" - """Required""" - self.id = None - """If cleanup old network elements""" - self.cleanup = None - self.required = ["id",] - -class restartNetworkResponse (baseResponse): - def __init__(self): - """public IP address id""" - self.id = None - """the account the public IP address is associated with""" - self.account = None - """date the public IP address was acquired""" - self.allocated = None - """the ID of the Network associated with the IP address""" - self.associatednetworkid = None - """the name of the Network associated with the IP address""" - self.associatednetworkname = None - """the domain the public IP address is associated with""" - self.domain = None - """the domain ID the public IP address is associated with""" - self.domainid = None - """the virtual network for the IP address""" - self.forvirtualnetwork = None - """public IP address""" - self.ipaddress = None - """is public IP portable across the zones""" - self.isportable = None - """true if the IP address is a source nat address, false otherwise""" - self.issourcenat = None - """true if this ip is for static nat, false otherwise""" - self.isstaticnat = None - """true if this ip is system ip (was allocated as a part of deployVm or createLbRule)""" - self.issystem = None - """the ID of the Network where ip belongs to""" - self.networkid = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value""" - self.purpose = None - """State of the ip address. Can be: Allocatin, Allocated and Releasing""" - self.state = None - """virutal machine display name the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachinedisplayname = None - """virutal machine id the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachineid = None - """virutal machine name the ip address is assigned to (not null only for static nat Ip)""" - self.virtualmachinename = None - """the ID of the VLAN associated with the IP address. This parameter is visible to ROOT admins only""" - self.vlanid = None - """the VLAN associated with the IP address""" - self.vlanname = None - """virutal machine (dnat) ip address (not null only for static nat Ip)""" - self.vmipaddress = None - """VPC the ip belongs to""" - self.vpcid = None - """the ID of the zone the public IP address belongs to""" - self.zoneid = None - """the name of the zone the public IP address belongs to""" - self.zonename = None - """the list of resource tags associated with ip address""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/restartVPC.py b/tools/marvin/build/lib/marvin/cloudstackAPI/restartVPC.py deleted file mode 100644 index 152e64f2539..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/restartVPC.py +++ /dev/null @@ -1,393 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Restarts a VPC""" -from baseCmd import * -from baseResponse import * -class restartVPCCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the id of the VPC""" - """Required""" - self.id = None - self.required = ["id",] - -class restartVPCResponse (baseResponse): - def __init__(self): - """the id of the VPC""" - self.id = None - """the owner of the VPC""" - self.account = None - """the cidr the VPC""" - self.cidr = None - """the date this VPC was created""" - self.created = None - """an alternate display text of the VPC.""" - self.displaytext = None - """the domain name of the owner""" - self.domain = None - """the domain id of the VPC owner""" - self.domainid = None - """the name of the VPC""" - self.name = None - """the network domain of the VPC""" - self.networkdomain = None - """the project name of the VPC""" - self.project = None - """the project id of the VPC""" - self.projectid = None - """true VPC requires restart""" - self.restartrequired = None - """state of the VPC. Can be Inactive/Enabled""" - self.state = None - """vpc offering id the VPC is created from""" - self.vpcofferingid = None - """zone id of the vpc""" - self.zoneid = None - """the name of the zone the VPC belongs to""" - self.zonename = None - """the list of networks belongign to the VPC""" - self.network = [] - """the list of supported services""" - self.service = [] - """the list of resource tags associated with the project""" - self.tags = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class network: - def __init__(self): - """"the id of the network""" - self.id = None - """"the owner of the network""" - self.account = None - """"ACL Id associated with the VPC network""" - self.aclid = None - """"acl type - access type to the network""" - self.acltype = None - """"Broadcast domain type of the network""" - self.broadcastdomaintype = None - """"broadcast uri of the network. This parameter is visible to ROOT admins only""" - self.broadcasturi = None - """"list networks available for vm deployment""" - self.canusefordeploy = None - """"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" - self.cidr = None - """"an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """"the displaytext of the network""" - self.displaytext = None - """"the first DNS for the network""" - self.dns1 = None - """"the second DNS for the network""" - self.dns2 = None - """"the domain name of the network owner""" - self.domain = None - """"the domain id of the network owner""" - self.domainid = None - """"the network's gateway""" - self.gateway = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"true if network is default, false otherwise""" - self.isdefault = None - """"list networks that are persistent""" - self.ispersistent = None - """"true if network is system, false otherwise""" - self.issystem = None - """"the name of the network""" - self.name = None - """"the network's netmask""" - self.netmask = None - """"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" - self.networkcidr = None - """"the network domain""" - self.networkdomain = None - """"availability of the network offering the network is created from""" - self.networkofferingavailability = None - """"true if network offering is ip conserve mode enabled""" - self.networkofferingconservemode = None - """"display text of the network offering the network is created from""" - self.networkofferingdisplaytext = None - """"network offering id the network is created from""" - self.networkofferingid = None - """"name of the network offering the network is created from""" - self.networkofferingname = None - """"the physical network id""" - self.physicalnetworkid = None - """"the project name of the address""" - self.project = None - """"the project id of the ipaddress""" - self.projectid = None - """"related to what other network configuration""" - self.related = None - """"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" - self.reservediprange = None - """"true network requires restart""" - self.restartrequired = None - """"true if network supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """"state of the network""" - self.state = None - """"true if users from subdomains can access the domain level network""" - self.subdomainaccess = None - """"the traffic type of the network""" - self.traffictype = None - """"the type of the network""" - self.type = None - """"The vlan of the network. This parameter is visible to ROOT admins only""" - self.vlan = None - """"VPC the network belongs to""" - self.vpcid = None - """"zone id of the network""" - self.zoneid = None - """"the name of the zone the network belongs to""" - self.zonename = None - """"the list of services""" - self.service = [] - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - """"the list of resource tags associated with network""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/restoreVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/restoreVirtualMachine.py deleted file mode 100644 index e22f6c80327..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/restoreVirtualMachine.py +++ /dev/null @@ -1,371 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Restore a VM to original template/ISO or new template/ISO""" -from baseCmd import * -from baseResponse import * -class restoreVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """Virtual Machine ID""" - """Required""" - self.virtualmachineid = None - """an optional template Id to restore vm from the new template. This can be an ISO id in case of restore vm deployed using ISO""" - self.templateid = None - self.required = ["virtualmachineid",] - -class restoreVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/revertSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/revertSnapshot.py deleted file mode 100644 index e8ba5324a93..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/revertSnapshot.py +++ /dev/null @@ -1,91 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""revert a volume snapshot.""" -from baseCmd import * -from baseResponse import * -class revertSnapshotCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the snapshot""" - """Required""" - self.id = None - self.required = ["id",] - -class revertSnapshotResponse (baseResponse): - def __init__(self): - """ID of the snapshot""" - self.id = None - """the account associated with the snapshot""" - self.account = None - """the date the snapshot was created""" - self.created = None - """the domain name of the snapshot's account""" - self.domain = None - """the domain ID of the snapshot's account""" - self.domainid = None - """valid types are hourly, daily, weekly, monthy, template, and none.""" - self.intervaltype = None - """name of the snapshot""" - self.name = None - """the project name of the snapshot""" - self.project = None - """the project id of the snapshot""" - self.projectid = None - """the type of the snapshot""" - self.snapshottype = None - """the state of the snapshot. BackedUp means that snapshot is ready to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp - the snapshot is being backed up on secondary storage""" - self.state = None - """ID of the disk volume""" - self.volumeid = None - """name of the disk volume""" - self.volumename = None - """type of the disk volume""" - self.volumetype = None - """id of the availability zone""" - self.zoneid = None - """the list of resource tags associated with snapshot""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/revertToVMSnapshot.py b/tools/marvin/build/lib/marvin/cloudstackAPI/revertToVMSnapshot.py deleted file mode 100644 index 394ecba5957..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/revertToVMSnapshot.py +++ /dev/null @@ -1,369 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Revert VM from a vmsnapshot.""" -from baseCmd import * -from baseResponse import * -class revertToVMSnapshotCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the vm snapshot""" - """Required""" - self.vmsnapshotid = None - self.required = ["vmsnapshotid",] - -class revertToVMSnapshotResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupEgress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupEgress.py deleted file mode 100644 index 90d8753cfca..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupEgress.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a particular egress rule from this security group""" -from baseCmd import * -from baseResponse import * -class revokeSecurityGroupEgressCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the egress rule""" - """Required""" - self.id = None - self.required = ["id",] - -class revokeSecurityGroupEgressResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupIngress.py b/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupIngress.py deleted file mode 100644 index 82309abd2d8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/revokeSecurityGroupIngress.py +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Deletes a particular ingress rule from this security group""" -from baseCmd import * -from baseResponse import * -class revokeSecurityGroupIngressCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the ingress rule""" - """Required""" - self.id = None - self.required = ["id",] - -class revokeSecurityGroupIngressResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/scaleSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/scaleSystemVm.py deleted file mode 100644 index 56bbba353c9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/scaleSystemVm.py +++ /dev/null @@ -1,89 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Scale the service offering for a system vm (console proxy or secondary storage). The system vm must be in a "Stopped" state for this command to take effect.""" -from baseCmd import * -from baseResponse import * -class scaleSystemVmCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the system vm""" - """Required""" - self.id = None - """the service offering ID to apply to the system vm""" - """Required""" - self.serviceofferingid = None - self.required = ["id","serviceofferingid",] - -class scaleSystemVmResponse (baseResponse): - def __init__(self): - """the ID of the system VM""" - self.id = None - """the number of active console sessions for the console proxy system vm""" - self.activeviewersessions = None - """the date and time the system VM was created""" - self.created = None - """the first DNS for the system VM""" - self.dns1 = None - """the second DNS for the system VM""" - self.dns2 = None - """the gateway for the system VM""" - self.gateway = None - """the host ID for the system VM""" - self.hostid = None - """the hostname for the system VM""" - self.hostname = None - """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobid = None - """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobstatus = None - """the link local IP address for the system vm""" - self.linklocalip = None - """the link local MAC address for the system vm""" - self.linklocalmacaddress = None - """the link local netmask for the system vm""" - self.linklocalnetmask = None - """the name of the system VM""" - self.name = None - """the network domain for the system VM""" - self.networkdomain = None - """the Pod ID for the system VM""" - self.podid = None - """the private IP address for the system VM""" - self.privateip = None - """the private MAC address for the system VM""" - self.privatemacaddress = None - """the private netmask for the system VM""" - self.privatenetmask = None - """the public IP address for the system VM""" - self.publicip = None - """the public MAC address for the system VM""" - self.publicmacaddress = None - """the public netmask for the system VM""" - self.publicnetmask = None - """the state of the system VM""" - self.state = None - """the system VM type""" - self.systemvmtype = None - """the template ID for the system VM""" - self.templateid = None - """the Zone ID for the system VM""" - self.zoneid = None - """the Zone name for the system VM""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/scaleVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/scaleVirtualMachine.py deleted file mode 100644 index 6e0971d7746..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/scaleVirtualMachine.py +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Scales the virtual machine to a new service offering.""" -from baseCmd import * -from baseResponse import * -class scaleVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.id = None - """the ID of the service offering for the virtual machine""" - """Required""" - self.serviceofferingid = None - self.required = ["id","serviceofferingid",] - -class scaleVirtualMachineResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/startInternalLoadBalancerVM.py b/tools/marvin/build/lib/marvin/cloudstackAPI/startInternalLoadBalancerVM.py deleted file mode 100644 index 26e38c5040e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/startInternalLoadBalancerVM.py +++ /dev/null @@ -1,151 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Starts an existing internal lb vm.""" -from baseCmd import * -from baseResponse import * -class startInternalLoadBalancerVMCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the internal lb vm""" - """Required""" - self.id = None - self.required = ["id",] - -class startInternalLoadBalancerVMResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/startRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/startRouter.py deleted file mode 100644 index 4d3c71080c8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/startRouter.py +++ /dev/null @@ -1,151 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Starts a router.""" -from baseCmd import * -from baseResponse import * -class startRouterCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the router""" - """Required""" - self.id = None - self.required = ["id",] - -class startRouterResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/startSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/startSystemVm.py deleted file mode 100644 index 5764006f57f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/startSystemVm.py +++ /dev/null @@ -1,86 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Starts a system virtual machine.""" -from baseCmd import * -from baseResponse import * -class startSystemVmCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the system virtual machine""" - """Required""" - self.id = None - self.required = ["id",] - -class startSystemVmResponse (baseResponse): - def __init__(self): - """the ID of the system VM""" - self.id = None - """the number of active console sessions for the console proxy system vm""" - self.activeviewersessions = None - """the date and time the system VM was created""" - self.created = None - """the first DNS for the system VM""" - self.dns1 = None - """the second DNS for the system VM""" - self.dns2 = None - """the gateway for the system VM""" - self.gateway = None - """the host ID for the system VM""" - self.hostid = None - """the hostname for the system VM""" - self.hostname = None - """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobid = None - """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobstatus = None - """the link local IP address for the system vm""" - self.linklocalip = None - """the link local MAC address for the system vm""" - self.linklocalmacaddress = None - """the link local netmask for the system vm""" - self.linklocalnetmask = None - """the name of the system VM""" - self.name = None - """the network domain for the system VM""" - self.networkdomain = None - """the Pod ID for the system VM""" - self.podid = None - """the private IP address for the system VM""" - self.privateip = None - """the private MAC address for the system VM""" - self.privatemacaddress = None - """the private netmask for the system VM""" - self.privatenetmask = None - """the public IP address for the system VM""" - self.publicip = None - """the public MAC address for the system VM""" - self.publicmacaddress = None - """the public netmask for the system VM""" - self.publicnetmask = None - """the state of the system VM""" - self.state = None - """the system VM type""" - self.systemvmtype = None - """the template ID for the system VM""" - self.templateid = None - """the Zone ID for the system VM""" - self.zoneid = None - """the Zone name for the system VM""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/startVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/startVirtualMachine.py deleted file mode 100644 index 4fec3975052..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/startVirtualMachine.py +++ /dev/null @@ -1,371 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Starts a virtual machine.""" -from baseCmd import * -from baseResponse import * -class startVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.id = None - """destination Host ID to deploy the VM to - parameter available for root admin only""" - self.hostid = None - self.required = ["id",] - -class startVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/stopInternalLoadBalancerVM.py b/tools/marvin/build/lib/marvin/cloudstackAPI/stopInternalLoadBalancerVM.py deleted file mode 100644 index 8dc6688c6e8..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/stopInternalLoadBalancerVM.py +++ /dev/null @@ -1,153 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Stops an Internal LB vm.""" -from baseCmd import * -from baseResponse import * -class stopInternalLoadBalancerVMCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the internal lb vm""" - """Required""" - self.id = None - """Force stop the VM. The caller knows the VM is stopped.""" - self.forced = None - self.required = ["id",] - -class stopInternalLoadBalancerVMResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/stopRouter.py b/tools/marvin/build/lib/marvin/cloudstackAPI/stopRouter.py deleted file mode 100644 index c2c10dfd78c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/stopRouter.py +++ /dev/null @@ -1,153 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Stops a router.""" -from baseCmd import * -from baseResponse import * -class stopRouterCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the router""" - """Required""" - self.id = None - """Force stop the VM. The caller knows the VM is stopped.""" - self.forced = None - self.required = ["id",] - -class stopRouterResponse (baseResponse): - def __init__(self): - """the id of the router""" - self.id = None - """the account associated with the router""" - self.account = None - """the date and time the router was created""" - self.created = None - """the first DNS for the router""" - self.dns1 = None - """the second DNS for the router""" - self.dns2 = None - """the domain associated with the router""" - self.domain = None - """the domain ID associated with the router""" - self.domainid = None - """the gateway for the router""" - self.gateway = None - """the guest IP address for the router""" - self.guestipaddress = None - """the guest MAC address for the router""" - self.guestmacaddress = None - """the guest netmask for the router""" - self.guestnetmask = None - """the ID of the corresponding guest network""" - self.guestnetworkid = None - """the host ID for the router""" - self.hostid = None - """the hostname for the router""" - self.hostname = None - """the first IPv6 DNS for the router""" - self.ip6dns1 = None - """the second IPv6 DNS for the router""" - self.ip6dns2 = None - """if this router is an redundant virtual router""" - self.isredundantrouter = None - """the link local IP address for the router""" - self.linklocalip = None - """the link local MAC address for the router""" - self.linklocalmacaddress = None - """the link local netmask for the router""" - self.linklocalnetmask = None - """the ID of the corresponding link local network""" - self.linklocalnetworkid = None - """the name of the router""" - self.name = None - """the network domain for the router""" - self.networkdomain = None - """the Pod ID for the router""" - self.podid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """the public IP address for the router""" - self.publicip = None - """the public MAC address for the router""" - self.publicmacaddress = None - """the public netmask for the router""" - self.publicnetmask = None - """the ID of the corresponding public network""" - self.publicnetworkid = None - """the state of redundant virtual router""" - self.redundantstate = None - """role of the domain router""" - self.role = None - """the version of scripts""" - self.scriptsversion = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """the state of the router""" - self.state = None - """the template ID for the router""" - self.templateid = None - """the version of template""" - self.templateversion = None - """VPC the router belongs to""" - self.vpcid = None - """the Zone ID for the router""" - self.zoneid = None - """the Zone name for the router""" - self.zonename = None - """the list of nics associated with the router""" - self.nic = [] - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/stopSystemVm.py b/tools/marvin/build/lib/marvin/cloudstackAPI/stopSystemVm.py deleted file mode 100644 index f6990410ff9..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/stopSystemVm.py +++ /dev/null @@ -1,88 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Stops a system VM.""" -from baseCmd import * -from baseResponse import * -class stopSystemVmCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the system virtual machine""" - """Required""" - self.id = None - """Force stop the VM. The caller knows the VM is stopped.""" - self.forced = None - self.required = ["id",] - -class stopSystemVmResponse (baseResponse): - def __init__(self): - """the ID of the system VM""" - self.id = None - """the number of active console sessions for the console proxy system vm""" - self.activeviewersessions = None - """the date and time the system VM was created""" - self.created = None - """the first DNS for the system VM""" - self.dns1 = None - """the second DNS for the system VM""" - self.dns2 = None - """the gateway for the system VM""" - self.gateway = None - """the host ID for the system VM""" - self.hostid = None - """the hostname for the system VM""" - self.hostname = None - """the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobid = None - """the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.""" - self.jobstatus = None - """the link local IP address for the system vm""" - self.linklocalip = None - """the link local MAC address for the system vm""" - self.linklocalmacaddress = None - """the link local netmask for the system vm""" - self.linklocalnetmask = None - """the name of the system VM""" - self.name = None - """the network domain for the system VM""" - self.networkdomain = None - """the Pod ID for the system VM""" - self.podid = None - """the private IP address for the system VM""" - self.privateip = None - """the private MAC address for the system VM""" - self.privatemacaddress = None - """the private netmask for the system VM""" - self.privatenetmask = None - """the public IP address for the system VM""" - self.publicip = None - """the public MAC address for the system VM""" - self.publicmacaddress = None - """the public netmask for the system VM""" - self.publicnetmask = None - """the state of the system VM""" - self.state = None - """the system VM type""" - self.systemvmtype = None - """the template ID for the system VM""" - self.templateid = None - """the Zone ID for the system VM""" - self.zoneid = None - """the Zone name for the system VM""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/stopVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/stopVirtualMachine.py deleted file mode 100644 index 3965c50f408..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/stopVirtualMachine.py +++ /dev/null @@ -1,371 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Stops a virtual machine.""" -from baseCmd import * -from baseResponse import * -class stopVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.id = None - """Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend). The caller knows the VM is stopped.""" - self.forced = None - self.required = ["id",] - -class stopVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/suspendProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/suspendProject.py deleted file mode 100644 index 898a63e1ea2..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/suspendProject.py +++ /dev/null @@ -1,141 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Suspends a project""" -from baseCmd import * -from baseResponse import * -class suspendProjectCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of the project to be suspended""" - """Required""" - self.id = None - self.required = ["id",] - -class suspendProjectResponse (baseResponse): - def __init__(self): - """the id of the project""" - self.id = None - """the account name of the project's owner""" - self.account = None - """the total number of cpu cores available to be created for this project""" - self.cpuavailable = None - """the total number of cpu cores the project can own""" - self.cpulimit = None - """the total number of cpu cores owned by project""" - self.cputotal = None - """the displaytext of the project""" - self.displaytext = None - """the domain name where the project belongs to""" - self.domain = None - """the domain id the project belongs to""" - self.domainid = None - """the total number of public ip addresses available for this project to acquire""" - self.ipavailable = None - """the total number of public ip addresses this project can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this project""" - self.iptotal = None - """the total memory (in MB) available to be created for this project""" - self.memoryavailable = None - """the total memory (in MB) the project can own""" - self.memorylimit = None - """the total memory (in MB) owned by project""" - self.memorytotal = None - """the name of the project""" - self.name = None - """the total number of networks available to be created for this project""" - self.networkavailable = None - """the total number of networks the project can own""" - self.networklimit = None - """the total number of networks owned by project""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this project""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the project can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by project""" - self.primarystoragetotal = None - """the total secondary storage space (in GiB) available to be used for this project""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the project can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by project""" - self.secondarystoragetotal = None - """the total number of snapshots available for this project""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this project""" - self.snapshotlimit = None - """the total number of snapshots stored by this project""" - self.snapshottotal = None - """the state of the project""" - self.state = None - """the total number of templates available to be created by this project""" - self.templateavailable = None - """the total number of templates which can be created by this project""" - self.templatelimit = None - """the total number of templates which have been created by this project""" - self.templatetotal = None - """the total number of virtual machines available for this project to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this project""" - self.vmlimit = None - """the total number of virtual machines running for this project""" - self.vmrunning = None - """the total number of virtual machines stopped for this project""" - self.vmstopped = None - """the total number of virtual machines deployed by this project""" - self.vmtotal = None - """the total volume available for this project""" - self.volumeavailable = None - """the total volume which can be used by this project""" - self.volumelimit = None - """the total volume being used by this project""" - self.volumetotal = None - """the total number of vpcs available to be created for this project""" - self.vpcavailable = None - """the total number of vpcs the project can own""" - self.vpclimit = None - """the total number of vpcs owned by project""" - self.vpctotal = None - """the list of resource tags associated with vm""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAccount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAccount.py deleted file mode 100644 index aabd811c592..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAccount.py +++ /dev/null @@ -1,183 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates account information for the authenticated user""" -from baseCmd import * -from baseResponse import * -class updateAccountCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """new name for the account""" - """Required""" - self.newname = None - """the current account name""" - self.account = None - """details for account used to store specific parameters""" - self.accountdetails = [] - """the ID of the domain where the account exists""" - self.domainid = None - """Account id""" - self.id = None - """Network domain for the account's networks; empty string will update domainName with NULL value""" - self.networkdomain = None - self.required = ["newname",] - -class updateAccountResponse (baseResponse): - def __init__(self): - """the id of the account""" - self.id = None - """details for the account""" - self.accountdetails = None - """account type (admin, domain-admin, user)""" - self.accounttype = None - """the total number of cpu cores available to be created for this account""" - self.cpuavailable = None - """the total number of cpu cores the account can own""" - self.cpulimit = None - """the total number of cpu cores owned by account""" - self.cputotal = None - """the default zone of the account""" - self.defaultzoneid = None - """name of the Domain the account belongs too""" - self.domain = None - """id of the Domain the account belongs too""" - self.domainid = None - """the total number of public ip addresses available for this account to acquire""" - self.ipavailable = None - """the total number of public ip addresses this account can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this account""" - self.iptotal = None - """true if the account requires cleanup""" - self.iscleanuprequired = None - """true if account is default, false otherwise""" - self.isdefault = None - """the total memory (in MB) available to be created for this account""" - self.memoryavailable = None - """the total memory (in MB) the account can own""" - self.memorylimit = None - """the total memory (in MB) owned by account""" - self.memorytotal = None - """the name of the account""" - self.name = None - """the total number of networks available to be created for this account""" - self.networkavailable = None - """the network domain""" - self.networkdomain = None - """the total number of networks the account can own""" - self.networklimit = None - """the total number of networks owned by account""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this account""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the account can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by account""" - self.primarystoragetotal = None - """the total number of projects available for administration by this account""" - self.projectavailable = None - """the total number of projects the account can own""" - self.projectlimit = None - """the total number of projects being administrated by this account""" - self.projecttotal = None - """the total number of network traffic bytes received""" - self.receivedbytes = None - """the total secondary storage space (in GiB) available to be used for this account""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the account can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by account""" - self.secondarystoragetotal = None - """the total number of network traffic bytes sent""" - self.sentbytes = None - """the total number of snapshots available for this account""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this account""" - self.snapshotlimit = None - """the total number of snapshots stored by this account""" - self.snapshottotal = None - """the state of the account""" - self.state = None - """the total number of templates available to be created by this account""" - self.templateavailable = None - """the total number of templates which can be created by this account""" - self.templatelimit = None - """the total number of templates which have been created by this account""" - self.templatetotal = None - """the total number of virtual machines available for this account to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this account""" - self.vmlimit = None - """the total number of virtual machines running for this account""" - self.vmrunning = None - """the total number of virtual machines stopped for this account""" - self.vmstopped = None - """the total number of virtual machines deployed by this account""" - self.vmtotal = None - """the total volume available for this account""" - self.volumeavailable = None - """the total volume which can be used by this account""" - self.volumelimit = None - """the total volume being used by this account""" - self.volumetotal = None - """the total number of vpcs available to be created for this account""" - self.vpcavailable = None - """the total number of vpcs the account can own""" - self.vpclimit = None - """the total number of vpcs owned by account""" - self.vpctotal = None - """the list of users associated with account""" - self.user = [] - -class user: - def __init__(self): - """"the user ID""" - self.id = None - """"the account name of the user""" - self.account = None - """"the account ID of the user""" - self.accountid = None - """"the account type of the user""" - self.accounttype = None - """"the api key of the user""" - self.apikey = None - """"the date and time the user account was created""" - self.created = None - """"the domain name of the user""" - self.domain = None - """"the domain ID of the user""" - self.domainid = None - """"the user email address""" - self.email = None - """"the user firstname""" - self.firstname = None - """"the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """"true if user is default, false otherwise""" - self.isdefault = None - """"the user lastname""" - self.lastname = None - """"the secret key of the user""" - self.secretkey = None - """"the user state""" - self.state = None - """"the timezone user was created in""" - self.timezone = None - """"the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScalePolicy.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScalePolicy.py deleted file mode 100644 index 752c07c310e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScalePolicy.py +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates an existing autoscale policy.""" -from baseCmd import * -from baseResponse import * -class updateAutoScalePolicyCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the autoscale policy""" - """Required""" - self.id = None - """the list of IDs of the conditions that are being evaluated on every interval""" - self.conditionids = [] - """the duration for which the conditions have to be true before action is taken""" - self.duration = None - """the cool down period for which the policy should not be evaluated after the action has been taken""" - self.quiettime = None - self.required = ["id",] - -class updateAutoScalePolicyResponse (baseResponse): - def __init__(self): - """the autoscale policy ID""" - self.id = None - """the account owning the autoscale policy""" - self.account = None - """the action to be executed if all the conditions evaluate to true for the specified duration.""" - self.action = None - """the list of IDs of the conditions that are being evaluated on every interval""" - self.conditions = None - """the domain name of the autoscale policy""" - self.domain = None - """the domain ID of the autoscale policy""" - self.domainid = None - """the duration for which the conditions have to be true before action is taken""" - self.duration = None - """the project name of the autoscale policy""" - self.project = None - """the project id autoscale policy""" - self.projectid = None - """the cool down period for which the policy should not be evaluated after the action has been taken""" - self.quiettime = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmGroup.py deleted file mode 100644 index 705714eeb82..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmGroup.py +++ /dev/null @@ -1,70 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates an existing autoscale vm group.""" -from baseCmd import * -from baseResponse import * -class updateAutoScaleVmGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the autoscale group""" - """Required""" - self.id = None - """the frequency at which the conditions have to be evaluated""" - self.interval = None - """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" - self.maxmembers = None - """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" - self.minmembers = None - """list of scaledown autoscale policies""" - self.scaledownpolicyids = [] - """list of scaleup autoscale policies""" - self.scaleuppolicyids = [] - self.required = ["id",] - -class updateAutoScaleVmGroupResponse (baseResponse): - def __init__(self): - """the autoscale vm group ID""" - self.id = None - """the account owning the instance group""" - self.account = None - """the domain name of the vm profile""" - self.domain = None - """the domain ID of the vm profile""" - self.domainid = None - """the frequency at which the conditions have to be evaluated""" - self.interval = None - """the load balancer rule ID""" - self.lbruleid = None - """the maximum number of members in the vmgroup, The number of instances in the vm group will be equal to or less than this number.""" - self.maxmembers = None - """the minimum number of members in the vmgroup, the number of instances in the vm group will be equal to or more than this number.""" - self.minmembers = None - """the project name of the vm profile""" - self.project = None - """the project id vm profile""" - self.projectid = None - """list of scaledown autoscale policies""" - self.scaledownpolicies = None - """list of scaleup autoscale policies""" - self.scaleuppolicies = None - """the current state of the AutoScale Vm Group""" - self.state = None - """the autoscale profile that contains information about the vms in the vm group.""" - self.vmprofileid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmProfile.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmProfile.py deleted file mode 100644 index d733c792f0b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateAutoScaleVmProfile.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. - - -"""Updates an existing autoscale vm profile.""" -from baseCmd import * -from baseResponse import * -class updateAutoScaleVmProfileCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the autoscale vm profile""" - """Required""" - self.id = None - """the ID of the user used to launch and destroy the VMs""" - self.autoscaleuserid = None - """counterparam list. Example: counterparam[0].name=snmpcommunity&counterparam[0].value=public&counterparam[1].name=snmpport&counterparam[1].value=161""" - self.counterparam = [] - """the time allowed for existing connections to get closed before a vm is destroyed""" - self.destroyvmgraceperiod = None - """the template of the auto deployed virtual machine""" - self.templateid = None - self.required = ["id",] - -class updateAutoScaleVmProfileResponse (baseResponse): - def __init__(self): - """the autoscale vm profile ID""" - self.id = None - """the account owning the instance group""" - self.account = None - """the ID of the user used to launch and destroy the VMs""" - self.autoscaleuserid = None - """the time allowed for existing connections to get closed before a vm is destroyed""" - self.destroyvmgraceperiod = None - """the domain name of the vm profile""" - self.domain = None - """the domain ID of the vm profile""" - self.domainid = None - """parameters other than zoneId/serviceOfferringId/templateId to be used while deploying a virtual machine""" - self.otherdeployparams = None - """the project name of the vm profile""" - self.project = None - """the project id vm profile""" - self.projectid = None - """the service offering to be used while deploying a virtual machine""" - self.serviceofferingid = None - """the template to be used while deploying a virtual machine""" - self.templateid = None - """the availability zone to be used while deploying a virtual machine""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateCluster.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateCluster.py deleted file mode 100644 index 3c1927937ec..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateCluster.py +++ /dev/null @@ -1,91 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates an existing cluster""" -from baseCmd import * -from baseResponse import * -class updateClusterCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the Cluster""" - """Required""" - self.id = None - """Allocation state of this cluster for allocation of new resources""" - self.allocationstate = None - """the cluster name""" - self.clustername = None - """hypervisor type of the cluster""" - self.clustertype = None - """hypervisor type of the cluster""" - self.hypervisor = None - """whether this cluster is managed by cloudstack""" - self.managedstate = None - self.required = ["id",] - -class updateClusterResponse (baseResponse): - def __init__(self): - """the cluster ID""" - self.id = None - """the allocation state of the cluster""" - self.allocationstate = None - """the type of the cluster""" - self.clustertype = None - """The cpu overcommit ratio of the cluster""" - self.cpuovercommitratio = None - """the hypervisor type of the cluster""" - self.hypervisortype = None - """whether this cluster is managed by cloudstack""" - self.managedstate = None - """The memory overcommit ratio of the cluster""" - self.memoryovercommitratio = None - """the cluster name""" - self.name = None - """the Pod ID of the cluster""" - self.podid = None - """the Pod name of the cluster""" - self.podname = None - """the Zone ID of the cluster""" - self.zoneid = None - """the Zone name of the cluster""" - self.zonename = None - """the capacity of the Cluster""" - self.capacity = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateConfiguration.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateConfiguration.py deleted file mode 100644 index 6e54ab55afa..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateConfiguration.py +++ /dev/null @@ -1,54 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a configuration.""" -from baseCmd import * -from baseResponse import * -class updateConfigurationCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the name of the configuration""" - """Required""" - self.name = None - """the ID of the Account to update the parameter value for corresponding account""" - self.accountid = None - """the ID of the Cluster to update the parameter value for corresponding cluster""" - self.clusterid = None - """the ID of the Storage pool to update the parameter value for corresponding storage pool""" - self.storageid = None - """the value of the configuration""" - self.value = None - """the ID of the Zone to update the parameter value for corresponding zone""" - self.zoneid = None - self.required = ["name",] - -class updateConfigurationResponse (baseResponse): - def __init__(self): - """the value of the configuration""" - self.id = None - """the category of the configuration""" - self.category = None - """the description of the configuration""" - self.description = None - """the name of the configuration""" - self.name = None - """scope(zone/cluster/pool/account) of the parameter that needs to be updated""" - self.scope = None - """the value of the configuration""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDefaultNicForVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDefaultNicForVirtualMachine.py deleted file mode 100644 index 1d073edbcd3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDefaultNicForVirtualMachine.py +++ /dev/null @@ -1,372 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Changes the default NIC on a VM""" -from baseCmd import * -from baseResponse import * -class updateDefaultNicForVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """NIC ID""" - """Required""" - self.nicid = None - """Virtual Machine ID""" - """Required""" - self.virtualmachineid = None - self.required = ["nicid","virtualmachineid",] - -class updateDefaultNicForVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDiskOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDiskOffering.py deleted file mode 100644 index a90dab81ea7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDiskOffering.py +++ /dev/null @@ -1,76 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a disk offering.""" -from baseCmd import * -from baseResponse import * -class updateDiskOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """ID of the disk offering""" - """Required""" - self.id = None - """an optional field, whether to display the offering to the end user or not.""" - self.displayoffering = None - """updates alternate display text of the disk offering with this value""" - self.displaytext = None - """updates name of the disk offering with this value""" - self.name = None - """sort key of the disk offering, integer""" - self.sortkey = None - self.required = ["id",] - -class updateDiskOfferingResponse (baseResponse): - def __init__(self): - """unique ID of the disk offering""" - self.id = None - """the date this disk offering was created""" - self.created = None - """bytes read rate of the disk offering""" - self.diskBytesReadRate = None - """bytes write rate of the disk offering""" - self.diskBytesWriteRate = None - """io requests read rate of the disk offering""" - self.diskIopsReadRate = None - """io requests write rate of the disk offering""" - self.diskIopsWriteRate = None - """the size of the disk offering in GB""" - self.disksize = None - """whether to display the offering to the end user or not.""" - self.displayoffering = None - """an alternate display text of the disk offering.""" - self.displaytext = None - """the domain name this disk offering belongs to. Ignore this information as it is not currently applicable.""" - self.domain = None - """the domain ID this disk offering belongs to. Ignore this information as it is not currently applicable.""" - self.domainid = None - """true if disk offering uses custom size, false otherwise""" - self.iscustomized = None - """true if disk offering uses custom iops, false otherwise""" - self.iscustomizediops = None - """the max iops of the disk offering""" - self.maxiops = None - """the min iops of the disk offering""" - self.miniops = None - """the name of the disk offering""" - self.name = None - """the storage type for this disk offering""" - self.storagetype = None - """the tags for the disk offering""" - self.tags = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDomain.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateDomain.py deleted file mode 100644 index 3ba237790dd..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateDomain.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. - - -"""Updates a domain with a new name""" -from baseCmd import * -from baseResponse import * -class updateDomainCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """ID of domain to update""" - """Required""" - self.id = None - """updates domain with this name""" - self.name = None - """Network domain for the domain's networks; empty string will update domainName with NULL value""" - self.networkdomain = None - self.required = ["id",] - -class updateDomainResponse (baseResponse): - def __init__(self): - """the ID of the domain""" - self.id = None - """whether the domain has one or more sub-domains""" - self.haschild = None - """the level of the domain""" - self.level = None - """the name of the domain""" - self.name = None - """the network domain""" - self.networkdomain = None - """the domain ID of the parent domain""" - self.parentdomainid = None - """the domain name of the parent domain""" - self.parentdomainname = None - """the path of the domain""" - self.path = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateGlobalLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateGlobalLoadBalancerRule.py deleted file mode 100644 index 98e907ba94a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateGlobalLoadBalancerRule.py +++ /dev/null @@ -1,148 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""update global load balancer rules.""" -from baseCmd import * -from baseResponse import * -class updateGlobalLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the global load balancer rule""" - """Required""" - self.id = None - """the description of the load balancer rule""" - self.description = None - """load balancer algorithm (roundrobin, leastconn, proximity) that is used to distributed traffic across the zones participating in global server load balancing, if not specified defaults to 'round robin'""" - self.gslblbmethod = None - """session sticky method (sourceip) if not specified defaults to sourceip""" - self.gslbstickysessionmethodname = None - self.required = ["id",] - -class updateGlobalLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """global load balancer rule ID""" - self.id = None - """the account of the load balancer rule""" - self.account = None - """the description of the global load balancer rule""" - self.description = None - """the domain of the load balancer rule""" - self.domain = None - """the domain ID of the load balancer rule""" - self.domainid = None - """DNS domain name given for the global load balancer""" - self.gslbdomainname = None - """Load balancing method used for the global load balancer""" - self.gslblbmethod = None - """GSLB service type""" - self.gslbservicetype = None - """session persistence method used for the global load balancer""" - self.gslbstickysessionmethodname = None - """name of the global load balancer rule""" - self.name = None - """the project name of the load balancer""" - self.project = None - """the project id of the load balancer""" - self.projectid = None - """Region Id in which global load balancer is created""" - self.regionid = None - """List of load balancer rules that are part of GSLB rule""" - self.loadbalancerrule = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class loadbalancerrule: - def __init__(self): - """"the load balancer rule ID""" - self.id = None - """"the account of the load balancer rule""" - self.account = None - """"the load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """"the cidr list to forward traffic from""" - self.cidrlist = None - """"the description of the load balancer""" - self.description = None - """"the domain of the load balancer rule""" - self.domain = None - """"the domain ID of the load balancer rule""" - self.domainid = None - """"the name of the load balancer""" - self.name = None - """"the id of the guest network the lb rule belongs to""" - self.networkid = None - """"the private port""" - self.privateport = None - """"the project name of the load balancer""" - self.project = None - """"the project id of the load balancer""" - self.projectid = None - """"the public ip address""" - self.publicip = None - """"the public ip address id""" - self.publicipid = None - """"the public port""" - self.publicport = None - """"the state of the rule""" - self.state = None - """"the id of the zone the rule belongs to""" - self.zoneid = None - """"the list of resource tags associated with load balancer""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHost.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHost.py deleted file mode 100644 index 18b5f9300c4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHost.py +++ /dev/null @@ -1,130 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a host.""" -from baseCmd import * -from baseResponse import * -class updateHostCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the host to update""" - """Required""" - self.id = None - """Change resource state of host, valid values are [Enable, Disable]. Operation may failed if host in states not allowing Enable/Disable""" - self.allocationstate = None - """list of tags to be added to the host""" - self.hosttags = [] - """the id of Os category to update the host with""" - self.oscategoryid = None - """the new uri for the secondary storage: nfs://host/path""" - self.url = None - self.required = ["id",] - -class updateHostResponse (baseResponse): - def __init__(self): - """the ID of the host""" - self.id = None - """the cpu average load on the host""" - self.averageload = None - """capabilities of the host""" - self.capabilities = None - """the cluster ID of the host""" - self.clusterid = None - """the cluster name of the host""" - self.clustername = None - """the cluster type of the cluster that host belongs to""" - self.clustertype = None - """the amount of the host's CPU currently allocated""" - self.cpuallocated = None - """the CPU number of the host""" - self.cpunumber = None - """the CPU speed of the host""" - self.cpuspeed = None - """the amount of the host's CPU currently used""" - self.cpuused = None - """the amount of the host's CPU after applying the cpu.overprovisioning.factor""" - self.cpuwithoverprovisioning = None - """the date and time the host was created""" - self.created = None - """true if the host is disconnected. False otherwise.""" - self.disconnected = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the host""" - self.disksizetotal = None - """events available for the host""" - self.events = None - """true if the host is Ha host (dedicated to vms started by HA process; false otherwise""" - self.hahost = None - """true if this host has enough CPU and RAM capacity to migrate a VM to it, false otherwise""" - self.hasenoughcapacity = None - """comma-separated list of tags for the host""" - self.hosttags = None - """the host hypervisor""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the IP address of the host""" - self.ipaddress = None - """true if local storage is active, false otherwise""" - self.islocalstorageactive = None - """the date and time the host was last pinged""" - self.lastpinged = None - """the management server ID of the host""" - self.managementserverid = None - """the amount of the host's memory currently allocated""" - self.memoryallocated = None - """the memory total of the host""" - self.memorytotal = None - """the amount of the host's memory currently used""" - self.memoryused = None - """the name of the host""" - self.name = None - """the incoming network traffic on the host""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the OS category ID of the host""" - self.oscategoryid = None - """the OS category name of the host""" - self.oscategoryname = None - """the Pod ID of the host""" - self.podid = None - """the Pod name of the host""" - self.podname = None - """the date and time the host was removed""" - self.removed = None - """the resource state of the host""" - self.resourcestate = None - """the state of the host""" - self.state = None - """true if this host is suitable(has enough capacity and satisfies all conditions like hosttags, max guests vm limit etc) to migrate a VM to it , false otherwise""" - self.suitableformigration = None - """the host type""" - self.type = None - """the host version""" - self.version = None - """the Zone ID of the host""" - self.zoneid = None - """the Zone name of the host""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHostPassword.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHostPassword.py deleted file mode 100644 index eaeb0bcc4ef..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHostPassword.py +++ /dev/null @@ -1,43 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Update password of a host/pool on management server.""" -from baseCmd import * -from baseResponse import * -class updateHostPasswordCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the new password for the host/cluster""" - """Required""" - self.password = None - """the username for the host/cluster""" - """Required""" - self.username = None - """the cluster ID""" - self.clusterid = None - """the host ID""" - self.hostid = None - self.required = ["password","username",] - -class updateHostPasswordResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHypervisorCapabilities.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateHypervisorCapabilities.py deleted file mode 100644 index f640aa85d1b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateHypervisorCapabilities.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. - - -"""Updates a hypervisor capabilities.""" -from baseCmd import * -from baseResponse import * -class updateHypervisorCapabilitiesCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """ID of the hypervisor capability""" - self.id = None - """the max number of Guest VMs per host for this hypervisor.""" - self.maxguestslimit = None - """set true to enable security group for this hypervisor.""" - self.securitygroupenabled = None - self.required = [] - -class updateHypervisorCapabilitiesResponse (baseResponse): - def __init__(self): - """the ID of the hypervisor capabilities row""" - self.id = None - """the hypervisor type""" - self.hypervisor = None - """the hypervisor version""" - self.hypervisorversion = None - """the maximum number of Data Volumes that can be attached for this hypervisor""" - self.maxdatavolumeslimit = None - """the maximum number of guest vms recommended for this hypervisor""" - self.maxguestslimit = None - """the maximum number of Hosts per cluster for this hypervisor""" - self.maxhostspercluster = None - """true if security group is supported""" - self.securitygroupenabled = None - """true if storage motion is supported""" - self.storagemotionenabled = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateInstanceGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateInstanceGroup.py deleted file mode 100644 index 357f7781ee7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateInstanceGroup.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. - - -"""Updates a vm group""" -from baseCmd import * -from baseResponse import * -class updateInstanceGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Instance group ID""" - """Required""" - self.id = None - """new instance group name""" - self.name = None - self.required = ["id",] - -class updateInstanceGroupResponse (baseResponse): - def __init__(self): - """the id of the instance group""" - self.id = None - """the account owning the instance group""" - self.account = None - """time and date the instance group was created""" - self.created = None - """the domain name of the instance group""" - self.domain = None - """the domain ID of the instance group""" - self.domainid = None - """the name of the instance group""" - self.name = None - """the project name of the group""" - self.project = None - """the project id of the group""" - self.projectid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateIso.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateIso.py deleted file mode 100644 index 5416462f5fd..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateIso.py +++ /dev/null @@ -1,149 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates an ISO file.""" -from baseCmd import * -from baseResponse import * -class updateIsoCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the image file""" - """Required""" - self.id = None - """true if image is bootable, false otherwise""" - self.bootable = None - """the display text of the image""" - self.displaytext = None - """the format for the image""" - self.format = None - """true if template/ISO contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template type is routing i.e., if template is used to deploy router""" - self.isrouting = None - """the name of the image file""" - self.name = None - """the ID of the OS type that best represents the OS of this image.""" - self.ostypeid = None - """true if the image supports the password reset feature; default is false""" - self.passwordenabled = None - """sort key of the template, integer""" - self.sortkey = None - self.required = ["id",] - -class updateIsoResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateIsoPermissions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateIsoPermissions.py deleted file mode 100644 index 4e8debc3433..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateIsoPermissions.py +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates iso permissions""" -from baseCmd import * -from baseResponse import * -class updateIsoPermissionsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the template ID""" - """Required""" - self.id = None - """a comma delimited list of accounts. If specified, "op" parameter has to be passed in.""" - self.accounts = [] - """true if the template/iso is extractable, false other wise. Can be set only by root admin""" - self.isextractable = None - """true for featured template/iso, false otherwise""" - self.isfeatured = None - """true for public template/iso, false for private templates/isos""" - self.ispublic = None - """permission operator (add, remove, reset)""" - self.op = None - """a comma delimited list of projects. If specified, "op" parameter has to be passed in.""" - self.projectids = [] - self.required = ["id",] - -class updateIsoPermissionsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateLoadBalancerRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateLoadBalancerRule.py deleted file mode 100644 index b02139fdc0f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateLoadBalancerRule.py +++ /dev/null @@ -1,97 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates load balancer""" -from baseCmd import * -from baseResponse import * -class updateLoadBalancerRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the id of the load balancer rule to update""" - """Required""" - self.id = None - """load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """the description of the load balancer rule""" - self.description = None - """the name of the load balancer rule""" - self.name = None - self.required = ["id",] - -class updateLoadBalancerRuleResponse (baseResponse): - def __init__(self): - """the load balancer rule ID""" - self.id = None - """the account of the load balancer rule""" - self.account = None - """the load balancer algorithm (source, roundrobin, leastconn)""" - self.algorithm = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the description of the load balancer""" - self.description = None - """the domain of the load balancer rule""" - self.domain = None - """the domain ID of the load balancer rule""" - self.domainid = None - """the name of the load balancer""" - self.name = None - """the id of the guest network the lb rule belongs to""" - self.networkid = None - """the private port""" - self.privateport = None - """the project name of the load balancer""" - self.project = None - """the project id of the load balancer""" - self.projectid = None - """the public ip address""" - self.publicip = None - """the public ip address id""" - self.publicipid = None - """the public port""" - self.publicport = None - """the state of the rule""" - self.state = None - """the id of the zone the rule belongs to""" - self.zoneid = None - """the list of resource tags associated with load balancer""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetwork.py deleted file mode 100644 index b0230f59dd3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetwork.py +++ /dev/null @@ -1,216 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a network""" -from baseCmd import * -from baseResponse import * -class updateNetworkCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the network""" - """Required""" - self.id = None - """Force update even if cidr type is different""" - self.changecidr = None - """an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """the new display text for the network""" - self.displaytext = None - """CIDR for Guest VMs,Cloudstack allocates IPs to Guest VMs only from this CIDR""" - self.guestvmcidr = None - """the new name for the network""" - self.name = None - """network domain""" - self.networkdomain = None - """network offering ID""" - self.networkofferingid = None - self.required = ["id",] - -class updateNetworkResponse (baseResponse): - def __init__(self): - """the id of the network""" - self.id = None - """the owner of the network""" - self.account = None - """ACL Id associated with the VPC network""" - self.aclid = None - """acl type - access type to the network""" - self.acltype = None - """Broadcast domain type of the network""" - self.broadcastdomaintype = None - """broadcast uri of the network. This parameter is visible to ROOT admins only""" - self.broadcasturi = None - """list networks available for vm deployment""" - self.canusefordeploy = None - """Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" - self.cidr = None - """an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """the displaytext of the network""" - self.displaytext = None - """the first DNS for the network""" - self.dns1 = None - """the second DNS for the network""" - self.dns2 = None - """the domain name of the network owner""" - self.domain = None - """the domain id of the network owner""" - self.domainid = None - """the network's gateway""" - self.gateway = None - """the cidr of IPv6 network""" - self.ip6cidr = None - """the gateway of IPv6 network""" - self.ip6gateway = None - """true if network is default, false otherwise""" - self.isdefault = None - """list networks that are persistent""" - self.ispersistent = None - """true if network is system, false otherwise""" - self.issystem = None - """the name of the network""" - self.name = None - """the network's netmask""" - self.netmask = None - """the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" - self.networkcidr = None - """the network domain""" - self.networkdomain = None - """availability of the network offering the network is created from""" - self.networkofferingavailability = None - """true if network offering is ip conserve mode enabled""" - self.networkofferingconservemode = None - """display text of the network offering the network is created from""" - self.networkofferingdisplaytext = None - """network offering id the network is created from""" - self.networkofferingid = None - """name of the network offering the network is created from""" - self.networkofferingname = None - """the physical network id""" - self.physicalnetworkid = None - """the project name of the address""" - self.project = None - """the project id of the ipaddress""" - self.projectid = None - """related to what other network configuration""" - self.related = None - """the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" - self.reservediprange = None - """true network requires restart""" - self.restartrequired = None - """true if network supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """state of the network""" - self.state = None - """true if users from subdomains can access the domain level network""" - self.subdomainaccess = None - """the traffic type of the network""" - self.traffictype = None - """the type of the network""" - self.type = None - """The vlan of the network. This parameter is visible to ROOT admins only""" - self.vlan = None - """VPC the network belongs to""" - self.vpcid = None - """zone id of the network""" - self.zoneid = None - """the name of the zone the network belongs to""" - self.zonename = None - """the list of services""" - self.service = [] - """the list of resource tags associated with network""" - self.tags = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkACLItem.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkACLItem.py deleted file mode 100644 index acc979f2609..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkACLItem.py +++ /dev/null @@ -1,99 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates ACL Item with specified Id""" -from baseCmd import * -from baseResponse import * -class updateNetworkACLItemCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the ID of the network ACL Item""" - """Required""" - self.id = None - """scl entry action, allow or deny""" - self.action = None - """the cidr list to allow traffic from/to""" - self.cidrlist = [] - """the ending port of ACL""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """The network of the vm the ACL will be created for""" - self.number = None - """the protocol for the ACL rule. Valid values are TCP/UDP/ICMP/ALL or valid protocol number""" - self.protocol = None - """the starting port of ACL""" - self.startport = None - """the traffic type for the ACL,can be Ingress or Egress, defaulted to Ingress if not specified""" - self.traffictype = None - self.required = ["id",] - -class updateNetworkACLItemResponse (baseResponse): - def __init__(self): - """the ID of the ACL Item""" - self.id = None - """the ID of the ACL this item belongs to""" - self.aclid = None - """Action of ACL Item. Allow/Deny""" - self.action = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the ending port of ACL's port range""" - self.endport = None - """error code for this icmp message""" - self.icmpcode = None - """type of the icmp message being sent""" - self.icmptype = None - """Number of the ACL Item""" - self.number = None - """the protocol of the ACL""" - self.protocol = None - """the starting port of ACL's port range""" - self.startport = None - """the state of the rule""" - self.state = None - """the traffic type for the ACL""" - self.traffictype = None - """the list of resource tags associated with the network ACLs""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkOffering.py deleted file mode 100644 index 813af27dcb1..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkOffering.py +++ /dev/null @@ -1,140 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a network offering.""" -from baseCmd import * -from baseResponse import * -class updateNetworkOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the availability of network offering. Default value is Required for Guest Virtual network offering; Optional for Guest Direct network offering""" - self.availability = None - """the display text of the network offering""" - self.displaytext = None - """the id of the network offering""" - self.id = None - """maximum number of concurrent connections supported by the network offering""" - self.maxconnections = None - """the name of the network offering""" - self.name = None - """sort key of the network offering, integer""" - self.sortkey = None - """update state for the network offering""" - self.state = None - self.required = [] - -class updateNetworkOfferingResponse (baseResponse): - def __init__(self): - """the id of the network offering""" - self.id = None - """availability of the network offering""" - self.availability = None - """true if network offering is ip conserve mode enabled""" - self.conservemode = None - """the date this network offering was created""" - self.created = None - """additional key/value details tied with network offering""" - self.details = None - """an alternate display text of the network offering.""" - self.displaytext = None - """true if network offering supports persistent networks, false otherwise""" - self.egressdefaultpolicy = None - """true if network offering can be used by VPC networks only""" - self.forvpc = None - """guest type of the network offering, can be Shared or Isolated""" - self.guestiptype = None - """true if network offering is default, false otherwise""" - self.isdefault = None - """true if network offering supports persistent networks, false otherwise""" - self.ispersistent = None - """maximum number of concurrents connections to be handled by lb""" - self.maxconnections = None - """the name of the network offering""" - self.name = None - """data transfer rate in megabits per second allowed.""" - self.networkrate = None - """the ID of the service offering used by virtual router provider""" - self.serviceofferingid = None - """true if network offering supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """true if network offering supports vlans, false otherwise""" - self.specifyvlan = None - """state of the network offering. Can be Disabled/Enabled/Inactive""" - self.state = None - """the tags for the network offering""" - self.tags = None - """the traffic type for the network offering, supported types are Public, Management, Control, Guest, Vlan or Storage.""" - self.traffictype = None - """the list of supported services""" - self.service = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkServiceProvider.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkServiceProvider.py deleted file mode 100644 index 677ef4b11f7..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateNetworkServiceProvider.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. - - -"""Updates a network serviceProvider of a physical network""" -from baseCmd import * -from baseResponse import * -class updateNetworkServiceProviderCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """network service provider id""" - """Required""" - self.id = None - """the list of services to be enabled for this physical network service provider""" - self.servicelist = [] - """Enabled/Disabled/Shutdown the physical network service provider""" - self.state = None - self.required = ["id",] - -class updateNetworkServiceProviderResponse (baseResponse): - def __init__(self): - """uuid of the network provider""" - self.id = None - """true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """the destination physical network""" - self.destinationphysicalnetworkid = None - """the provider name""" - self.name = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """services for this provider""" - self.servicelist = None - """state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePhysicalNetwork.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePhysicalNetwork.py deleted file mode 100644 index e994066aeca..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePhysicalNetwork.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. - - -"""Updates a physical network""" -from baseCmd import * -from baseResponse import * -class updatePhysicalNetworkCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """physical network id""" - """Required""" - self.id = None - """the speed for the physical network[1G/10G]""" - self.networkspeed = None - """Enabled/Disabled""" - self.state = None - """Tag the physical network""" - self.tags = [] - """the VLAN for the physical network""" - self.vlan = None - self.required = ["id",] - -class updatePhysicalNetworkResponse (baseResponse): - def __init__(self): - """the uuid of the physical network""" - self.id = None - """Broadcast domain range of the physical network""" - self.broadcastdomainrange = None - """the domain id of the physical network owner""" - self.domainid = None - """isolation methods""" - self.isolationmethods = None - """name of the physical network""" - self.name = None - """the speed of the physical network""" - self.networkspeed = None - """state of the physical network""" - self.state = None - """comma separated tag""" - self.tags = None - """the vlan of the physical network""" - self.vlan = None - """zone id of the physical network""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePod.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePod.py deleted file mode 100644 index 54aa412aa24..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePod.py +++ /dev/null @@ -1,87 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a Pod.""" -from baseCmd import * -from baseResponse import * -class updatePodCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the Pod""" - """Required""" - self.id = None - """Allocation state of this cluster for allocation of new resources""" - self.allocationstate = None - """the ending IP address for the Pod""" - self.endip = None - """the gateway for the Pod""" - self.gateway = None - """the name of the Pod""" - self.name = None - """the netmask of the Pod""" - self.netmask = None - """the starting IP address for the Pod""" - self.startip = None - self.required = ["id",] - -class updatePodResponse (baseResponse): - def __init__(self): - """the ID of the Pod""" - self.id = None - """the allocation state of the Pod""" - self.allocationstate = None - """the ending IP for the Pod""" - self.endip = None - """the gateway of the Pod""" - self.gateway = None - """the name of the Pod""" - self.name = None - """the netmask of the Pod""" - self.netmask = None - """the starting IP for the Pod""" - self.startip = None - """the Zone ID of the Pod""" - self.zoneid = None - """the Zone name of the Pod""" - self.zonename = None - """the capacity of the Pod""" - self.capacity = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePortForwardingRule.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updatePortForwardingRule.py deleted file mode 100644 index ddafa5125bd..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updatePortForwardingRule.py +++ /dev/null @@ -1,98 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a port forwarding rule. Only the private port and the virtual machine can be updated.""" -from baseCmd import * -from baseResponse import * -class updatePortForwardingRuleCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the IP address id of the port forwarding rule""" - """Required""" - self.ipaddressid = None - """the private port of the port forwarding rule""" - """Required""" - self.privateport = None - """the protocol for the port fowarding rule. Valid values are TCP or UDP.""" - """Required""" - self.protocol = None - """the public port of the port forwarding rule""" - """Required""" - self.publicport = None - """the private IP address of the port forwarding rule""" - self.privateip = None - """the ID of the virtual machine for the port forwarding rule""" - self.virtualmachineid = None - self.required = ["ipaddressid","privateport","protocol","publicport",] - -class updatePortForwardingRuleResponse (baseResponse): - def __init__(self): - """the ID of the port forwarding rule""" - self.id = None - """the cidr list to forward traffic from""" - self.cidrlist = None - """the public ip address for the port forwarding rule""" - self.ipaddress = None - """the public ip address id for the port forwarding rule""" - self.ipaddressid = None - """the ending port of port forwarding rule's private port range""" - self.privateendport = None - """the starting port of port forwarding rule's private port range""" - self.privateport = None - """the protocol of the port forwarding rule""" - self.protocol = None - """the ending port of port forwarding rule's private port range""" - self.publicendport = None - """the starting port of port forwarding rule's public port range""" - self.publicport = None - """the state of the rule""" - self.state = None - """the VM display name for the port forwarding rule""" - self.virtualmachinedisplayname = None - """the VM ID for the port forwarding rule""" - self.virtualmachineid = None - """the VM name for the port forwarding rule""" - self.virtualmachinename = None - """the vm ip address for the port forwarding rule""" - self.vmguestip = None - """the list of resource tags associated with the rule""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateProject.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateProject.py deleted file mode 100644 index 3cce35aaa0e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateProject.py +++ /dev/null @@ -1,145 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a project""" -from baseCmd import * -from baseResponse import * -class updateProjectCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of the project to be modified""" - """Required""" - self.id = None - """new Admin account for the project""" - self.account = None - """display text of the project""" - self.displaytext = None - self.required = ["id",] - -class updateProjectResponse (baseResponse): - def __init__(self): - """the id of the project""" - self.id = None - """the account name of the project's owner""" - self.account = None - """the total number of cpu cores available to be created for this project""" - self.cpuavailable = None - """the total number of cpu cores the project can own""" - self.cpulimit = None - """the total number of cpu cores owned by project""" - self.cputotal = None - """the displaytext of the project""" - self.displaytext = None - """the domain name where the project belongs to""" - self.domain = None - """the domain id the project belongs to""" - self.domainid = None - """the total number of public ip addresses available for this project to acquire""" - self.ipavailable = None - """the total number of public ip addresses this project can acquire""" - self.iplimit = None - """the total number of public ip addresses allocated for this project""" - self.iptotal = None - """the total memory (in MB) available to be created for this project""" - self.memoryavailable = None - """the total memory (in MB) the project can own""" - self.memorylimit = None - """the total memory (in MB) owned by project""" - self.memorytotal = None - """the name of the project""" - self.name = None - """the total number of networks available to be created for this project""" - self.networkavailable = None - """the total number of networks the project can own""" - self.networklimit = None - """the total number of networks owned by project""" - self.networktotal = None - """the total primary storage space (in GiB) available to be used for this project""" - self.primarystorageavailable = None - """the total primary storage space (in GiB) the project can own""" - self.primarystoragelimit = None - """the total primary storage space (in GiB) owned by project""" - self.primarystoragetotal = None - """the total secondary storage space (in GiB) available to be used for this project""" - self.secondarystorageavailable = None - """the total secondary storage space (in GiB) the project can own""" - self.secondarystoragelimit = None - """the total secondary storage space (in GiB) owned by project""" - self.secondarystoragetotal = None - """the total number of snapshots available for this project""" - self.snapshotavailable = None - """the total number of snapshots which can be stored by this project""" - self.snapshotlimit = None - """the total number of snapshots stored by this project""" - self.snapshottotal = None - """the state of the project""" - self.state = None - """the total number of templates available to be created by this project""" - self.templateavailable = None - """the total number of templates which can be created by this project""" - self.templatelimit = None - """the total number of templates which have been created by this project""" - self.templatetotal = None - """the total number of virtual machines available for this project to acquire""" - self.vmavailable = None - """the total number of virtual machines that can be deployed by this project""" - self.vmlimit = None - """the total number of virtual machines running for this project""" - self.vmrunning = None - """the total number of virtual machines stopped for this project""" - self.vmstopped = None - """the total number of virtual machines deployed by this project""" - self.vmtotal = None - """the total volume available for this project""" - self.volumeavailable = None - """the total volume which can be used by this project""" - self.volumelimit = None - """the total volume being used by this project""" - self.volumetotal = None - """the total number of vpcs available to be created for this project""" - self.vpcavailable = None - """the total number of vpcs the project can own""" - self.vpclimit = None - """the total number of vpcs owned by project""" - self.vpctotal = None - """the list of resource tags associated with vm""" - self.tags = [] - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateProjectInvitation.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateProjectInvitation.py deleted file mode 100644 index f56aac5a41d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateProjectInvitation.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. - - -"""Accepts or declines project invitation""" -from baseCmd import * -from baseResponse import * -class updateProjectInvitationCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of the project to join""" - """Required""" - self.projectid = None - """if true, accept the invitation, decline if false. True by default""" - self.accept = None - """account that is joining the project""" - self.account = None - """list invitations for specified account; this parameter has to be specified with domainId""" - self.token = None - self.required = ["projectid",] - -class updateProjectInvitationResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateRegion.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateRegion.py deleted file mode 100644 index c7552db0deb..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateRegion.py +++ /dev/null @@ -1,46 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a region""" -from baseCmd import * -from baseResponse import * -class updateRegionCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Id of region to update""" - """Required""" - self.id = None - """updates region with this end point""" - self.endpoint = None - """updates region with this name""" - self.name = None - self.required = ["id",] - -class updateRegionResponse (baseResponse): - def __init__(self): - """the ID of the region""" - self.id = None - """the end point of the region""" - self.endpoint = None - """true if GSLB service is enabled in the region, false otherwise""" - self.gslbserviceenabled = None - """the name of the region""" - self.name = None - """true if security groups support is enabled, false otherwise""" - self.portableipserviceenabled = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceCount.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceCount.py deleted file mode 100644 index f197b9e65a4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceCount.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. - - -"""Recalculate and update resource count for an account or domain.""" -from baseCmd import * -from baseResponse import * -class updateResourceCountCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """If account parameter specified then updates resource counts for a specified account in this domain else update resource counts for all accounts & child domains in specified domain.""" - """Required""" - self.domainid = None - """Update resource count for a specified account. Must be used with the domainId parameter.""" - self.account = None - """Update resource limits for project""" - self.projectid = None - """Type of resource to update. If specifies valid values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and 11. If not specified will update all resource counts0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses a user can own. 2 - Volume. Number of disk volumes a user can create.3 - Snapshot. Number of snapshots a user can create.4 - Template. Number of templates that a user can register/create.5 - Project. Number of projects that a user can create.6 - Network. Number of guest network a user can create.7 - VPC. Number of VPC a user can create.8 - CPU. Total number of CPU cores a user can use.9 - Memory. Total Memory (in MB) a user can use.10 - PrimaryStorage. Total primary storage space (in GiB) a user can use.11 - SecondaryStorage. Total secondary storage space (in GiB) a user can use.""" - self.resourcetype = None - self.required = ["domainid",] - -class updateResourceCountResponse (baseResponse): - def __init__(self): - """the account for which resource count's are updated""" - self.account = None - """the domain name for which resource count's are updated""" - self.domain = None - """the domain ID for which resource count's are updated""" - self.domainid = None - """the project name for which resource count's are updated""" - self.project = None - """the project id for which resource count's are updated""" - self.projectid = None - """resource count""" - self.resourcecount = None - """resource type. Values include 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. See the resourceType parameter for more information on these values.""" - self.resourcetype = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceLimit.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceLimit.py deleted file mode 100644 index 00918544cab..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateResourceLimit.py +++ /dev/null @@ -1,54 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates resource limits for an account or domain.""" -from baseCmd import * -from baseResponse import * -class updateResourceLimitCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """Type of resource to update. Values are 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 and 11. 0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses a user can own. 2 - Volume. Number of disk volumes a user can create.3 - Snapshot. Number of snapshots a user can create.4 - Template. Number of templates that a user can register/create.6 - Network. Number of guest network a user can create.7 - VPC. Number of VPC a user can create.8 - CPU. Total number of CPU cores a user can use.9 - Memory. Total Memory (in MB) a user can use.10 - PrimaryStorage. Total primary storage space (in GiB) a user can use.11 - SecondaryStorage. Total secondary storage space (in GiB) a user can use.""" - """Required""" - self.resourcetype = None - """Update resource for a specified account. Must be used with the domainId parameter.""" - self.account = None - """Update resource limits for all accounts in specified domain. If used with the account parameter, updates resource limits for a specified account in specified domain.""" - self.domainid = None - """Maximum resource limit.""" - self.max = None - """Update resource limits for project""" - self.projectid = None - self.required = ["resourcetype",] - -class updateResourceLimitResponse (baseResponse): - def __init__(self): - """the account of the resource limit""" - self.account = None - """the domain name of the resource limit""" - self.domain = None - """the domain ID of the resource limit""" - self.domainid = None - """the maximum number of the resource. A -1 means the resource currently has no limit.""" - self.max = None - """the project name of the resource limit""" - self.project = None - """the project id of the resource limit""" - self.projectid = None - """resource type. Values include 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11. See the resourceType parameter for more information on these values.""" - self.resourcetype = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateServiceOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateServiceOffering.py deleted file mode 100644 index ed5981403ec..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateServiceOffering.py +++ /dev/null @@ -1,113 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a service offering.""" -from baseCmd import * -from baseResponse import * -class updateServiceOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the service offering to be updated""" - """Required""" - self.id = None - """the display text of the service offering to be updated""" - self.displaytext = None - """the name of the service offering to be updated""" - self.name = None - """sort key of the service offering, integer""" - self.sortkey = None - self.required = ["id",] - -class updateServiceOfferingResponse (baseResponse): - def __init__(self): - """the id of the service offering""" - self.id = None - """the number of CPU""" - self.cpunumber = None - """the clock rate CPU speed in Mhz""" - self.cpuspeed = None - """the date this service offering was created""" - self.created = None - """is this a default system vm offering""" - self.defaultuse = None - """deployment strategy used to deploy VM.""" - self.deploymentplanner = None - """bytes read rate of the service offering""" - self.diskBytesReadRate = None - """bytes write rate of the service offering""" - self.diskBytesWriteRate = None - """io requests read rate of the service offering""" - self.diskIopsReadRate = None - """io requests write rate of the service offering""" - self.diskIopsWriteRate = None - """an alternate display text of the service offering.""" - self.displaytext = None - """Domain name for the offering""" - self.domain = None - """the domain id of the service offering""" - self.domainid = None - """the host tag for the service offering""" - self.hosttags = None - """is this a system vm offering""" - self.issystem = None - """true if the vm needs to be volatile, i.e., on every reboot of vm from API root disk is discarded and creates a new root disk""" - self.isvolatile = None - """restrict the CPU usage to committed service offering""" - self.limitcpuuse = None - """the memory in MB""" - self.memory = None - """the name of the service offering""" - self.name = None - """data transfer rate in megabits per second allowed.""" - self.networkrate = None - """the ha support in the service offering""" - self.offerha = None - """additional key/value details tied with this service offering""" - self.serviceofferingdetails = None - """the storage type for this service offering""" - self.storagetype = None - """is this a the systemvm type for system vm offering""" - self.systemvmtype = None - """the tags for the service offering""" - self.tags = None - """the list of resource tags associated with service offering. The resource tags are not used for Volume/VM placement on the specific host.""" - self.resourcetags = [] - -class resourcetags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateStorageNetworkIpRange.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateStorageNetworkIpRange.py deleted file mode 100644 index 8d398307fed..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateStorageNetworkIpRange.py +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Update a Storage network IP range, only allowed when no IPs in this range have been allocated.""" -from baseCmd import * -from baseResponse import * -class updateStorageNetworkIpRangeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """UUID of storage network ip range""" - """Required""" - self.id = None - """the ending IP address""" - self.endip = None - """the netmask for storage network""" - self.netmask = None - """the beginning IP address""" - self.startip = None - """Optional. the vlan the ip range sits on""" - self.vlan = None - self.required = ["id",] - -class updateStorageNetworkIpRangeResponse (baseResponse): - def __init__(self): - """the uuid of storage network IP range.""" - self.id = None - """the end ip of the storage network IP range""" - self.endip = None - """the gateway of the storage network IP range""" - self.gateway = None - """the netmask of the storage network IP range""" - self.netmask = None - """the network uuid of storage network IP range""" - self.networkid = None - """the Pod uuid for the storage network IP range""" - self.podid = None - """the start ip of the storage network IP range""" - self.startip = None - """the ID or VID of the VLAN.""" - self.vlan = None - """the Zone uuid of the storage network IP range""" - self.zoneid = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateStoragePool.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateStoragePool.py deleted file mode 100644 index d77e0e71d9e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateStoragePool.py +++ /dev/null @@ -1,84 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a storage pool.""" -from baseCmd import * -from baseResponse import * -class updateStoragePoolCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the Id of the storage pool""" - """Required""" - self.id = None - """bytes CloudStack can provision from this storage pool""" - self.capacitybytes = None - """IOPS CloudStack can provision from this storage pool""" - self.capacityiops = None - """comma-separated list of tags for the storage pool""" - self.tags = [] - self.required = ["id",] - -class updateStoragePoolResponse (baseResponse): - def __init__(self): - """the ID of the storage pool""" - self.id = None - """IOPS CloudStack can provision from this storage pool""" - self.capacityiops = None - """the ID of the cluster for the storage pool""" - self.clusterid = None - """the name of the cluster for the storage pool""" - self.clustername = None - """the date and time the storage pool was created""" - self.created = None - """the host's currently allocated disk size""" - self.disksizeallocated = None - """the total disk size of the storage pool""" - self.disksizetotal = None - """the host's currently used disk size""" - self.disksizeused = None - """the hypervisor type of the storage pool""" - self.hypervisor = None - """the IP address of the storage pool""" - self.ipaddress = None - """the name of the storage pool""" - self.name = None - """the storage pool path""" - self.path = None - """the Pod ID of the storage pool""" - self.podid = None - """the Pod name of the storage pool""" - self.podname = None - """the scope of the storage pool""" - self.scope = None - """the state of the storage pool""" - self.state = None - """true if this pool is suitable to migrate a volume, false otherwise""" - self.suitableformigration = None - """the tags for the storage pool""" - self.tags = None - """the storage pool type""" - self.type = None - """the Zone ID of the storage pool""" - self.zoneid = None - """the Zone name of the storage pool""" - self.zonename = None - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplate.py deleted file mode 100644 index 57873821ee4..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplate.py +++ /dev/null @@ -1,149 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates attributes of a template.""" -from baseCmd import * -from baseResponse import * -class updateTemplateCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the image file""" - """Required""" - self.id = None - """true if image is bootable, false otherwise""" - self.bootable = None - """the display text of the image""" - self.displaytext = None - """the format for the image""" - self.format = None - """true if template/ISO contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template type is routing i.e., if template is used to deploy router""" - self.isrouting = None - """the name of the image file""" - self.name = None - """the ID of the OS type that best represents the OS of this image.""" - self.ostypeid = None - """true if the image supports the password reset feature; default is false""" - self.passwordenabled = None - """sort key of the template, integer""" - self.sortkey = None - self.required = ["id",] - -class updateTemplateResponse (baseResponse): - def __init__(self): - """the template ID""" - self.id = None - """the account name to which the template belongs""" - self.account = None - """the account id to which the template belongs""" - self.accountid = None - """true if the ISO is bootable, false otherwise""" - self.bootable = None - """checksum of the template""" - self.checksum = None - """the date this template was created""" - self.created = None - """true if the template is managed across all Zones, false otherwise""" - self.crossZones = None - """additional key/value details tied with template""" - self.details = None - """the template display text""" - self.displaytext = None - """the name of the domain to which the template belongs""" - self.domain = None - """the ID of the domain to which the template belongs""" - self.domainid = None - """the format of the template.""" - self.format = None - """the ID of the secondary storage host for the template""" - self.hostid = None - """the name of the secondary storage host for the template""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """true if the template is extractable, false otherwise""" - self.isextractable = None - """true if this template is a featured template, false otherwise""" - self.isfeatured = None - """true if this template is a public template, false otherwise""" - self.ispublic = None - """true if the template is ready to be deployed from, false otherwise.""" - self.isready = None - """the template name""" - self.name = None - """the ID of the OS type for this template.""" - self.ostypeid = None - """the name of the OS type for this template.""" - self.ostypename = None - """true if the reset password feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the template""" - self.project = None - """the project id of the template""" - self.projectid = None - """the date this template was removed""" - self.removed = None - """the size of the template""" - self.size = None - """the template ID of the parent template if present""" - self.sourcetemplateid = None - """true if template is sshkey enabled, false otherwise""" - self.sshkeyenabled = None - """the status of the template""" - self.status = None - """the tag of this template""" - self.templatetag = None - """the type of the template""" - self.templatetype = None - """the ID of the zone for this template""" - self.zoneid = None - """the name of the zone for this template""" - self.zonename = None - """the list of resource tags associated with tempate""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplatePermissions.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplatePermissions.py deleted file mode 100644 index 88d01e04f11..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTemplatePermissions.py +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a template visibility permissions. A public template is visible to all accounts within the same domain. A private template is visible only to the owner of the template. A priviledged template is a private template with account permissions added. Only accounts specified under the template permissions are visible to them.""" -from baseCmd import * -from baseResponse import * -class updateTemplatePermissionsCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the template ID""" - """Required""" - self.id = None - """a comma delimited list of accounts. If specified, "op" parameter has to be passed in.""" - self.accounts = [] - """true if the template/iso is extractable, false other wise. Can be set only by root admin""" - self.isextractable = None - """true for featured template/iso, false otherwise""" - self.isfeatured = None - """true for public template/iso, false for private templates/isos""" - self.ispublic = None - """permission operator (add, remove, reset)""" - self.op = None - """a comma delimited list of projects. If specified, "op" parameter has to be passed in.""" - self.projectids = [] - self.required = ["id",] - -class updateTemplatePermissionsResponse (baseResponse): - def __init__(self): - """any text associated with the success or failure""" - self.displaytext = None - """true if operation is executed successfully""" - self.success = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTrafficType.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateTrafficType.py deleted file mode 100644 index 8d216421382..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateTrafficType.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. - - -"""Updates traffic type of a physical network""" -from baseCmd import * -from baseResponse import * -class updateTrafficTypeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """traffic type id""" - """Required""" - self.id = None - """The network name label of the physical device dedicated to this traffic on a KVM host""" - self.kvmnetworklabel = None - """The network name label of the physical device dedicated to this traffic on a VMware host""" - self.vmwarenetworklabel = None - """The network name label of the physical device dedicated to this traffic on a XenServer host""" - self.xennetworklabel = None - self.required = ["id",] - -class updateTrafficTypeResponse (baseResponse): - def __init__(self): - """id of the network provider""" - self.id = None - """The network name label of the physical device dedicated to this traffic on a KVM host""" - self.kvmnetworklabel = None - """the physical network this belongs to""" - self.physicalnetworkid = None - """the trafficType to be added to the physical network""" - self.traffictype = None - """The network name label of the physical device dedicated to this traffic on a VMware host""" - self.vmwarenetworklabel = None - """The network name label of the physical device dedicated to this traffic on a XenServer host""" - self.xennetworklabel = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateUser.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateUser.py deleted file mode 100644 index e60959b886f..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateUser.py +++ /dev/null @@ -1,82 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a user account""" -from baseCmd import * -from baseResponse import * -class updateUserCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """User uuid""" - """Required""" - self.id = None - """email""" - self.email = None - """first name""" - self.firstname = None - """last name""" - self.lastname = None - """Clear text password (default hashed to SHA256SALT). If you wish to use any other hasing algorithm, you would need to write a custom authentication adapter""" - self.password = None - """Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.""" - self.timezone = None - """The API key for the user. Must be specified with userSecretKey""" - self.userapikey = None - """Unique username""" - self.username = None - """The secret key for the user. Must be specified with userApiKey""" - self.usersecretkey = None - self.required = ["id",] - -class updateUserResponse (baseResponse): - def __init__(self): - """the user ID""" - self.id = None - """the account name of the user""" - self.account = None - """the account ID of the user""" - self.accountid = None - """the account type of the user""" - self.accounttype = None - """the api key of the user""" - self.apikey = None - """the date and time the user account was created""" - self.created = None - """the domain name of the user""" - self.domain = None - """the domain ID of the user""" - self.domainid = None - """the user email address""" - self.email = None - """the user firstname""" - self.firstname = None - """the boolean value representing if the updating target is in caller's child domain""" - self.iscallerchilddomain = None - """true if user is default, false otherwise""" - self.isdefault = None - """the user lastname""" - self.lastname = None - """the secret key of the user""" - self.secretkey = None - """the user state""" - self.state = None - """the timezone user was created in""" - self.timezone = None - """the user name""" - self.username = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVMAffinityGroup.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVMAffinityGroup.py deleted file mode 100644 index b5e63dc115e..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVMAffinityGroup.py +++ /dev/null @@ -1,373 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates the affinity/anti-affinity group associations of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect.""" -from baseCmd import * -from baseResponse import * -class updateVMAffinityGroupCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The ID of the virtual machine""" - """Required""" - self.id = None - """comma separated list of affinity groups id that are going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter""" - self.affinitygroupids = [] - """comma separated list of affinity groups names that are going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupids parameter""" - self.affinitygroupnames = [] - self.required = ["id",] - -class updateVMAffinityGroupResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPC.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPC.py deleted file mode 100644 index b43cb95f507..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPC.py +++ /dev/null @@ -1,398 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a VPC""" -from baseCmd import * -from baseResponse import * -class updateVPCCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the id of the VPC""" - """Required""" - self.id = None - """the name of the VPC""" - """Required""" - self.name = None - """the display text of the VPC""" - self.displaytext = None - self.required = ["id","name",] - -class updateVPCResponse (baseResponse): - def __init__(self): - """the id of the VPC""" - self.id = None - """the owner of the VPC""" - self.account = None - """the cidr the VPC""" - self.cidr = None - """the date this VPC was created""" - self.created = None - """an alternate display text of the VPC.""" - self.displaytext = None - """the domain name of the owner""" - self.domain = None - """the domain id of the VPC owner""" - self.domainid = None - """the name of the VPC""" - self.name = None - """the network domain of the VPC""" - self.networkdomain = None - """the project name of the VPC""" - self.project = None - """the project id of the VPC""" - self.projectid = None - """true VPC requires restart""" - self.restartrequired = None - """state of the VPC. Can be Inactive/Enabled""" - self.state = None - """vpc offering id the VPC is created from""" - self.vpcofferingid = None - """zone id of the vpc""" - self.zoneid = None - """the name of the zone the VPC belongs to""" - self.zonename = None - """the list of networks belongign to the VPC""" - self.network = [] - """the list of supported services""" - self.service = [] - """the list of resource tags associated with the project""" - self.tags = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class network: - def __init__(self): - """"the id of the network""" - self.id = None - """"the owner of the network""" - self.account = None - """"ACL Id associated with the VPC network""" - self.aclid = None - """"acl type - access type to the network""" - self.acltype = None - """"Broadcast domain type of the network""" - self.broadcastdomaintype = None - """"broadcast uri of the network. This parameter is visible to ROOT admins only""" - self.broadcasturi = None - """"list networks available for vm deployment""" - self.canusefordeploy = None - """"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR""" - self.cidr = None - """"an optional field, whether to the display the network to the end user or not.""" - self.displaynetwork = None - """"the displaytext of the network""" - self.displaytext = None - """"the first DNS for the network""" - self.dns1 = None - """"the second DNS for the network""" - self.dns2 = None - """"the domain name of the network owner""" - self.domain = None - """"the domain id of the network owner""" - self.domainid = None - """"the network's gateway""" - self.gateway = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"true if network is default, false otherwise""" - self.isdefault = None - """"list networks that are persistent""" - self.ispersistent = None - """"true if network is system, false otherwise""" - self.issystem = None - """"the name of the network""" - self.name = None - """"the network's netmask""" - self.netmask = None - """"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE""" - self.networkcidr = None - """"the network domain""" - self.networkdomain = None - """"availability of the network offering the network is created from""" - self.networkofferingavailability = None - """"true if network offering is ip conserve mode enabled""" - self.networkofferingconservemode = None - """"display text of the network offering the network is created from""" - self.networkofferingdisplaytext = None - """"network offering id the network is created from""" - self.networkofferingid = None - """"name of the network offering the network is created from""" - self.networkofferingname = None - """"the physical network id""" - self.physicalnetworkid = None - """"the project name of the address""" - self.project = None - """"the project id of the ipaddress""" - self.projectid = None - """"related to what other network configuration""" - self.related = None - """"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes""" - self.reservediprange = None - """"true network requires restart""" - self.restartrequired = None - """"true if network supports specifying ip ranges, false otherwise""" - self.specifyipranges = None - """"state of the network""" - self.state = None - """"true if users from subdomains can access the domain level network""" - self.subdomainaccess = None - """"the traffic type of the network""" - self.traffictype = None - """"the type of the network""" - self.type = None - """"The vlan of the network. This parameter is visible to ROOT admins only""" - self.vlan = None - """"VPC the network belongs to""" - self.vpcid = None - """"zone id of the network""" - self.zoneid = None - """"the name of the zone the network belongs to""" - self.zonename = None - """"the list of services""" - self.service = [] - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - """"the list of resource tags associated with network""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPCOffering.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPCOffering.py deleted file mode 100644 index aab8917335c..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVPCOffering.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. - - -"""Updates VPC offering""" -from baseCmd import * -from baseResponse import * -class updateVPCOfferingCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the id of the VPC offering""" - """Required""" - self.id = None - """the display text of the VPC offering""" - self.displaytext = None - """the name of the VPC offering""" - self.name = None - """update state for the VPC offering; supported states - Enabled/Disabled""" - self.state = None - self.required = ["id",] - -class updateVPCOfferingResponse (baseResponse): - def __init__(self): - """the id of the vpc offering""" - self.id = None - """the date this vpc offering was created""" - self.created = None - """an alternate display text of the vpc offering.""" - self.displaytext = None - """true if vpc offering is default, false otherwise""" - self.isdefault = None - """the name of the vpc offering""" - self.name = None - """state of the vpc offering. Can be Disabled/Enabled""" - self.state = None - """the list of supported services""" - self.service = [] - -class capability: - def __init__(self): - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - -class provider: - def __init__(self): - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - -class service: - def __init__(self): - """"the service name""" - self.name = None - """"the list of capabilities""" - self.capability = [] - """"can this service capability value can be choosable while creatine network offerings""" - self.canchooseservicecapability = None - """"the capability name""" - self.name = None - """"the capability value""" - self.value = None - """"the service provider name""" - self.provider = [] - """"uuid of the network provider""" - self.id = None - """"true if individual services can be enabled/disabled""" - self.canenableindividualservice = None - """"the destination physical network""" - self.destinationphysicalnetworkid = None - """"the provider name""" - self.name = None - """"the physical network this belongs to""" - self.physicalnetworkid = None - """"services for this provider""" - self.servicelist = None - """"state of the network provider""" - self.state = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVirtualMachine.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVirtualMachine.py deleted file mode 100644 index b1ad6e4193b..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVirtualMachine.py +++ /dev/null @@ -1,383 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates properties of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect. UpdateVirtualMachine does not first check whether the VM is stopped. Therefore, stop the VM manually before issuing this call.""" -from baseCmd import * -from baseResponse import * -class updateVirtualMachineCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """The ID of the virtual machine""" - """Required""" - self.id = None - """user generated name""" - self.displayname = None - """an optional field, whether to the display the vm to the end user or not.""" - self.displayvm = None - """group of the virtual machine""" - self.group = None - """true if high-availability is enabled for the virtual machine, false otherwise""" - self.haenable = None - """true if VM contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory""" - self.isdynamicallyscalable = None - """the ID of the OS type that best represents this VM.""" - self.ostypeid = None - """an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding. Using HTTP POST(via POST body), you can send up to 32K of data after base64 encoding.""" - self.userdata = None - self.required = ["id",] - -class updateVirtualMachineResponse (baseResponse): - def __init__(self): - """the ID of the virtual machine""" - self.id = None - """the account associated with the virtual machine""" - self.account = None - """the number of cpu this virtual machine is running with""" - self.cpunumber = None - """the speed of each cpu""" - self.cpuspeed = None - """the amount of the vm's CPU currently used""" - self.cpuused = None - """the date when this virtual machine was created""" - self.created = None - """the read (io) of disk on the vm""" - self.diskioread = None - """the write (io) of disk on the vm""" - self.diskiowrite = None - """the read (bytes) of disk on the vm""" - self.diskkbsread = None - """the write (bytes) of disk on the vm""" - self.diskkbswrite = None - """user generated name. The name of the virtual machine is returned if no displayname exists.""" - self.displayname = None - """an optional field whether to the display the vm to the end user or not.""" - self.displayvm = None - """the name of the domain in which the virtual machine exists""" - self.domain = None - """the ID of the domain in which the virtual machine exists""" - self.domainid = None - """the virtual network for the service offering""" - self.forvirtualnetwork = None - """the group name of the virtual machine""" - self.group = None - """the group ID of the virtual machine""" - self.groupid = None - """Os type ID of the virtual machine""" - self.guestosid = None - """true if high-availability is enabled, false otherwise""" - self.haenable = None - """the ID of the host for the virtual machine""" - self.hostid = None - """the name of the host for the virtual machine""" - self.hostname = None - """the hypervisor on which the template runs""" - self.hypervisor = None - """instance name of the user vm; this parameter is returned to the ROOT admin only""" - self.instancename = None - """true if vm contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory.""" - self.isdynamicallyscalable = None - """an alternate display text of the ISO attached to the virtual machine""" - self.isodisplaytext = None - """the ID of the ISO attached to the virtual machine""" - self.isoid = None - """the name of the ISO attached to the virtual machine""" - self.isoname = None - """ssh key-pair""" - self.keypair = None - """the memory allocated for the virtual machine""" - self.memory = None - """the name of the virtual machine""" - self.name = None - """the incoming network traffic on the vm""" - self.networkkbsread = None - """the outgoing network traffic on the host""" - self.networkkbswrite = None - """the password (if exists) of the virtual machine""" - self.password = None - """true if the password rest feature is enabled, false otherwise""" - self.passwordenabled = None - """the project name of the vm""" - self.project = None - """the project id of the vm""" - self.projectid = None - """public IP address id associated with vm via Static nat rule""" - self.publicip = None - """public IP address id associated with vm via Static nat rule""" - self.publicipid = None - """device ID of the root volume""" - self.rootdeviceid = None - """device type of the root volume""" - self.rootdevicetype = None - """the ID of the service offering of the virtual machine""" - self.serviceofferingid = None - """the name of the service offering of the virtual machine""" - self.serviceofferingname = None - """State of the Service from LB rule""" - self.servicestate = None - """the state of the virtual machine""" - self.state = None - """an alternate display text of the template for the virtual machine""" - self.templatedisplaytext = None - """the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.""" - self.templateid = None - """the name of the template for the virtual machine""" - self.templatename = None - """the ID of the availablility zone for the virtual machine""" - self.zoneid = None - """the name of the availability zone for the virtual machine""" - self.zonename = None - """list of affinity groups associated with the virtual machine""" - self.affinitygroup = [] - """the list of nics associated with vm""" - self.nic = [] - """list of security groups associated with the virtual machine""" - self.securitygroup = [] - """the list of resource tags associated with vm""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class affinitygroup: - def __init__(self): - """"the ID of the affinity group""" - self.id = None - """"the account owning the affinity group""" - self.account = None - """"the description of the affinity group""" - self.description = None - """"the domain name of the affinity group""" - self.domain = None - """"the domain ID of the affinity group""" - self.domainid = None - """"the name of the affinity group""" - self.name = None - """"the type of the affinity group""" - self.type = None - """"virtual machine Ids associated with this affinity group""" - self.virtualmachineIds = None - -class nic: - def __init__(self): - """"the ID of the nic""" - self.id = None - """"the broadcast uri of the nic""" - self.broadcasturi = None - """"the gateway of the nic""" - self.gateway = None - """"the IPv6 address of network""" - self.ip6address = None - """"the cidr of IPv6 network""" - self.ip6cidr = None - """"the gateway of IPv6 network""" - self.ip6gateway = None - """"the ip address of the nic""" - self.ipaddress = None - """"true if nic is default, false otherwise""" - self.isdefault = None - """"the isolation uri of the nic""" - self.isolationuri = None - """"true if nic is default, false otherwise""" - self.macaddress = None - """"the netmask of the nic""" - self.netmask = None - """"the ID of the corresponding network""" - self.networkid = None - """"the name of the corresponding network""" - self.networkname = None - """"the Secondary ipv4 addr of nic""" - self.secondaryip = None - """"the traffic type of the nic""" - self.traffictype = None - """"the type of the nic""" - self.type = None - -class egressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class ingressrule: - def __init__(self): - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - -class securitygroup: - def __init__(self): - """"the ID of the security group""" - self.id = None - """"the account owning the security group""" - self.account = None - """"the description of the security group""" - self.description = None - """"the domain name of the security group""" - self.domain = None - """"the domain ID of the security group""" - self.domainid = None - """"the name of the security group""" - self.name = None - """"the project name of the group""" - self.project = None - """"the project id of the group""" - self.projectid = None - """"the list of egress rules associated with the security group""" - self.egressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of ingress rules associated with the security group""" - self.ingressrule = [] - """"account owning the security group rule""" - self.account = None - """"the CIDR notation for the base IP address of the security group rule""" - self.cidr = None - """"the ending IP of the security group rule""" - self.endport = None - """"the code for the ICMP message response""" - self.icmpcode = None - """"the type of the ICMP message response""" - self.icmptype = None - """"the protocol of the security group rule""" - self.protocol = None - """"the id of the security group rule""" - self.ruleid = None - """"security group name""" - self.securitygroupname = None - """"the starting IP of the security group rule""" - self.startport = None - """"the list of resource tags associated with the rule""" - self.tags = [] - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - """"the ID of the latest async job acting on this object""" - self.jobid = None - """"the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVolume.py deleted file mode 100644 index 5955ec1e4e1..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVolume.py +++ /dev/null @@ -1,150 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates the volume.""" -from baseCmd import * -from baseResponse import * -class updateVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """an optional field, whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the ID of the disk volume""" - self.id = None - """The path of the volume""" - self.path = None - """The state of the volume""" - self.state = None - """Destination storage pool UUID for the volume""" - self.storageid = None - self.required = [] - -class updateVolumeResponse (baseResponse): - def __init__(self): - """ID of the disk volume""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the date the volume was attached to a VM instance""" - self.attached = None - """the date the disk volume was created""" - self.created = None - """the boolean state of whether the volume is destroyed or not""" - self.destroyed = None - """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" - self.deviceid = None - """bytes read rate of the disk volume""" - self.diskBytesReadRate = None - """bytes write rate of the disk volume""" - self.diskBytesWriteRate = None - """io requests read rate of the disk volume""" - self.diskIopsReadRate = None - """io requests write rate of the disk volume""" - self.diskIopsWriteRate = None - """the display text of the disk offering""" - self.diskofferingdisplaytext = None - """ID of the disk offering""" - self.diskofferingid = None - """name of the disk offering""" - self.diskofferingname = None - """an optional field whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """Hypervisor the volume belongs to""" - self.hypervisor = None - """true if the volume is extractable, false otherwise""" - self.isextractable = None - """max iops of the disk volume""" - self.maxiops = None - """min iops of the disk volume""" - self.miniops = None - """name of the disk volume""" - self.name = None - """The path of the volume""" - self.path = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the display text of the service offering for root disk""" - self.serviceofferingdisplaytext = None - """ID of the service offering for root disk""" - self.serviceofferingid = None - """name of the service offering for root disk""" - self.serviceofferingname = None - """size of the disk volume""" - self.size = None - """ID of the snapshot from which this volume was created""" - self.snapshotid = None - """the state of the disk volume""" - self.state = None - """the status of the volume""" - self.status = None - """name of the primary storage hosting the disk volume""" - self.storage = None - """id of the primary storage hosting the disk volume; returned to admin user only""" - self.storageid = None - """shared or local storage""" - self.storagetype = None - """type of the disk volume (ROOT or DATADISK)""" - self.type = None - """id of the virtual machine""" - self.virtualmachineid = None - """display name of the virtual machine""" - self.vmdisplayname = None - """name of the virtual machine""" - self.vmname = None - """state of the virtual machine""" - self.vmstate = None - """ID of the availability zone""" - self.zoneid = None - """name of the availability zone""" - self.zonename = None - """the list of resource tags associated with volume""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVpnCustomerGateway.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateVpnCustomerGateway.py deleted file mode 100644 index 959473a382d..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateVpnCustomerGateway.py +++ /dev/null @@ -1,93 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Update site to site vpn customer gateway""" -from baseCmd import * -from baseResponse import * -class updateVpnCustomerGatewayCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """id of customer gateway""" - """Required""" - self.id = None - """guest cidr of the customer gateway""" - """Required""" - self.cidrlist = None - """ESP policy of the customer gateway""" - """Required""" - self.esppolicy = None - """public ip address id of the customer gateway""" - """Required""" - self.gateway = None - """IKE policy of the customer gateway""" - """Required""" - self.ikepolicy = None - """IPsec Preshared-Key of the customer gateway""" - """Required""" - self.ipsecpsk = None - """the account associated with the gateway. Must be used with the domainId parameter.""" - self.account = None - """the domain ID associated with the gateway. If used with the account parameter returns the gateway associated with the account for the specified domain.""" - self.domainid = None - """If DPD is enabled for VPN connection""" - self.dpd = None - """Lifetime of phase 2 VPN connection to the customer gateway, in seconds""" - self.esplifetime = None - """Lifetime of phase 1 VPN connection to the customer gateway, in seconds""" - self.ikelifetime = None - """name of this customer gateway""" - self.name = None - self.required = ["id","cidrlist","esppolicy","gateway","ikepolicy","ipsecpsk",] - -class updateVpnCustomerGatewayResponse (baseResponse): - def __init__(self): - """the vpn gateway ID""" - self.id = None - """the owner""" - self.account = None - """guest cidr list of the customer gateway""" - self.cidrlist = None - """the domain name of the owner""" - self.domain = None - """the domain id of the owner""" - self.domainid = None - """if DPD is enabled for customer gateway""" - self.dpd = None - """Lifetime of ESP SA of customer gateway""" - self.esplifetime = None - """IPsec policy of customer gateway""" - self.esppolicy = None - """public ip address id of the customer gateway""" - self.gateway = None - """Lifetime of IKE SA of customer gateway""" - self.ikelifetime = None - """IKE policy of customer gateway""" - self.ikepolicy = None - """guest ip of the customer gateway""" - self.ipaddress = None - """IPsec preshared-key of customer gateway""" - self.ipsecpsk = None - """name of the customer gateway""" - self.name = None - """the project name""" - self.project = None - """the project id""" - self.projectid = None - """the date and time the host was removed""" - self.removed = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/updateZone.py b/tools/marvin/build/lib/marvin/cloudstackAPI/updateZone.py deleted file mode 100644 index b1b436007b3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/updateZone.py +++ /dev/null @@ -1,154 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Updates a Zone.""" -from baseCmd import * -from baseResponse import * -class updateZoneCmd (baseCmd): - def __init__(self): - self.isAsync = "false" - """the ID of the Zone""" - """Required""" - self.id = None - """Allocation state of this cluster for allocation of new resources""" - self.allocationstate = None - """the details for the Zone""" - self.details = [] - """the dhcp Provider for the Zone""" - self.dhcpprovider = None - """the first DNS for the Zone""" - self.dns1 = None - """the second DNS for the Zone""" - self.dns2 = None - """the dns search order list""" - self.dnssearchorder = [] - """Network domain name for the networks in the zone; empty string will update domain with NULL value""" - self.domain = None - """the guest CIDR address for the Zone""" - self.guestcidraddress = None - """the first internal DNS for the Zone""" - self.internaldns1 = None - """the second internal DNS for the Zone""" - self.internaldns2 = None - """the first DNS for IPv6 network in the Zone""" - self.ip6dns1 = None - """the second DNS for IPv6 network in the Zone""" - self.ip6dns2 = None - """updates a private zone to public if set, but not vice-versa""" - self.ispublic = None - """true if local storage offering enabled, false otherwise""" - self.localstorageenabled = None - """the name of the Zone""" - self.name = None - self.required = ["id",] - -class updateZoneResponse (baseResponse): - def __init__(self): - """Zone id""" - self.id = None - """the allocation state of the cluster""" - self.allocationstate = None - """Zone description""" - self.description = None - """the dhcp Provider for the Zone""" - self.dhcpprovider = None - """the display text of the zone""" - self.displaytext = None - """the first DNS for the Zone""" - self.dns1 = None - """the second DNS for the Zone""" - self.dns2 = None - """Network domain name for the networks in the zone""" - self.domain = None - """the UUID of the containing domain, null for public zones""" - self.domainid = None - """the name of the containing domain, null for public zones""" - self.domainname = None - """the guest CIDR address for the Zone""" - self.guestcidraddress = None - """the first internal DNS for the Zone""" - self.internaldns1 = None - """the second internal DNS for the Zone""" - self.internaldns2 = None - """the first IPv6 DNS for the Zone""" - self.ip6dns1 = None - """the second IPv6 DNS for the Zone""" - self.ip6dns2 = None - """true if local storage offering enabled, false otherwise""" - self.localstorageenabled = None - """Zone name""" - self.name = None - """the network type of the zone; can be Basic or Advanced""" - self.networktype = None - """true if security groups support is enabled, false otherwise""" - self.securitygroupsenabled = None - """the vlan range of the zone""" - self.vlan = None - """Zone Token""" - self.zonetoken = None - """the capacity of the Zone""" - self.capacity = [] - """the list of resource tags associated with zone.""" - self.tags = [] - -class capacity: - def __init__(self): - """"the total capacity available""" - self.capacitytotal = None - """"the capacity currently in use""" - self.capacityused = None - """"the Cluster ID""" - self.clusterid = None - """"the Cluster name""" - self.clustername = None - """"the percentage of capacity currently in use""" - self.percentused = None - """"the Pod ID""" - self.podid = None - """"the Pod name""" - self.podname = None - """"the capacity type""" - self.type = None - """"the Zone ID""" - self.zoneid = None - """"the Zone name""" - self.zonename = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/uploadCustomCertificate.py b/tools/marvin/build/lib/marvin/cloudstackAPI/uploadCustomCertificate.py deleted file mode 100644 index d84f448fa52..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/uploadCustomCertificate.py +++ /dev/null @@ -1,43 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Uploads a custom certificate for the console proxy VMs to use for SSL. Can be used to upload a single certificate signed by a known CA. Can also be used, through multiple calls, to upload a chain of certificates from CA to the custom certificate itself.""" -from baseCmd import * -from baseResponse import * -class uploadCustomCertificateCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """The certificate to be uploaded.""" - """Required""" - self.certificate = None - """DNS domain suffix that the certificate is granted for.""" - """Required""" - self.domainsuffix = None - """An integer providing the location in a chain that the certificate will hold. Usually, this can be left empty. When creating a chain, the top level certificate should have an ID of 1, with each step in the chain incrementing by one. Example, CA with id = 1, Intermediate CA with id = 2, Site certificate with ID = 3""" - self.id = None - """A name / alias for the certificate.""" - self.name = None - """The private key for the attached certificate.""" - self.privatekey = None - self.required = ["certificate","domainsuffix",] - -class uploadCustomCertificateResponse (baseResponse): - def __init__(self): - """message of the certificate upload operation""" - self.message = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackAPI/uploadVolume.py b/tools/marvin/build/lib/marvin/cloudstackAPI/uploadVolume.py deleted file mode 100644 index acd4a0ebb86..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackAPI/uploadVolume.py +++ /dev/null @@ -1,162 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -"""Uploads a data disk.""" -from baseCmd import * -from baseResponse import * -class uploadVolumeCmd (baseCmd): - def __init__(self): - self.isAsync = "true" - """the format for the volume. Possible values include QCOW2, OVA, and VHD.""" - """Required""" - self.format = None - """the name of the volume""" - """Required""" - self.name = None - """the URL of where the volume is hosted. Possible URL include http:// and https://""" - """Required""" - self.url = None - """the ID of the zone the volume is to be hosted on""" - """Required""" - self.zoneid = None - """an optional accountName. Must be used with domainId.""" - self.account = None - """the MD5 checksum value of this volume""" - self.checksum = None - """an optional domainId. If the account parameter is used, domainId must also be used.""" - self.domainid = None - """Image store uuid""" - self.imagestoreuuid = None - """Upload volume for the project""" - self.projectid = None - self.required = ["format","name","url","zoneid",] - -class uploadVolumeResponse (baseResponse): - def __init__(self): - """ID of the disk volume""" - self.id = None - """the account associated with the disk volume""" - self.account = None - """the date the volume was attached to a VM instance""" - self.attached = None - """the date the disk volume was created""" - self.created = None - """the boolean state of whether the volume is destroyed or not""" - self.destroyed = None - """the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached.""" - self.deviceid = None - """bytes read rate of the disk volume""" - self.diskBytesReadRate = None - """bytes write rate of the disk volume""" - self.diskBytesWriteRate = None - """io requests read rate of the disk volume""" - self.diskIopsReadRate = None - """io requests write rate of the disk volume""" - self.diskIopsWriteRate = None - """the display text of the disk offering""" - self.diskofferingdisplaytext = None - """ID of the disk offering""" - self.diskofferingid = None - """name of the disk offering""" - self.diskofferingname = None - """an optional field whether to the display the volume to the end user or not.""" - self.displayvolume = None - """the domain associated with the disk volume""" - self.domain = None - """the ID of the domain associated with the disk volume""" - self.domainid = None - """Hypervisor the volume belongs to""" - self.hypervisor = None - """true if the volume is extractable, false otherwise""" - self.isextractable = None - """max iops of the disk volume""" - self.maxiops = None - """min iops of the disk volume""" - self.miniops = None - """name of the disk volume""" - self.name = None - """The path of the volume""" - self.path = None - """the project name of the vpn""" - self.project = None - """the project id of the vpn""" - self.projectid = None - """the display text of the service offering for root disk""" - self.serviceofferingdisplaytext = None - """ID of the service offering for root disk""" - self.serviceofferingid = None - """name of the service offering for root disk""" - self.serviceofferingname = None - """size of the disk volume""" - self.size = None - """ID of the snapshot from which this volume was created""" - self.snapshotid = None - """the state of the disk volume""" - self.state = None - """the status of the volume""" - self.status = None - """name of the primary storage hosting the disk volume""" - self.storage = None - """id of the primary storage hosting the disk volume; returned to admin user only""" - self.storageid = None - """shared or local storage""" - self.storagetype = None - """type of the disk volume (ROOT or DATADISK)""" - self.type = None - """id of the virtual machine""" - self.virtualmachineid = None - """display name of the virtual machine""" - self.vmdisplayname = None - """name of the virtual machine""" - self.vmname = None - """state of the virtual machine""" - self.vmstate = None - """ID of the availability zone""" - self.zoneid = None - """name of the availability zone""" - self.zonename = None - """the list of resource tags associated with volume""" - self.tags = [] - """the ID of the latest async job acting on this object""" - self.jobid = None - """the current status of the latest async job acting on this object""" - self.jobstatus = None - -class tags: - def __init__(self): - """"the account associated with the tag""" - self.account = None - """"customer associated with the tag""" - self.customer = None - """"the domain associated with the tag""" - self.domain = None - """"the ID of the domain associated with the tag""" - self.domainid = None - """"tag key name""" - self.key = None - """"the project name where tag belongs to""" - self.project = None - """"the project id the tag belongs to""" - self.projectid = None - """"id of the resource""" - self.resourceid = None - """"resource type""" - self.resourcetype = None - """"tag value""" - self.value = None - diff --git a/tools/marvin/build/lib/marvin/cloudstackConnection.py b/tools/marvin/build/lib/marvin/cloudstackConnection.py deleted file mode 100644 index 686c533b86a..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackConnection.py +++ /dev/null @@ -1,235 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 requests -import urllib -import base64 -import hmac -import hashlib -import logging -import time -import cloudstackException -from cloudstackAPI import * -import jsonHelper -from requests import ConnectionError -from requests import HTTPError -from requests import Timeout -from requests import RequestException - - -class cloudConnection(object): - - """ Connections to make API calls to the cloudstack management server - """ - - def __init__(self, mgtSvr, port=8096, user=None, passwd=None, - apiKey=None, securityKey=None, - asyncTimeout=3600, logging=None, scheme='http', - path='client/api'): - self.loglevel() # Turn off requests logs - self.apiKey = apiKey - self.securityKey = securityKey - self.mgtSvr = mgtSvr - self.port = port - self.user = user - self.passwd = passwd - self.logging = logging - self.path = path - self.retries = 5 - self.asyncTimeout = asyncTimeout - self.auth = True - if port == 8096 or \ - (self.apiKey is None and self.securityKey is None): - self.auth = False - if scheme not in ['http', 'https']: - raise RequestException("Protocol must be HTTP") - self.protocol = scheme - self.baseurl = "%s://%s:%d/%s"\ - % (self.protocol, self.mgtSvr, self.port, self.path) - - def __copy__(self): - return cloudConnection(self.mgtSvr, self.port, self.user, self.passwd, - self.apiKey, self.securityKey, - self.asyncTimeout, self.logging, self.protocol, - self.path) - - def loglevel(self, lvl=logging.WARNING): - """ - Turns off the INFO/DEBUG logs from `requests` - """ - requests_log = logging.getLogger("requests") - requests_log.setLevel(lvl) - - def poll(self, jobid, response): - """ - polls the completion of a given jobid - @param jobid: - @param response: - @return: - """ - cmd = queryAsyncJobResult.queryAsyncJobResultCmd() - cmd.jobid = jobid - timeout = self.asyncTimeout - - while timeout > 0: - asyncResonse = self.marvin_request(cmd, response_type=response) - - if asyncResonse.jobstatus == 2: - raise cloudstackException.cloudstackAPIException( - "asyncquery", asyncResonse.jobresult) - elif asyncResonse.jobstatus == 1: - return asyncResonse - - time.sleep(5) - if self.logging is not None: - self.logging.debug("job: %s still processing," - " will timeout in %ds" % (jobid, timeout)) - timeout = timeout - 5 - - raise cloudstackException.cloudstackAPIException( - "asyncquery", "Async job timeout %s" % jobid) - - def sign(self, payload): - """ - signs a given request URL when the apiKey and secretKey are known - - @param payload: dict of GET params to be signed - @return: the signature of the payload - """ - params = zip(payload.keys(), payload.values()) - params.sort(key=lambda k: str.lower(k[0])) - hashStr = "&".join( - ["=".join( - [str.lower(r[0]), - str.lower( - urllib.quote_plus(str(r[1])) - ).replace("+", "%20")] - ) for r in params] - ) - signature = base64.encodestring(hmac.new( - self.securityKey, hashStr, hashlib.sha1).digest()).strip() - self.logging.debug("Computed Signature by Marvin: %s" % signature) - return signature - - def request(self, command, auth=True, payload={}, method='GET'): - """ - Makes requests using auth or over integration port - @param command: cloudstack API command name - eg: deployVirtualMachineCommand - @param auth: Authentication (apikey,secretKey) => True - else False for integration.api.port - @param payload: request data composed as a dictionary - @param method: GET/POST via HTTP - @return: - """ - payload["command"] = command - payload["response"] = "json" - - if auth: - payload["apiKey"] = self.apiKey - signature = self.sign(payload) - payload["signature"] = signature - - try: - if method == 'POST': - response = requests.post( - self.baseurl, params=payload, verify=False) - else: - response = requests.get( - self.baseurl, params=payload, verify=False) - except ConnectionError, c: - self.logging.debug("Connection refused. Reason: %s : %s" % - (self.baseurl, c)) - raise c - except HTTPError, h: - self.logging.debug("Server returned error code: %s" % h) - raise h - except Timeout, t: - self.logging.debug("Connection timed out with %s" % t) - raise t - except RequestException, r: - self.logging.debug("Error returned by server %s" % r) - raise r - else: - return response - - def sanitize_command(self, cmd): - """ - Removes None values, Validates all required params are present - @param cmd: Cmd object eg: createPhysicalNetwork - @return: - """ - requests = {} - required = [] - for attribute in dir(cmd): - if not attribute.startswith('__'): - if attribute == "isAsync": - isAsync = getattr(cmd, attribute) - elif attribute == "required": - required = getattr(cmd, attribute) - else: - requests[attribute] = getattr(cmd, attribute) - - cmdname = cmd.__class__.__name__.replace("Cmd", "") - for requiredPara in required: - if requests[requiredPara] is None: - raise cloudstackException.cloudstackAPIException( - cmdname, "%s is required" % requiredPara) - for param, value in requests.items(): - if value is None: - requests.pop(param) - elif isinstance(value, list): - if len(value) == 0: - requests.pop(param) - else: - if not isinstance(value[0], dict): - requests[param] = ",".join(value) - else: - requests.pop(param) - i = 0 - for val in value: - for k, v in val.iteritems(): - requests["%s[%d].%s" % (param, i, k)] = v - i = i + 1 - return cmdname, isAsync, requests - - def marvin_request(self, cmd, response_type=None, method='GET', data=''): - """ - Requester for marvin command objects - @param cmd: marvin's command from cloudstackAPI - @param response_type: response type of the command in cmd - @param method: HTTP GET/POST, defaults to GET - @return: - """ - cmdname, isAsync, payload = self.sanitize_command(cmd) - self.logging.debug("sending %s request: %s %s" % (method, cmdname, - str(payload))) - response = self.request( - cmdname, self.auth, payload=payload, method=method) - self.logging.debug("Request: %s Response: %s" % - (response.url, response.text)) - try: - response = jsonHelper.getResultObj(response.json(), response_type) - except TypeError: - response = jsonHelper.getResultObj(response.json, response_type) - - if isAsync == "false": - return response - else: - asyncJobId = response.jobid - response = self.poll(asyncJobId, response_type) - return response.jobresult diff --git a/tools/marvin/build/lib/marvin/cloudstackException.py b/tools/marvin/build/lib/marvin/cloudstackException.py deleted file mode 100644 index 6200003bbc3..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackException.py +++ /dev/null @@ -1,48 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -class cloudstackAPIException(Exception): - def __init__(self, cmd="", result=""): - self.errorMsg = "Execute cmd: %s failed, due to: %s" % (cmd, result) - - def __str__(self): - return self.errorMsg - - -class InvalidParameterException(Exception): - def __init__(self, msg=''): - self.errorMsg = msg - - def __str__(self): - return self.errorMsg - - -class dbException(Exception): - def __init__(self, msg=''): - self.errorMsg = msg - - def __str__(self): - return self.errorMsg - - -class internalError(Exception): - def __init__(self, msg=''): - self.errorMsg = msg - - def __str__(self): - return self.errorMsg diff --git a/tools/marvin/build/lib/marvin/cloudstackTestCase.py b/tools/marvin/build/lib/marvin/cloudstackTestCase.py deleted file mode 100644 index 85ef5423091..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackTestCase.py +++ /dev/null @@ -1,40 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 - - -def user(Name, DomainName, AcctType): - def wrapper(cls): - orig_init = cls.__init__ - - def __init__(self, *args, **kws): - cls.UserName = Name - cls.DomainName = DomainName - cls.AcctType = AcctType - orig_init(self, *args, **kws) - cls.__init__ = __init__ - return cls - return wrapper - - -class cloudstackTestCase(unittest.case.TestCase): - clstestclient = None - - @classmethod - def getClsTestClient(cls): - return cls.clstestclient diff --git a/tools/marvin/build/lib/marvin/cloudstackTestClient.py b/tools/marvin/build/lib/marvin/cloudstackTestClient.py deleted file mode 100644 index 36f7f8d8369..00000000000 --- a/tools/marvin/build/lib/marvin/cloudstackTestClient.py +++ /dev/null @@ -1,201 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 cloudstackConnection -import asyncJobMgr -import dbConnection -from cloudstackAPI import * -import random -import string -import hashlib - - -class cloudstackTestClient(object): - def __init__(self, mgtSvr=None, port=8096, user=None, passwd=None, - apiKey=None, securityKey=None, asyncTimeout=3600, - defaultWorkerThreads=10, logging=None): - self.connection = \ - cloudstackConnection.cloudConnection(mgtSvr, port, user, passwd, - apiKey, securityKey, - asyncTimeout, logging) - self.apiClient =\ - cloudstackAPIClient.CloudStackAPIClient(self.connection) - self.dbConnection = None - self.asyncJobMgr = None - self.ssh = None - self.id = None - self.defaultWorkerThreads = defaultWorkerThreads - - @property - def identifier(self): - return self.id - - @identifier.setter - def identifier(self, id): - self.id = id - - def dbConfigure(self, host="localhost", port=3306, user='cloud', - passwd='cloud', db='cloud'): - self.dbConnection = dbConnection.dbConnection(host, port, user, passwd, - db) - - def isAdminContext(self): - """ - A user is a regular user if he fails to listDomains; - if he is a domain-admin, he can list only domains that are non-ROOT; - if he is an admin, he can list the ROOT domain successfully - """ - try: - listdom = listDomains.listDomainsCmd() - listdom.name = 'ROOT' - listdomres = self.apiClient.listDomains(listdom) - rootdom = listdomres[0].name - if rootdom == 'ROOT': - return 1 # admin - else: - return 2 # domain-admin - except: - return 0 # user - - def random_gen(self, size=6, chars=string.ascii_uppercase + string.digits): - """Generate Random Strings of variable length""" - randomstr = ''.join(random.choice(chars) for x in range(size)) - if self.identifier: - return ''.join([self.identifier, '-', randomstr]) - return randomstr - - def createUserApiClient(self, UserName, DomainName, acctType=0): - if not self.isAdminContext(): - return self.apiClient - - listDomain = listDomains.listDomainsCmd() - listDomain.listall = True - listDomain.name = DomainName - try: - domains = self.apiClient.listDomains(listDomain) - domId = domains[0].id - except: - cdomain = createDomain.createDomainCmd() - cdomain.name = DomainName - domain = self.apiClient.createDomain(cdomain) - domId = domain.id - - cmd = listAccounts.listAccountsCmd() - cmd.name = UserName - cmd.domainid = domId - try: - accounts = self.apiClient.listAccounts(cmd) - acctId = accounts[0].id - except: - createAcctCmd = createAccount.createAccountCmd() - createAcctCmd.accounttype = acctType - createAcctCmd.domainid = domId - createAcctCmd.email = "test-" + self.random_gen()\ - + "@cloudstack.org" - createAcctCmd.firstname = UserName - createAcctCmd.lastname = UserName - createAcctCmd.password = 'password' - createAcctCmd.username = UserName - acct = self.apiClient.createAccount(createAcctCmd) - acctId = acct.id - - listuser = listUsers.listUsersCmd() - listuser.username = UserName - - listuserRes = self.apiClient.listUsers(listuser) - userId = listuserRes[0].id - apiKey = listuserRes[0].apikey - securityKey = listuserRes[0].secretkey - - if apiKey is None: - registerUser = registerUserKeys.registerUserKeysCmd() - registerUser.id = userId - registerUserRes = self.apiClient.registerUserKeys(registerUser) - apiKey = registerUserRes.apikey - securityKey = registerUserRes.secretkey - - newUserConnection =\ - cloudstackConnection.cloudConnection(self.connection.mgtSvr, - self.connection.port, - self.connection.user, - self.connection.passwd, - apiKey, securityKey, - self.connection.asyncTimeout, - self.connection.logging) - self.userApiClient =\ - cloudstackAPIClient.CloudStackAPIClient(newUserConnection) - self.userApiClient.connection = newUserConnection - self.userApiClient.hypervisor = self.apiClient.hypervisor - return self.userApiClient - - def close(self): - if self.connection is not None: - self.connection.close() - - def getDbConnection(self): - return self.dbConnection - - def executeSql(self, sql=None): - if sql is None or self.dbConnection is None: - return None - - return self.dbConnection.execute() - - def executeSqlFromFile(self, sqlFile=None): - if sqlFile is None or self.dbConnection is None: - return None - return self.dbConnection.executeSqlFromFile(sqlFile) - - def getApiClient(self): - self.apiClient.id = self.identifier - return self.apiClient - - def getUserApiClient(self, account, domain, type=0): - """ - 0 - user - 1 - admin - 2 - domain admin - """ - self.createUserApiClient(account, domain, type) - if hasattr(self, "userApiClient"): - return self.userApiClient - return None - - def submitCmdsAndWait(self, cmds, workers=1): - '''FixME, httplib has issue if more than one thread submitted''' - if self.asyncJobMgr is None: - self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, - self.dbConnection) - return self.asyncJobMgr.submitCmdsAndWait(cmds, workers) - - def submitJob(self, job, ntimes=1, nums_threads=10, interval=1): - ''' - submit one job and execute the same job ntimes, with nums_threads - of threads - ''' - if self.asyncJobMgr is None: - self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, - self.dbConnection) - self.asyncJobMgr.submitJobExecuteNtimes(job, ntimes, nums_threads, - interval) - - def submitJobs(self, jobs, nums_threads=10, interval=1): - '''submit n jobs, execute them with nums_threads of threads''' - if self.asyncJobMgr is None: - self.asyncJobMgr = asyncJobMgr.asyncJobMgr(self.apiClient, - self.dbConnection) - self.asyncJobMgr.submitJobs(jobs, nums_threads, interval) diff --git a/tools/marvin/build/lib/marvin/codegenerator.py b/tools/marvin/build/lib/marvin/codegenerator.py deleted file mode 100644 index 96729f6bbfe..00000000000 --- a/tools/marvin/build/lib/marvin/codegenerator.py +++ /dev/null @@ -1,463 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 xml.dom.minidom -import json -from optparse import OptionParser -from textwrap import dedent -import os -import sys -import urllib2 - - -class cmdParameterProperty(object): - def __init__(self): - self.name = None - self.required = False - self.desc = "" - self.type = "planObject" - self.subProperties = [] - - -class cloudStackCmd(object): - def __init__(self): - self.name = "" - self.desc = "" - self.async = "false" - self.request = [] - self.response = [] - - -class codeGenerator(object): - """ - Apache CloudStack- marvin python classes can be generated from the json - returned by API discovery or from the xml spec of commands generated by - the ApiDocWriter. This class provides helper methods for these uses. - """ - space = ' ' - newline = '\n' - cmdsName = [] - - def __init__(self, outputFolder): - self.cmd = None - self.code = "" - self.required = [] - self.subclass = [] - self.outputFolder = outputFolder - lic = """\ - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - - """ - self.license = dedent(lic) - - def addAttribute(self, attr, pro): - value = pro.value - if pro.required: - self.required.append(attr) - desc = pro.desc - if desc is not None: - self.code += self.space - self.code += "''' " + pro.desc + " '''" - self.code += self.newline - - self.code += self.space - self.code += attr + " = " + str(value) - self.code += self.newline - - def generateSubClass(self, name, properties): - '''generate code for sub list''' - subclass = 'class %s:\n' % name - subclass += self.space + "def __init__(self):\n" - for pro in properties: - if pro.desc is not None: - subclass += self.space + self.space + '""""%s"""\n' % pro.desc - if len(pro.subProperties) > 0: - subclass += self.space + self.space - subclass += 'self.%s = []\n' % pro.name - self.generateSubClass(pro.name, pro.subProperties) - else: - subclass += self.space + self.space - subclass += 'self.%s = None\n' % pro.name - - self.subclass.append(subclass) - - def generate(self, cmd): - - self.cmd = cmd - self.cmdsName.append(self.cmd.name) - self.code = self.license - self.code += self.newline - self.code += '"""%s"""\n' % self.cmd.desc - self.code += 'from baseCmd import *\n' - self.code += 'from baseResponse import *\n' - self.code += "class %sCmd (baseCmd):\n" % self.cmd.name - self.code += self.space + "def __init__(self):\n" - - self.code += self.space + self.space - self.code += 'self.isAsync = "%s"\n' % str(self.cmd.async).lower() - - for req in self.cmd.request: - if req.desc is not None: - self.code += self.space + self.space + '"""%s"""\n' % req.desc - if req.required == "true": - self.code += self.space + self.space + '"""Required"""\n' - - value = "None" - if req.type == "list" or req.type == "map": - value = "[]" - - self.code += self.space + self.space - self.code += 'self.%s = %s\n' % (req.name, value) - if req.required == "true": - self.required.append(req.name) - - self.code += self.space + self.space + "self.required = [" - for require in self.required: - self.code += '"' + require + '",' - self.code += "]\n" - self.required = [] - - """generate response code""" - subItems = {} - self.code += self.newline - self.code += 'class %sResponse (baseResponse):\n' % self.cmd.name - self.code += self.space + "def __init__(self):\n" - if len(self.cmd.response) == 0: - self.code += self.space + self.space + "pass" - else: - for res in self.cmd.response: - if res.desc is not None: - self.code += self.space + self.space - self.code += '"""%s"""\n' % res.desc - - if len(res.subProperties) > 0: - self.code += self.space + self.space - self.code += 'self.%s = []\n' % res.name - self.generateSubClass(res.name, res.subProperties) - else: - self.code += self.space + self.space - self.code += 'self.%s = None\n' % res.name - self.code += self.newline - - for subclass in self.subclass: - self.code += subclass + "\n" - - fp = open(self.outputFolder + "/cloudstackAPI/%s.py" % self.cmd.name, - "w") - fp.write(self.code) - fp.close() - self.code = "" - self.subclass = [] - - def finalize(self): - '''generate an api call''' - - header = '"""Test Client for CloudStack API"""\n' - imports = "import copy\n" - initCmdsList = '__all__ = [' - body = '' - body += "class CloudStackAPIClient(object):\n" - body += self.space + 'def __init__(self, connection):\n' - body += self.space + self.space + 'self.connection = connection\n' - body += self.space + self.space + 'self._id = None\n' - body += self.newline - - body += self.space + 'def __copy__(self):\n' - body += self.space + self.space - body += 'return CloudStackAPIClient(copy.copy(self.connection))\n' - body += self.newline - - # The `id` property will be used to link the test with the cloud - # resource being created - # @property - # def id(self): - # return self._id - # - # @id.setter - # def id(self, identifier): - # self._id = identifier - - body += self.space + '@property' + self.newline - body += self.space + 'def id(self):' + self.newline - body += self.space*2 + 'return self._id' + self.newline - body += self.newline - - body += self.space + '@id.setter' + self.newline - body += self.space + 'def id(self, identifier):' + self.newline - body += self.space*2 + 'self._id = identifier' + self.newline - body += self.newline - - for cmdName in self.cmdsName: - body += self.space - body += 'def %s(self, command, method="GET"):\n' % cmdName - body += self.space + self.space - body += 'response = %sResponse()\n' % cmdName - body += self.space + self.space - body += 'response = self.connection.marvin_request(command,' - body += ' response_type=response, method=method)\n' - body += self.space + self.space + 'return response\n' - body += self.newline - - imports += 'from %s import %sResponse\n' % (cmdName, cmdName) - initCmdsList += '"%s",' % cmdName - - fp = open(self.outputFolder + '/cloudstackAPI/cloudstackAPIClient.py', - 'w') - fp.write(self.license) - for item in [header, imports, body]: - fp.write(item) - fp.close() - - '''generate __init__.py''' - initCmdsList = self.license + initCmdsList + '"cloudstackAPIClient"]' - fp = open(self.outputFolder + '/cloudstackAPI/__init__.py', 'w') - fp.write(initCmdsList) - fp.close() - - fp = open(self.outputFolder + '/cloudstackAPI/baseCmd.py', 'w') - basecmd = self.license - basecmd += '"""Base Command"""\n' - basecmd += 'class baseCmd(object):\n' - basecmd += self.space + 'pass\n' - fp.write(basecmd) - fp.close() - - fp = open(self.outputFolder + '/cloudstackAPI/baseResponse.py', 'w') - basecmd = self.license - basecmd += '"""Base class for response"""\n' - basecmd += 'class baseResponse(object):\n' - basecmd += self.space + 'pass\n' - fp.write(basecmd) - fp.close() - - def constructResponseFromXML(self, response): - paramProperty = cmdParameterProperty() - paramProperty.name = getText(response.getElementsByTagName('name')) - paramProperty.desc = getText(response. - getElementsByTagName('description')) - if paramProperty.name.find('(*)') != -1: - '''This is a list''' - paramProperty.name = paramProperty.name.split('(*)')[0] - argList = response.getElementsByTagName('arguments')[0].\ - getElementsByTagName('arg') - for subresponse in argList: - subProperty = self.constructResponseFromXML(subresponse) - paramProperty.subProperties.append(subProperty) - return paramProperty - - def loadCmdFromXML(self, dom): - cmds = [] - for cmd in dom.getElementsByTagName("command"): - csCmd = cloudStackCmd() - csCmd.name = getText(cmd.getElementsByTagName('name')) - assert csCmd.name - - desc = getText(cmd.getElementsByTagName('description')) - if desc: - csCmd.desc = desc - - async = getText(cmd.getElementsByTagName('isAsync')) - if async: - csCmd.async = async - - argList = cmd.getElementsByTagName("request")[0].\ - getElementsByTagName("arg") - for param in argList: - paramProperty = cmdParameterProperty() - - paramProperty.name =\ - getText(param.getElementsByTagName('name')) - assert paramProperty.name - - required = param.getElementsByTagName('required') - if required: - paramProperty.required = getText(required) - - requestDescription = param.getElementsByTagName('description') - if requestDescription: - paramProperty.desc = getText(requestDescription) - - type = param.getElementsByTagName("type") - if type: - paramProperty.type = getText(type) - - csCmd.request.append(paramProperty) - - responseEle = cmd.getElementsByTagName("response")[0] - for response in responseEle.getElementsByTagName("arg"): - if response.parentNode != responseEle: - continue - - paramProperty = self.constructResponseFromXML(response) - csCmd.response.append(paramProperty) - - cmds.append(csCmd) - return cmds - - def generateCodeFromXML(self, apiSpecFile): - dom = xml.dom.minidom.parse(apiSpecFile) - cmds = self.loadCmdFromXML(dom) - for cmd in cmds: - self.generate(cmd) - self.finalize() - - def constructResponseFromJSON(self, response): - paramProperty = cmdParameterProperty() - if 'name' in response: - paramProperty.name = response['name'] - assert paramProperty.name, "%s has no property name" % response - - if 'description' in response: - paramProperty.desc = response['description'] - if 'type' in response: - if response['type'] in ['list', 'map', 'set']: - #Here list becomes a subproperty - if 'response' in response: - for innerResponse in response['response']: - subProperty =\ - self.constructResponseFromJSON(innerResponse) - paramProperty.subProperties.append(subProperty) - paramProperty.type = response['type'] - return paramProperty - - def loadCmdFromJSON(self, apiStream): - if apiStream is None: - raise Exception("No APIs found through discovery") - - jsonOut = apiStream.readlines() - assert len(jsonOut) > 0 - apiDict = json.loads(jsonOut[0]) - if not 'listapisresponse' in apiDict: - raise Exception("API discovery plugin response failed") - if not 'count' in apiDict['listapisresponse']: - raise Exception("Malformed api response") - - apilist = apiDict['listapisresponse']['api'] - cmds = [] - for cmd in apilist: - csCmd = cloudStackCmd() - if 'name' in cmd: - csCmd.name = cmd['name'] - assert csCmd.name - - if 'description' in cmd: - csCmd.desc = cmd['description'] - - if 'isasync' in cmd: - csCmd.async = cmd['isasync'] - - for param in cmd['params']: - paramProperty = cmdParameterProperty() - - if 'name' in param: - paramProperty.name = param['name'] - assert paramProperty.name - - if 'required' in param: - paramProperty.required = param['required'] - - if 'description' in param: - paramProperty.desc = param['description'] - - if 'type' in param: - paramProperty.type = param['type'] - - csCmd.request.append(paramProperty) - - for response in cmd['response']: - #FIXME: ExtractImage related APIs return empty dicts in response - if len(response) > 0: - paramProperty = self.constructResponseFromJSON(response) - csCmd.response.append(paramProperty) - - cmds.append(csCmd) - return cmds - - def generateCodeFromJSON(self, endpointUrl): - """ - Api Discovery plugin returns the supported APIs of a CloudStack - endpoint. - @return: The classes in cloudstackAPI/ formed from api discovery json - """ - if endpointUrl.find('response=json') >= 0: - apiStream = urllib2.urlopen(endpointUrl) - cmds = self.loadCmdFromJSON(apiStream) - for cmd in cmds: - self.generate(cmd) - self.finalize() - - -def getText(elements): - return elements[0].childNodes[0].nodeValue.strip() - -if __name__ == "__main__": - parser = OptionParser() - parser.add_option("-o", "--output", dest="output", - help="The path to the generated code entities, default\ - is .") - parser.add_option("-s", "--specfile", dest="spec", - help="The path and name of the api spec xml file,\ - default is /etc/cloud/cli/commands.xml") - parser.add_option("-e", "--endpoint", dest="endpoint", - help="The endpoint mgmt server (with open 8096) where\ - apis are discovered, default is localhost") - - (options, args) = parser.parse_args() - - folder = "." - if options.output is not None: - folder = options.output - apiModule = folder + "/cloudstackAPI" - if not os.path.exists(apiModule): - try: - os.mkdir(apiModule) - except: - print "Failed to create folder %s, due to %s" % (apiModule, - sys.exc_info()) - print parser.print_help() - exit(2) - - apiSpecFile = "/etc/cloud/cli/commands.xml" - if options.spec is not None: - apiSpecFile = options.spec - if not os.path.exists(apiSpecFile): - print "the spec file %s does not exists" % apiSpecFile - print parser.print_help() - exit(1) - - cg = codeGenerator(folder) - if options.spec is not None: - cg.generateCodeFromXML(apiSpecFile) - elif options.endpoint is not None: - endpointUrl = 'http://%s:8096/client/api?command=listApis&\ -response=json' % options.endpoint - cg.generateCodeFromJSON(endpointUrl) diff --git a/tools/marvin/build/lib/marvin/configGenerator.py b/tools/marvin/build/lib/marvin/configGenerator.py deleted file mode 100644 index a966ae089e4..00000000000 --- a/tools/marvin/build/lib/marvin/configGenerator.py +++ /dev/null @@ -1,870 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 json -import os -from optparse import OptionParser -import jsonHelper - - -class managementServer(object): - def __init__(self): - self.mgtSvrIp = None - self.port = 8096 - self.apiKey = None - self.securityKey = None - - -class dbServer(object): - def __init__(self): - self.dbSvr = None - self.port = 3306 - self.user = "cloud" - self.passwd = "cloud" - self.db = "cloud" - - -class configuration(object): - def __init__(self): - self.name = None - self.value = None - - -class logger(object): - def __init__(self): - '''TestCase/TestClient''' - self.name = None - self.file = None - - -class cloudstackConfiguration(object): - def __init__(self): - self.zones = [] - self.mgtSvr = [] - self.dbSvr = None - self.globalConfig = [] - self.logger = [] - - -class zone(object): - def __init__(self): - self.dns1 = None - self.internaldns1 = None - self.name = None - '''Basic or Advanced''' - self.networktype = None - self.dns2 = None - self.internaldns2 = None - self.securitygroupenabled = None - self.localstorageenabled = None - '''default public network, in advanced mode''' - self.ipranges = [] - self.physical_networks = [] - self.pods = [] - self.secondaryStorages = [] - self.cacheStorages = [] - - -class traffictype(object): - def __init__(self, typ, labeldict=None): - self.typ = typ # Guest/Management/Public - if labeldict: - self.xen = labeldict['xen'] if 'xen' in labeldict.keys() else None - self.kvm = labeldict['kvm'] if 'kvm' in labeldict.keys() else None - self.vmware = labeldict['vmware']\ - if 'vmware' in labeldict.keys() else None - self.simulator = labeldict['simulator']\ - if 'simulator' in labeldict.keys() else None - #{ - # 'xen' : 'cloud-xen', - # 'kvm' : 'cloud-kvm', - # 'vmware' : 'cloud-vmware' - #} - - -class pod(object): - def __init__(self): - self.gateway = None - self.name = None - self.netmask = None - self.startip = None - self.endip = None - self.zoneid = None - self.clusters = [] - self.vmwaredc = [] - '''Used in basic network mode''' - self.guestIpRanges = [] - - -class VmwareDc(object): - def __init__(self): - self.zoneid = None - self.name = None - self.vcenter = None - self.username = None - self.password = None - - -class cluster(object): - def __init__(self): - self.clustername = None - self.clustertype = None - self.hypervisor = None - self.zoneid = None - self.podid = None - self.password = None - self.url = None - self.username = None - self.hosts = [] - self.primaryStorages = [] - - -class host(object): - def __init__(self): - self.hypervisor = None - self.password = None - self.url = None - self.username = None - self.zoneid = None - self.podid = None - self.clusterid = None - self.clustername = None - self.cpunumber = None - self.cpuspeed = None - self.hostmac = None - self.hosttags = None - self.memory = None - - -class physical_network(object): - def __init__(self): - self.name = None - self.tags = [] - self.traffictypes = [] - self.broadcastdomainrange = 'Zone' - self.vlan = None - self.isolationmethods = [] - '''enable default virtual router provider''' - vrouter = provider() - vrouter.name = 'VirtualRouter' - self.providers = [vrouter] - - -class provider(object): - def __init__(self, name=None): - self.name = name - self.state = None - self.broadcastdomainrange = 'ZONE' - self.zoneid = None - self.servicelist = [] - self.devices = [] - - -class network(object): - def __init__(self): - self.displaytext = None - self.name = None - self.zoneid = None - self.acltype = None - self.domainid = None - self.networkdomain = None - self.networkofferingid = None - self.ipranges = [] - - -class iprange(object): - def __init__(self): - '''tagged/untagged''' - self.gateway = None - self.netmask = None - self.startip = None - self.endip = None - self.vlan = None - '''for account specific ''' - self.account = None - self.domain = None - - -class primaryStorage(object): - def __init__(self): - self.name = None - self.url = None - - -class secondaryStorage(object): - def __init__(self): - self.url = None - self.provider = None - self.details = None - - -class cacheStorage(object): - def __init__(self): - self.url = None - self.provider = None - self.details = None - - -class s3(object): - def __init__(self): - self.accesskey = None - self.secretkey = None - self.bucket = None - self.endpoint = None - self.sockettimeout = None - self.connectiontimeout = None - self.maxerrorrety = None - self.usehttps = None - - -class netscaler(object): - def __init__(self, hostname=None, username='nsroot', password='nsroot'): - self.hostname = hostname - self.username = username - self.password = password - self.networkdevicetype = 'NetscalerVPXLoadBalancer' - self.publicinterface = '1/1' - self.privateinterface = '1/1' - self.numretries = '2' - self.lbdevicecapacity = '50' - self.lbdevicededicated = 'false' - - def getUrl(self): - return repr(self) - - def __repr__(self): - req = zip(self.__dict__.keys(), self.__dict__.values()) - return self.hostname+"?" + "&".join(["=".join([r[0], r[1]]) - for r in req]) - - -class srx(object): - def __init__(self, hostname=None, username='root', password='admin'): - self.hostname = hostname - self.username = username - self.password = password - self.networkdevicetype = 'JuniperSRXFirewall' - self.publicinterface = '1/1' - self.privateinterface = '1/1' - self.numretries = '2' - self.fwdevicededicated = 'false' - self.timeout = '300' - self.publicnetwork = 'untrusted' - self.privatenetwork = 'trusted' - - def getUrl(self): - return repr(self) - - def __repr__(self): - req = zip(self.__dict__.keys(), self.__dict__.values()) - return self.hostname+"?" + "&".join(["=".join([r[0], r[1]]) - for r in req]) - - -class bigip(object): - def __init__(self, hostname=None, username='root', password='default'): - self.hostname = hostname - self.username = username - self.password = password - self.networkdevicetype = 'F5BigIpLoadBalancer' - self.publicinterface = '1/1' - self.privateinterface = '1/1' - self.numretries = '2' - self.lbdevicededicated = 'false' - self.lbdevicecapacity = '50' - - def getUrl(self): - return repr(self) - - def __repr__(self): - req = zip(self.__dict__.keys(), self.__dict__.values()) - return self.hostname+"?" + "&".join(["=".join([r[0], r[1]]) - for r in req]) - - -def getDeviceUrl(obj): - req = zip(obj.__dict__.keys(), obj.__dict__.values()) - if obj.hostname: - return "http://" + obj.hostname+"?" + "&".join(["=".join([r[0], - r[1]]) - for r in req]) - else: - return None - - -def describe_setup_in_basic_mode(): - '''sample code to generate setup configuration file''' - zs = cloudstackConfiguration() - - for l in range(1): - z = zone() - z.dns1 = "8.8.8.8" - z.dns2 = "8.8.4.4" - z.internaldns1 = "192.168.110.254" - z.internaldns2 = "192.168.110.253" - z.name = "test"+str(l) - z.networktype = 'Basic' - z.securitygroupenabled = 'True' - - #If security groups are reqd - sgprovider = provider() - sgprovider.broadcastdomainrange = 'Pod' - sgprovider.name = 'SecurityGroupProvider' - - pn = physical_network() - pn.name = "test-network" - pn.traffictypes = [traffictype("Guest"), traffictype("Management")] - pn.providers.append(sgprovider) - - z.physical_networks.append(pn) - - '''create 10 pods''' - for i in range(2): - p = pod() - p.name = "test" + str(l) + str(i) - p.gateway = "192.168.%d.1" % i - p.netmask = "255.255.255.0" - p.startip = "192.168.%d.150" % i - p.endip = "192.168.%d.220" % i - - '''add two pod guest ip ranges''' - for j in range(2): - ip = iprange() - ip.gateway = p.gateway - ip.netmask = p.netmask - ip.startip = "192.168.%d.%d" % (i, j*20) - ip.endip = "192.168.%d.%d" % (i, j*20+10) - - p.guestIpRanges.append(ip) - - '''add 10 clusters''' - for j in range(2): - c = cluster() - c.clustername = "test"+str(l)+str(i) + str(j) - c.clustertype = "CloudManaged" - c.hypervisor = "Simulator" - - '''add 10 hosts''' - for k in range(2): - h = host() - h.username = "root" - h.password = "password" - memory = 8*1024*1024*1024 - localstorage = 1*1024*1024*1024*1024 - h.url = "http://sim/%d%d%d%d" % (l, i, j, k) - c.hosts.append(h) - - '''add 2 primary storages''' - for m in range(2): - primary = primaryStorage() - primary.name = "primary"+str(l) + str(i) + str(j) + str(m) - primary.url = "nfs://localhost/path%s" % (str(l) + str(i) + - str(j) + str(m)) - c.primaryStorages.append(primary) - - p.clusters.append(c) - - z.pods.append(p) - - '''add two secondary''' - for i in range(5): - secondary = secondaryStorage() - secondary.url = "nfs://localhost/path"+str(l) + str(i) - z.secondaryStorages.append(secondary) - - zs.zones.append(z) - - '''Add one mgt server''' - mgt = managementServer() - mgt.mgtSvrIp = "localhost" - zs.mgtSvr.append(mgt) - - '''Add a database''' - db = dbServer() - db.dbSvr = "localhost" - - zs.dbSvr = db - - '''add global configuration''' - global_settings = {'expunge.delay': '60', - 'expunge.interval': '60', - 'expunge.workers': '3', - } - for k, v in global_settings.iteritems(): - cfg = configuration() - cfg.name = k - cfg.value = v - zs.globalConfig.append(cfg) - - ''''add loggers''' - testClientLogger = logger() - testClientLogger.name = "TestClient" - testClientLogger.file = "/tmp/testclient.log" - - testCaseLogger = logger() - testCaseLogger.name = "TestCase" - testCaseLogger.file = "/tmp/testcase.log" - - zs.logger.append(testClientLogger) - zs.logger.append(testCaseLogger) - - return zs - - -def describe_setup_in_eip_mode(): - """ - Setting up an EIP/ELB enabled zone with netscaler provider - """ - zs = cloudstackConfiguration() - - for l in range(1): - z = zone() - z.dns1 = "8.8.8.8" - z.dns2 = "8.8.4.4" - z.internaldns1 = "192.168.110.254" - z.internaldns2 = "192.168.110.253" - z.name = "test"+str(l) - z.networktype = 'Basic' - - ips = iprange() - ips.vlan = "49" - ips.startip = "10.147.49.200" - ips.endip = "10.147.49.250" - ips.gateway = "10.147.49.1" - ips.netmask = "255.255.255.0" - z.ipranges.append(ips) - - #If security groups are reqd - sgprovider = provider() - sgprovider.broadcastdomainrange = 'Pod' - sgprovider.name = 'SecurityGroupProvider' - - nsprovider = provider() - nsprovider.name = 'Netscaler' - ns = netscaler() - ns.hostname = '10.147.40.100' - nsprovider.devices.append(ns) - - pn = physical_network() - pn.name = "test-network" - pn.traffictypes = [traffictype("Guest", - {"xen": "cloud-guest"}), - traffictype("Management"), - traffictype("Public", {"xen": "cloud-public"})] - pn.providers.extend([sgprovider, nsprovider]) - z.physical_networks.append(pn) - - '''create 10 pods''' - for i in range(2): - p = pod() - p.name = "test" + str(l) + str(i) - p.gateway = "192.168.%d.1" % i - p.netmask = "255.255.255.0" - p.startip = "192.168.%d.150" % i - p.endip = "192.168.%d.220" % i - - '''add two pod guest ip ranges''' - for j in range(2): - ip = iprange() - ip.gateway = p.gateway - ip.netmask = p.netmask - ip.startip = "192.168.%d.%d" % (i, j*20) - ip.endip = "192.168.%d.%d" % (i, j*20+10) - - p.guestIpRanges.append(ip) - - '''add 10 clusters''' - for j in range(2): - c = cluster() - c.clustername = "test"+str(l)+str(i) + str(j) - c.clustertype = "CloudManaged" - c.hypervisor = "Simulator" - - '''add 10 hosts''' - for k in range(2): - h = host() - h.username = "root" - h.password = "password" - h.url = "http://Sim/%d%d%d%d" % (l, i, j, k) - c.hosts.append(h) - - '''add 2 primary storages''' - for m in range(2): - primary = primaryStorage() - primary.name = "primary"+str(l) + str(i) + str(j) + str(m) - primary.url = "nfs://localhost/path%s" % (str(l) + str(i) - + str(j) - + str(m)) - c.primaryStorages.append(primary) - - p.clusters.append(c) - - z.pods.append(p) - - '''add two secondary''' - for i in range(5): - secondary = secondaryStorage() - secondary.url = "nfs://localhost/path"+str(l) + str(i) - z.secondaryStorages.append(secondary) - - zs.zones.append(z) - - '''Add one mgt server''' - mgt = managementServer() - mgt.mgtSvrIp = "localhost" - zs.mgtSvr.append(mgt) - - '''Add a database''' - db = dbServer() - db.dbSvr = "localhost" - - zs.dbSvr = db - - '''add global configuration''' - global_settings = {'expunge.delay': '60', - 'expunge.interval': '60', - 'expunge.workers': '3', - } - for k, v in global_settings.iteritems(): - cfg = configuration() - cfg.name = k - cfg.value = v - zs.globalConfig.append(cfg) - - ''''add loggers''' - testClientLogger = logger() - testClientLogger.name = "TestClient" - testClientLogger.file = "/tmp/testclient.log" - - testCaseLogger = logger() - testCaseLogger.name = "TestCase" - testCaseLogger.file = "/tmp/testcase.log" - - zs.logger.append(testClientLogger) - zs.logger.append(testCaseLogger) - - return zs - - -def describe_setup_in_advanced_mode(): - '''sample code to generate setup configuration file''' - zs = cloudstackConfiguration() - - for l in range(1): - z = zone() - z.dns1 = "8.8.8.8" - z.dns2 = "8.8.4.4" - z.internaldns1 = "192.168.110.254" - z.internaldns2 = "192.168.110.253" - z.name = "test"+str(l) - z.networktype = 'Advanced' - z.guestcidraddress = "10.1.1.0/24" - z.vlan = "100-2000" - - pn = physical_network() - pn.name = "test-network" - pn.traffictypes = [traffictype("Guest"), traffictype("Management"), - traffictype("Public")] - - vpcprovider = provider('VpcVirtualRouter') - - nsprovider = provider('Netscaler') - nsprovider.devices.append(netscaler(hostname='10.147.40.100')) - - srxprovider = provider('JuniperSRX') - srxprovider.devices.append(srx(hostname='10.147.40.3')) - - f5provider = provider('F5BigIp') - f5provider.devices.append(bigip(hostname='10.147.40.3')) - - pn.providers.extend([vpcprovider, nsprovider, srxprovider, f5provider]) - z.physical_networks.append(pn) - - '''create 10 pods''' - for i in range(2): - p = pod() - p.name = "test" + str(l) + str(i) - p.gateway = "192.168.%d.1" % i - p.netmask = "255.255.255.0" - p.startip = "192.168.%d.200" % i - p.endip = "192.168.%d.220" % i - - '''add 10 clusters''' - for j in range(2): - c = cluster() - c.clustername = "test"+str(l)+str(i) + str(j) - c.clustertype = "CloudManaged" - c.hypervisor = "Simulator" - - '''add 10 hosts''' - for k in range(2): - h = host() - h.username = "root" - h.password = "password" - memory = 8 * 1024 * 1024 * 1024 - localstorage = 1 * 1024 * 1024 * 1024 * 1024 - #h.url = "http://sim/%d%d%d%d/cpucore=1&cpuspeed=8000&\ - # memory=%d&localstorage=%d"%(l, i, j, k, memory, - # localstorage) - h.url = "http://sim/%d%d%d%d" % (l, i, j, k) - c.hosts.append(h) - - '''add 2 primary storages''' - for m in range(2): - primary = primaryStorage() - primary.name = "primary"+str(l) + str(i) + str(j) + str(m) - #primary.url = "nfs://localhost/path%s/size=%d" % - # (str(l) + str(i) + str(j) + str(m), size) - primary.url = "nfs://localhost/path%s" % (str(l) + str(i) - + str(j) - + str(m)) - c.primaryStorages.append(primary) - - p.clusters.append(c) - - z.pods.append(p) - - '''add two secondary''' - for i in range(5): - secondary = secondaryStorage() - secondary.url = "nfs://localhost/path"+str(l) + str(i) - z.secondaryStorages.append(secondary) - - '''add default public network''' - ips = iprange() - ips.vlan = "26" - ips.startip = "172.16.26.2" - ips.endip = "172.16.26.100" - ips.gateway = "172.16.26.1" - ips.netmask = "255.255.255.0" - z.ipranges.append(ips) - - zs.zones.append(z) - - '''Add one mgt server''' - mgt = managementServer() - mgt.mgtSvrIp = "localhost" - zs.mgtSvr.append(mgt) - - '''Add a database''' - db = dbServer() - db.dbSvr = "localhost" - - zs.dbSvr = db - - '''add global configuration''' - global_settings = {'expunge.delay': '60', - 'expunge.interval': '60', - 'expunge.workers': '3', - } - for k, v in global_settings.iteritems(): - cfg = configuration() - cfg.name = k - cfg.value = v - zs.globalConfig.append(cfg) - - ''''add loggers''' - testClientLogger = logger() - testClientLogger.name = "TestClient" - testClientLogger.file = "/tmp/testclient.log" - - testCaseLogger = logger() - testCaseLogger.name = "TestCase" - testCaseLogger.file = "/tmp/testcase.log" - - zs.logger.append(testClientLogger) - zs.logger.append(testCaseLogger) - - return zs - -'''sample code to generate setup configuration file''' - - -def describe_setup_in_advancedsg_mode(): - zs = cloudstackConfiguration() - - for l in range(1): - z = zone() - z.dns1 = "8.8.8.8" - z.dns2 = "8.8.4.4" - z.internaldns1 = "192.168.110.254" - z.internaldns2 = "192.168.110.253" - z.name = "test"+str(l) - z.networktype = 'Advanced' - z.vlan = "100-2000" - z.securitygroupenabled = "true" - - pn = physical_network() - pn.name = "test-network" - pn.traffictypes = [traffictype("Guest"), traffictype("Management")] - - #If security groups are reqd - sgprovider = provider() - sgprovider.broadcastdomainrange = 'ZONE' - sgprovider.name = 'SecurityGroupProvider' - - pn.providers.append(sgprovider) - z.physical_networks.append(pn) - - '''create 10 pods''' - for i in range(2): - p = pod() - p.name = "test" + str(l) + str(i) - p.gateway = "192.168.%d.1" % i - p.netmask = "255.255.255.0" - p.startip = "192.168.%d.200" % i - p.endip = "192.168.%d.220" % i - - '''add 10 clusters''' - for j in range(2): - c = cluster() - c.clustername = "test"+str(l)+str(i) + str(j) - c.clustertype = "CloudManaged" - c.hypervisor = "Simulator" - - '''add 10 hosts''' - for k in range(2): - h = host() - h.username = "root" - h.password = "password" - memory = 8 * 1024 * 1024 * 1024 - localstorage = 1 * 1024 * 1024 * 1024 * 1024 - #h.url = "http://sim/%d%d%d%d/cpucore=1&cpuspeed=8000&\ - #memory=%d&localstorage=%d" % (l, i, j, k, memory, - #localstorage) - h.url = "http://sim/%d%d%d%d" % (l, i, j, k) - c.hosts.append(h) - - '''add 2 primary storages''' - for m in range(2): - primary = primaryStorage() - primary.name = "primary"+str(l) + str(i) + str(j) + str(m) - #primary.url = "nfs://localhost/path%s/size=%d" % \ - #(str(l) + str(i) + str(j) + str(m), size) - primary.url = "nfs://localhost/path%s" % \ - (str(l) + str(i) + str(j) + str(m)) - c.primaryStorages.append(primary) - - p.clusters.append(c) - - z.pods.append(p) - - '''add two secondary''' - for i in range(5): - secondary = secondaryStorage() - secondary.url = "nfs://localhost/path"+str(l) + str(i) - z.secondaryStorages.append(secondary) - - '''add default guest network''' - ips = iprange() - ips.vlan = "26" - ips.startip = "172.16.26.2" - ips.endip = "172.16.26.100" - ips.gateway = "172.16.26.1" - ips.netmask = "255.255.255.0" - z.ipranges.append(ips) - - zs.zones.append(z) - - '''Add one mgt server''' - mgt = managementServer() - mgt.mgtSvrIp = "localhost" - zs.mgtSvr.append(mgt) - - '''Add a database''' - db = dbServer() - db.dbSvr = "localhost" - - zs.dbSvr = db - - '''add global configuration''' - global_settings = {'expunge.delay': '60', - 'expunge.interval': '60', - 'expunge.workers': '3', - } - for k, v in global_settings.iteritems(): - cfg = configuration() - cfg.name = k - cfg.value = v - zs.globalConfig.append(cfg) - - ''''add loggers''' - testClientLogger = logger() - testClientLogger.name = "TestClient" - testClientLogger.file = "/tmp/testclient.log" - - testCaseLogger = logger() - testCaseLogger.name = "TestCase" - testCaseLogger.file = "/tmp/testcase.log" - - zs.logger.append(testClientLogger) - zs.logger.append(testCaseLogger) - - return zs - - -def generate_setup_config(config, file=None): - describe = config - if file is None: - return json.dumps(jsonHelper.jsonDump.dump(describe)) - else: - fp = open(file, 'w') - json.dump(jsonHelper.jsonDump.dump(describe), fp, indent=4) - fp.close() - - -def get_setup_config(file): - if not os.path.exists(file): - raise IOError("config file %s not found. \ -please specify a valid config file" % file) - config = cloudstackConfiguration() - configLines = [] - with open(file, 'r') as fp: - for line in fp: - ws = line.strip() - if not ws.startswith("#"): - configLines.append(ws) - config = json.loads("\n".join(configLines)) - return jsonHelper.jsonLoader(config) - -if __name__ == "__main__": - parser = OptionParser() - - parser.add_option("-i", "--input", action="store", default=None, - dest="inputfile", help="input file") - parser.add_option("-a", "--advanced", action="store_true", default=False, - dest="advanced", help="use advanced networking") - parser.add_option("-s", "--advancedsg", action="store_true", default=False, - dest="advancedsg", help="use advanced networking \ -with security groups") - parser.add_option("-o", "--output", action="store", - default="./datacenterCfg", dest="output", - help="the path where the json config file generated, \ -by default is ./datacenterCfg") - - (options, args) = parser.parse_args() - - if options.inputfile: - config = get_setup_config(options.inputfile) - if options.advanced: - config = describe_setup_in_advanced_mode() - elif options.advancedsg: - config = describe_setup_in_advancedsg_mode() - else: - config = describe_setup_in_basic_mode() - - generate_setup_config(config, options.output) diff --git a/tools/marvin/build/lib/marvin/dbConnection.py b/tools/marvin/build/lib/marvin/dbConnection.py deleted file mode 100644 index 99014abfa20..00000000000 --- a/tools/marvin/build/lib/marvin/dbConnection.py +++ /dev/null @@ -1,86 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 mysql -import contextlib -from mysql import connector -from mysql.connector import errors -from contextlib import closing -import cloudstackException -import sys -import os - - -class dbConnection(object): - def __init__(self, host="localhost", port=3306, user='cloud', - passwd='cloud', db='cloud'): - self.host = host - self.port = port - self.user = str(user) # Workaround: http://bugs.mysql.com/?id=67306 - self.passwd = passwd - self.database = db - - def execute(self, sql=None, params=None): - if sql is None: - return None - - resultRow = [] - with contextlib.\ - closing(mysql.connector.connect(host=str(self.host), - port=int(self.port), - user=str(self.user), - password=str(self.passwd), - db=str(self.database))) as conn: - conn.autocommit = True - with contextlib.closing(conn.cursor(buffered=True)) as cursor: - cursor.execute(sql, params) - try: - resultRow = cursor.fetchall() - except errors.InterfaceError: - #Raised on empty result - DML - resultRow = [] - return resultRow - - def executeSqlFromFile(self, fileName=None): - if fileName is None: - raise cloudstackException.\ - InvalidParameterException("file can't not none") - - if not os.path.exists(fileName): - raise cloudstackException.\ - InvalidParameterException("%s not exists" % fileName) - - sqls = open(fileName, "r").read() - return self.execute(sqls) - -if __name__ == "__main__": - db = dbConnection() - ''' - try: - - result = db.executeSqlFromFile("/tmp/server-setup.sql") - if result is not None: - for r in result: - print r[0], r[1] - except cloudstackException.dbException, e: - print e - ''' - print db.execute("update vm_template set name='fjkd' where id=200") - for i in range(10): - result = db.execute("select job_status, created, \ -last_updated from async_job where id=%d" % i) - print result diff --git a/tools/marvin/build/lib/marvin/deployAndRun.py b/tools/marvin/build/lib/marvin/deployAndRun.py deleted file mode 100644 index 8a758a10e36..00000000000 --- a/tools/marvin/build/lib/marvin/deployAndRun.py +++ /dev/null @@ -1,96 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 deployDataCenter -import TestCaseExecuteEngine -import sys -from argparse import ArgumentParser -if __name__ == "__main__": - - parser = ArgumentParser() - - parser.add_argument("-d", "--directory", dest="testCaseFolder", - help="the test case directory") - parser.add_argument("-f", "--file", dest="module", - help="run tests in the given file") - parser.add_argument("-r", "--result", dest="result", - help="test result log file", default='/tmp/t.log') - parser.add_argument("-t", "--client", dest="testcaselog", - help="test case log file", default='/tmp/r.log') - parser.add_argument("-c", "--config", action="store", - default="./datacenterCfg", dest="config", - help="the path where the json config file generated,\ - by default is ./datacenterCfg") - parser.add_argument("-l", "--load", dest="load", action="store_true", - help="only load config, do not deploy,\ - it will only run testcase") - parser.add_argument("-n", "--num", dest="number", - help="how many times you want run the test case") - - options = parser.parse_args() - - testResultLogFile = None - if options.result is not None: - testResultLogFile = options.result - - testCaseLogFile = None - if options.testcaselog is not None: - testCaseLogFile = options.testcaselog - deploy = deployDataCenter.deployDataCenters(options.config) - if options.load: - deploy.loadCfg() - else: - deploy.deploy() - iterates = 1 - if options.number is not None: - if options.number == "loop": - iterates = sys.maxint - else: - try: - iterates = int(options.number) - except: - iterates = 1 - - if options.testCaseFolder is None: - if options.module is None: - parser.print_usage() - exit(1) - else: - n = 0 - while(n < iterates): - engine = \ - TestCaseExecuteEngine.TestCaseExecuteEngine( - deploy.testClient, - deploy.getCfg( - ), - testCaseLogFile, - testResultLogFile) - engine.loadTestsFromFile(options.module) - engine.run() - n = n + 1 - else: - n = 0 - while(n < iterates): - engine = TestCaseExecuteEngine.TestCaseExecuteEngine( - deploy.testClient, - deploy.getCfg( - ), - testCaseLogFile, - testResultLogFile) - engine.loadTestsFromDir(options.testCaseFolder) - engine.run() - n = n + 1 diff --git a/tools/marvin/build/lib/marvin/deployDataCenter.py b/tools/marvin/build/lib/marvin/deployDataCenter.py deleted file mode 100644 index beed8c8eb19..00000000000 --- a/tools/marvin/build/lib/marvin/deployDataCenter.py +++ /dev/null @@ -1,625 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -"""Deploy datacenters according to a json configuration file""" -import configGenerator -import cloudstackException -import cloudstackTestClient -import logging -from cloudstackAPI import * -from os import path -from time import sleep -from optparse import OptionParser - - -class deployDataCenters(object): - - def __init__(self, cfgFile): - if not path.exists(cfgFile) \ - and not path.exists(path.abspath(cfgFile)): - raise IOError("config file %s not found. please \ -specify a valid config file" % cfgFile) - self.configFile = cfgFile - - def addHosts(self, hosts, zoneId, podId, clusterId, hypervisor): - if hosts is None: - return - for host in hosts: - hostcmd = addHost.addHostCmd() - hostcmd.clusterid = clusterId - hostcmd.cpunumber = host.cpunumer - hostcmd.cpuspeed = host.cpuspeed - hostcmd.hostmac = host.hostmac - hostcmd.hosttags = host.hosttags - hostcmd.hypervisor = host.hypervisor - hostcmd.memory = host.memory - hostcmd.password = host.password - hostcmd.podid = podId - hostcmd.url = host.url - hostcmd.username = host.username - hostcmd.zoneid = zoneId - hostcmd.hypervisor = hypervisor - self.apiClient.addHost(hostcmd) - - def addVmWareDataCenter(self, vmwareDc): - vdc = addVmwareDc.addVmwareDcCmd() - vdc.zoneid = vmwareDc.zoneid - vdc.name = vmwareDc.name - vdc.vcenter = vmwareDc.vcenter - vdc.username = vmwareDc.username - vdc.password = vmwareDc.password - self.apiClient.addVmwareDc(vdc) - - def createClusters(self, clusters, zoneId, podId, vmwareDc=None): - if clusters is None: - return - - if vmwareDc is not None: - vmwareDc.zoneid = zoneId - self.addVmWareDataCenter(vmwareDc) - - for cluster in clusters: - clustercmd = addCluster.addClusterCmd() - clustercmd.clustername = cluster.clustername - clustercmd.clustertype = cluster.clustertype - clustercmd.hypervisor = cluster.hypervisor - clustercmd.password = cluster.password - clustercmd.podid = podId - clustercmd.url = cluster.url - clustercmd.username = cluster.username - clustercmd.zoneid = zoneId - clusterresponse = self.apiClient.addCluster(clustercmd) - clusterId = clusterresponse[0].id - - if cluster.hypervisor.lower() != "vmware": - self.addHosts(cluster.hosts, zoneId, podId, clusterId, - cluster.hypervisor) - self.wait_for_host(zoneId, clusterId) - self.createPrimaryStorages(cluster.primaryStorages, zoneId, podId, - clusterId) - - def wait_for_host(self, zoneId, clusterId): - """ - Wait for the hosts in the zoneid, clusterid to be up - - 2 retries with 30s delay - """ - retry, timeout = 2, 30 - cmd = listHosts.listHostsCmd() - cmd.clusterid, cmd.zoneid = clusterId, zoneId - hosts = self.apiClient.listHosts(cmd) - while retry != 0: - for host in hosts: - if host.state != 'Up': - break - sleep(timeout) - retry = retry - 1 - - def createPrimaryStorages(self, primaryStorages, zoneId, podId, clusterId): - if primaryStorages is None: - return - for primary in primaryStorages: - primarycmd = createStoragePool.createStoragePoolCmd() - primarycmd.details = primary.details - primarycmd.name = primary.name - primarycmd.podid = podId - primarycmd.tags = primary.tags - primarycmd.url = primary.url - primarycmd.zoneid = zoneId - primarycmd.clusterid = clusterId - self.apiClient.createStoragePool(primarycmd) - - def createpods(self, pods, zoneId, networkId=None): - if pods is None: - return - for pod in pods: - createpod = createPod.createPodCmd() - createpod.name = pod.name - createpod.gateway = pod.gateway - createpod.netmask = pod.netmask - createpod.startip = pod.startip - createpod.endip = pod.endip - createpod.zoneid = zoneId - createpodResponse = self.apiClient.createPod(createpod) - podId = createpodResponse.id - - if pod.guestIpRanges is not None and networkId is not None: - self.createVlanIpRanges("Basic", pod.guestIpRanges, zoneId, - podId, networkId) - - self.createClusters(pod.clusters, zoneId, podId, - vmwareDc=pod.vmwaredc) - - def createVlanIpRanges(self, mode, ipranges, zoneId, podId=None, - networkId=None, forvirtualnetwork=None): - if ipranges is None: - return - for iprange in ipranges: - vlanipcmd = createVlanIpRange.createVlanIpRangeCmd() - vlanipcmd.account = iprange.account - vlanipcmd.domainid = iprange.domainid - vlanipcmd.endip = iprange.endip - vlanipcmd.gateway = iprange.gateway - vlanipcmd.netmask = iprange.netmask - vlanipcmd.networkid = networkId - vlanipcmd.podid = podId - vlanipcmd.startip = iprange.startip - vlanipcmd.zoneid = zoneId - vlanipcmd.vlan = iprange.vlan - if mode == "Basic": - if forvirtualnetwork: - vlanipcmd.forvirtualnetwork = "true" - else: - vlanipcmd.forvirtualnetwork = "false" - else: - vlanipcmd.forvirtualnetwork = "true" - self.apiClient.createVlanIpRange(vlanipcmd) - - def createSecondaryStorages(self, secondaryStorages, zoneId): - if secondaryStorages is None: - return - for secondary in secondaryStorages: - secondarycmd = addImageStore.addImageStoreCmd() - secondarycmd.url = secondary.url - secondarycmd.provider = secondary.provider - secondarycmd.details = [] - - if secondarycmd.provider == 'S3' \ - or secondarycmd.provider == "Swift": - for key, value in vars(secondary.details).iteritems(): - secondarycmd.details.append({ - 'key': key, - 'value': value - }) - if secondarycmd.provider == "NFS": - secondarycmd.zoneid = zoneId - self.apiClient.addImageStore(secondarycmd) - - def createCacheStorages(self, cacheStorages, zoneId): - if cacheStorages is None: - return - for cache in cacheStorages: - cachecmd = createSecondaryStagingStore.\ - createSecondaryStagingStoreCmd() - cachecmd.url = cache.url - cachecmd.provider = cache.provider - cachecmd.zoneid = zoneId - cachecmd.details = [] - - if cache.details: - for key, value in vars(cache.details).iteritems(): - cachecmd.details.append({ - 'key': key, - 'value': value - }) - self.apiClient.createSecondaryStagingStore(cachecmd) - - def createnetworks(self, networks, zoneId): - if networks is None: - return - for network in networks: - networkcmd = createNetwork.createNetworkCmd() - networkcmd.displaytext = network.displaytext - networkcmd.name = network.name - networkcmd.networkofferingid = network.networkofferingid - networkcmd.zoneid = zoneId - - ipranges = network.ipranges - if ipranges: - iprange = ipranges.pop() - networkcmd.startip = iprange.startip - networkcmd.endip = iprange.endip - networkcmd.gateway = iprange.gateway - networkcmd.netmask = iprange.netmask - - networkcmdresponse = self.apiClient.createNetwork(networkcmd) - networkId = networkcmdresponse.id - return networkId - - def createPhysicalNetwork(self, net, zoneid): - phynet = createPhysicalNetwork.createPhysicalNetworkCmd() - phynet.zoneid = zoneid - phynet.name = net.name - phynet.isolationmethods = net.isolationmethods - phynetwrk = self.apiClient.createPhysicalNetwork(phynet) - self.addTrafficTypes(phynetwrk.id, net.traffictypes) - return phynetwrk - - def updatePhysicalNetwork(self, networkid, state="Enabled", vlan=None): - upnet = updatePhysicalNetwork.updatePhysicalNetworkCmd() - upnet.id = networkid - upnet.state = state - if vlan: - upnet.vlan = vlan - return self.apiClient.updatePhysicalNetwork(upnet) - - def enableProvider(self, provider_id): - upnetprov =\ - updateNetworkServiceProvider.updateNetworkServiceProviderCmd() - upnetprov.id = provider_id - upnetprov.state = "Enabled" - self.apiClient.updateNetworkServiceProvider(upnetprov) - - def configureProviders(self, phynetwrk, providers): - """ - We will enable the virtualrouter elements for all zones. Other - providers like NetScalers, SRX, etc are explicitly added/configured - """ - - for provider in providers: - pnetprov = listNetworkServiceProviders.\ - listNetworkServiceProvidersCmd() - pnetprov.physicalnetworkid = phynetwrk.id - pnetprov.state = "Disabled" - pnetprov.name = provider.name - pnetprovres = self.apiClient.listNetworkServiceProviders(pnetprov) - - if pnetprovres and len(pnetprovres) > 0: - if provider.name == 'VirtualRouter'\ - or provider.name == 'VpcVirtualRouter': - vrprov = listVirtualRouterElements.\ - listVirtualRouterElementsCmd() - vrprov.nspid = pnetprovres[0].id - vrprovresponse = self.apiClient.\ - listVirtualRouterElements(vrprov) - vrprovid = vrprovresponse[0].id - - vrconfig = \ - configureVirtualRouterElement.\ - configureVirtualRouterElementCmd() - vrconfig.enabled = "true" - vrconfig.id = vrprovid - self.apiClient.configureVirtualRouterElement(vrconfig) - self.enableProvider(pnetprovres[0].id) - elif provider.name == 'InternalLbVm': - internallbprov = listInternalLoadBalancerElements.\ - listInternalLoadBalancerElementsCmd() - internallbprov.nspid = pnetprovres[0].id - internallbresponse = self.apiClient.\ - listInternalLoadBalancerElements(internallbprov) - internallbid = internallbresponse[0].id - - internallbconfig = \ - configureInternalLoadBalancerElement.\ - configureInternalLoadBalancerElementCmd() - internallbconfig.enabled = "true" - internallbconfig.id = internallbid - self.apiClient.\ - configureInternalLoadBalancerElement(internallbconfig) - self.enableProvider(pnetprovres[0].id) - elif provider.name == 'SecurityGroupProvider': - self.enableProvider(pnetprovres[0].id) - elif provider.name in ['Netscaler', 'JuniperSRX', 'F5BigIp']: - netprov = addNetworkServiceProvider.\ - addNetworkServiceProviderCmd() - netprov.name = provider.name - netprov.physicalnetworkid = phynetwrk.id - result = self.apiClient.addNetworkServiceProvider(netprov) - for device in provider.devices: - if provider.name == 'Netscaler': - dev = addNetscalerLoadBalancer.\ - addNetscalerLoadBalancerCmd() - dev.username = device.username - dev.password = device.password - dev.networkdevicetype = device.networkdevicetype - dev.url = configGenerator.getDeviceUrl(device) - dev.physicalnetworkid = phynetwrk.id - self.apiClient.addNetscalerLoadBalancer(dev) - elif provider.name == 'JuniperSRX': - dev = addSrxFirewall.addSrxFirewallCmd() - dev.username = device.username - dev.password = device.password - dev.networkdevicetype = device.networkdevicetype - dev.url = configGenerator.getDeviceUrl(device) - dev.physicalnetworkid = phynetwrk.id - self.apiClient.addSrxFirewall(dev) - elif provider.name == 'F5BigIp': - dev = addF5LoadBalancer.addF5LoadBalancerCmd() - dev.username = device.username - dev.password = device.password - dev.networkdevicetype = device.networkdevicetype - dev.url = configGenerator.getDeviceUrl(device) - dev.physicalnetworkid = phynetwrk.id - self.apiClient.addF5LoadBalancer(dev) - else: - raise cloudstackException.\ - InvalidParameterException("Device %s doesn't match\ - any know provider type" % device) - self.enableProvider(result.id) - - def addTrafficTypes(self, physical_network_id, traffictypes): - [self.addTrafficType(physical_network_id, traffic_type) - for traffic_type in traffictypes] - - def addTrafficType(self, physical_network_id, traffictype): - traffic_type = addTrafficType.addTrafficTypeCmd() - traffic_type.physicalnetworkid = physical_network_id - traffic_type.traffictype = traffictype.typ - traffic_type.kvmnetworklabel = traffictype.kvm\ - if traffictype.kvm is not None else None - traffic_type.xennetworklabel = traffictype.xen\ - if traffictype.xen is not None else None - traffic_type.vmwarenetworklabel = traffictype.vmware\ - if traffictype.vmware is not None else None - traffic_type.simulatorlabel = traffictype.simulator\ - if traffictype.simulator is not None else None - return self.apiClient.addTrafficType(traffic_type) - - def enableZone(self, zoneid, allocation_state="Enabled"): - zoneCmd = updateZone.updateZoneCmd() - zoneCmd.id = zoneid - zoneCmd.allocationstate = allocation_state - return self.apiClient.updateZone(zoneCmd) - - def updateZoneDetails(self, zoneid, details): - zoneCmd = updateZone.updateZoneCmd() - zoneCmd.id = zoneid - zoneCmd.details = details - return self.apiClient.updateZone(zoneCmd) - - def createZones(self, zones): - for zone in zones: - createzone = createZone.createZoneCmd() - createzone.dns1 = zone.dns1 - createzone.dns2 = zone.dns2 - createzone.internaldns1 = zone.internaldns1 - createzone.internaldns2 = zone.internaldns2 - createzone.name = zone.name - createzone.securitygroupenabled = zone.securitygroupenabled - createzone.localstorageenabled = zone.localstorageenabled - createzone.networktype = zone.networktype - if zone.securitygroupenabled != "true": - createzone.guestcidraddress = zone.guestcidraddress - - zoneresponse = self.apiClient.createZone(createzone) - zoneId = zoneresponse.id - - for pnet in zone.physical_networks: - phynetwrk = self.createPhysicalNetwork(pnet, zoneId) - self.configureProviders(phynetwrk, pnet.providers) - self.updatePhysicalNetwork(phynetwrk.id, "Enabled", - vlan=pnet.vlan) - - if zone.networktype == "Basic": - listnetworkoffering =\ - listNetworkOfferings.listNetworkOfferingsCmd() - listnetworkoffering.name =\ - "DefaultSharedNetscalerEIPandELBNetworkOffering" \ - if len(filter(lambda x: - x.typ == 'Public', - zone.physical_networks[0]. - traffictypes)) > 0 \ - else "DefaultSharedNetworkOfferingWithSGService" - if zone.networkofferingname is not None: - listnetworkoffering.name = zone.networkofferingname - - listnetworkofferingresponse = \ - self.apiClient.listNetworkOfferings(listnetworkoffering) - - guestntwrk = configGenerator.network() - guestntwrk.displaytext = "guestNetworkForBasicZone" - guestntwrk.name = "guestNetworkForBasicZone" - guestntwrk.zoneid = zoneId - guestntwrk.networkofferingid = \ - listnetworkofferingresponse[0].id - - networkid = self.createnetworks([guestntwrk], zoneId) - self.createpods(zone.pods, zoneId, networkid) - if self.isEipElbZone(zone): - self.createVlanIpRanges(zone.networktype, zone.ipranges, - zoneId, forvirtualnetwork=True) - - isPureAdvancedZone = (zone.networktype == "Advanced" - and zone.securitygroupenabled != "true") - if isPureAdvancedZone: - self.createpods(zone.pods, zoneId) - self.createVlanIpRanges(zone.networktype, zone.ipranges, - zoneId) - elif (zone.networktype == "Advanced" - and zone.securitygroupenabled == "true"): - listnetworkoffering =\ - listNetworkOfferings.listNetworkOfferingsCmd() - listnetworkoffering.name =\ - "DefaultSharedNetworkOfferingWithSGService" - if zone.networkofferingname is not None: - listnetworkoffering.name = zone.networkofferingname - - listnetworkofferingresponse = \ - self.apiClient.listNetworkOfferings(listnetworkoffering) - - networkcmd = createNetwork.createNetworkCmd() - networkcmd.displaytext = "Shared SG enabled network" - networkcmd.name = "Shared SG enabled network" - networkcmd.networkofferingid =\ - listnetworkofferingresponse[0].id - networkcmd.zoneid = zoneId - - ipranges = zone.ipranges - if ipranges: - iprange = ipranges.pop() - networkcmd.startip = iprange.startip - networkcmd.endip = iprange.endip - networkcmd.gateway = iprange.gateway - networkcmd.netmask = iprange.netmask - networkcmd.vlan = iprange.vlan - - networkcmdresponse = self.apiClient.createNetwork(networkcmd) - networkId = networkcmdresponse.id - self.createpods(zone.pods, zoneId, networkId) - - '''Note: Swift needs cache storage first''' - self.createCacheStorages(zone.cacheStorages, zoneId) - self.createSecondaryStorages(zone.secondaryStorages, zoneId) - - enabled = getattr(zone, 'enabled', 'True') - if enabled == 'True' or enabled is None: - self.enableZone(zoneId, "Enabled") - details = getattr(zone, 'details') - if details is not None: - det = [d.__dict__ for d in details] - self.updateZoneDetails(zoneId, det) - - return - - def isEipElbZone(self, zone): - if (zone.networktype == "Basic" - and len(filter(lambda x: x.typ == 'Public', - zone.physical_networks[0].traffictypes)) > 0): - return True - return False - - def registerApiKey(self): - listuser = listUsers.listUsersCmd() - listuser.account = "admin" - listuserRes = self.testClient.getApiClient().listUsers(listuser) - userId = listuserRes[0].id - apiKey = listuserRes[0].apikey - securityKey = listuserRes[0].secretkey - if apiKey is None: - registerUser = registerUserKeys.registerUserKeysCmd() - registerUser.id = userId - registerUserRes = \ - self.testClient.getApiClient().registerUserKeys(registerUser) - - apiKey = registerUserRes.apikey - securityKey = registerUserRes.secretkey - - self.config.mgtSvr[0].port = 8080 - self.config.mgtSvr[0].apiKey = apiKey - self.config.mgtSvr[0].securityKey = securityKey - return apiKey, securityKey - - def getCfg(self): - if self.config is not None: - return self.config - return None - - def loadCfg(self): - try: - self.config = configGenerator.get_setup_config(self.configFile) - except: - raise cloudstackException.InvalidParameterException( - "Failed to load config %s" % self.configFile) - - mgt = self.config.mgtSvr[0] - - loggers = self.config.logger - testClientLogFile = None - self.testCaseLogFile = None - self.testResultLogFile = None - if loggers is not None and len(loggers) > 0: - for log in loggers: - if log.name == "TestClient": - testClientLogFile = log.file - elif log.name == "TestCase": - self.testCaseLogFile = log.file - elif log.name == "TestResult": - self.testResultLogFile = log.file - - testClientLogger = None - if testClientLogFile is not None: - testClientLogger = logging.getLogger("testclient.testengine.run") - fh = logging.FileHandler(testClientLogFile) - fh.setFormatter(logging. - Formatter("%(asctime)s - %(levelname)s - %(name)s\ - - %(message)s")) - testClientLogger.addHandler(fh) - testClientLogger.setLevel(logging.INFO) - self.testClientLogger = testClientLogger - - self.testClient = \ - cloudstackTestClient.\ - cloudstackTestClient(mgt.mgtSvrIp, mgt.port, mgt.user, mgt.passwd, - mgt.apiKey, mgt.securityKey, - logging=self.testClientLogger) - if mgt.apiKey is None: - apiKey, securityKey = self.registerApiKey() - self.testClient = cloudstackTestClient.cloudstackTestClient( - mgt.mgtSvrIp, 8080, - mgt.user, mgt.passwd, - apiKey, securityKey, - logging=self.testClientLogger) - - """config database""" - dbSvr = self.config.dbSvr - if dbSvr is not None: - self.testClient.dbConfigure(dbSvr.dbSvr, dbSvr.port, dbSvr.user, - dbSvr.passwd, dbSvr.db) - - self.apiClient = self.testClient.getApiClient() - """set hypervisor""" - if mgt.hypervisor: - self.apiClient.hypervisor = mgt.hypervisor - else: - self.apiClient.hypervisor = "XenServer" # Defaults to Xenserver - - def updateConfiguration(self, globalCfg): - if globalCfg is None: - return None - - for config in globalCfg: - updateCfg = updateConfiguration.updateConfigurationCmd() - updateCfg.name = config.name - updateCfg.value = config.value - self.apiClient.updateConfiguration(updateCfg) - - def copyAttributesToCommand(self, source, command): - - map(lambda attr: setattr(command, attr, getattr(source, attr, None)), - filter(lambda attr: not attr.startswith("__") and attr not in - ["required", "isAsync"], dir(command))) - - def configureS3(self, s3): - if s3 is None: - return - - command = addS3.addS3Cmd() - self.copyAttributesToCommand(s3, command) - self.apiClient.addS3(command) - - def deploy(self): - self.loadCfg() - self.updateConfiguration(self.config.globalConfig) - self.createZones(self.config.zones) - self.configureS3(self.config.s3) - -if __name__ == "__main__": - - parser = OptionParser() - - parser.add_option("-i", "--input", action="store", - default="./datacenterCfg", dest="input", help="the path \ - where the json config file generated, by default is \ - ./datacenterCfg") - - (options, args) = parser.parse_args() - - deploy = deployDataCenters(options.input) - deploy.deploy() - - """ - create = createStoragePool.createStoragePoolCmd() - create.clusterid = 1 - create.podid = 2 - create.name = "fdffdf" - create.url = "nfs://jfkdjf/fdkjfkd" - create.zoneid = 2 - - deploy = deployDataCenters("./datacenterCfg") - deploy.loadCfg() - deploy.apiClient.createStoragePool(create) - """ diff --git a/tools/marvin/build/lib/marvin/integration/__init__.py b/tools/marvin/build/lib/marvin/integration/__init__.py deleted file mode 100644 index 57823fcc162..00000000000 --- a/tools/marvin/build/lib/marvin/integration/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - diff --git a/tools/marvin/build/lib/marvin/integration/lib/__init__.py b/tools/marvin/build/lib/marvin/integration/lib/__init__.py deleted file mode 100644 index 978b68af62a..00000000000 --- a/tools/marvin/build/lib/marvin/integration/lib/__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. diff --git a/tools/marvin/build/lib/marvin/integration/lib/base.py b/tools/marvin/build/lib/marvin/integration/lib/base.py deleted file mode 100644 index 4f151378cc9..00000000000 --- a/tools/marvin/build/lib/marvin/integration/lib/base.py +++ /dev/null @@ -1,3593 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -""" Base class for all Cloudstack resources - -Virtual machine, Volume, Snapshot etc -""" - -import marvin -from utils import is_server_ssh_ready, random_gen -from marvin.cloudstackAPI import * -# Import System modules -import time -import hashlib -import base64 - - -class Domain: - """ Domain Life Cycle """ - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, name=None, networkdomain=None, - parentdomainid=None): - """Creates an domain""" - - cmd = createDomain.createDomainCmd() - - if "domainUUID" in services: - cmd.domainid = "-".join([services["domainUUID"], random_gen()]) - - if name: - cmd.name = "-".join([name, random_gen()]) - elif "name" in services: - cmd.name = "-".join([services["name"], random_gen()]) - - if networkdomain: - cmd.networkdomain = networkdomain - elif "networkdomain" in services: - cmd.networkdomain = services["networkdomain"] - - if parentdomainid: - cmd.parentdomainid = parentdomainid - elif "parentdomainid" in services: - cmd.parentdomainid = services["parentdomainid"] - try: - domain = apiclient.createDomain(cmd) - if domain is not None: - return Domain(domain.__dict__) - except Exception as e: - raise e - - def delete(self, apiclient, cleanup=None): - """Delete an domain""" - cmd = deleteDomain.deleteDomainCmd() - cmd.id = self.id - if cleanup: - cmd.cleanup = cleanup - apiclient.deleteDomain(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists domains""" - cmd = listDomains.listDomainsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listDomains(cmd)) - - -class Account: - """ Account Life Cycle """ - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, admin=False, domainid=None): - """Creates an account""" - cmd = createAccount.createAccountCmd() - - # 0 - User, 1 - Root Admin, 2 - Domain Admin - cmd.accounttype = 2 if (admin and domainid) else int(admin) - - cmd.email = services["email"] - cmd.firstname = services["firstname"] - cmd.lastname = services["lastname"] - - cmd.password = services["password"] - cmd.username = "-".join([services["username"], random_gen(id=apiclient.id)]) - - if "accountUUID" in services: - cmd.accountid = "-".join([services["accountUUID"],random_gen()]) - - if "userUUID" in services: - cmd.userid = "-".join([services["userUUID"],random_gen()]) - - - if domainid: - cmd.domainid = domainid - account = apiclient.createAccount(cmd) - - return Account(account.__dict__) - - def delete(self, apiclient): - """Delete an account""" - cmd = deleteAccount.deleteAccountCmd() - cmd.id = self.id - apiclient.deleteAccount(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists accounts and provides detailed account information for - listed accounts""" - - cmd = listAccounts.listAccountsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listAccounts(cmd)) - - -class User: - """ User Life Cycle """ - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, account, domainid): - cmd = createUser.createUserCmd() - """Creates an user""" - - cmd.account = account - cmd.domainid = domainid - cmd.email = services["email"] - cmd.firstname = services["firstname"] - cmd.lastname = services["lastname"] - - if "userUUID" in services: - cmd.userid = "-".join([services["userUUID"],random_gen()]) - - cmd.password = services["password"] - cmd.username = "-".join([services["username"], random_gen()]) - user = apiclient.createUser(cmd) - - return User(user.__dict__) - - def delete(self, apiclient): - """Delete an account""" - cmd = deleteUser.deleteUserCmd() - cmd.id = self.id - apiclient.deleteUser(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists users and provides detailed account information for - listed users""" - - cmd = listUsers.listUsersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listUsers(cmd)) - - @classmethod - def registerUserKeys(cls, apiclient, userid): - cmd = registerUserKeys.registerUserKeysCmd() - cmd.id = userid - return apiclient.registerUserKeys(cmd) - - def update(self, apiclient, **kwargs): - """Updates the user details""" - - cmd = updateUser.updateUserCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return (apiclient.updateUser(cmd)) - - @classmethod - def update(cls, apiclient, id, **kwargs): - """Updates the user details (class method)""" - - cmd = updateUser.updateUserCmd() - cmd.id = id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return (apiclient.updateUser(cmd)) - - @classmethod - def login(cls, apiclient, username, password, domain=None, domainid=None): - """Logins to the CloudStack""" - - cmd = login.loginCmd() - cmd.username = username - cmd.password = password - if domain: - cmd.domain = domain - if domainid: - cmd.domainId = domainid - return apiclient.login(cmd) - - -class VirtualMachine: - """Manage virtual machine lifecycle""" - - def __init__(self, items, services): - self.__dict__.update(items) - if "username" in services: - self.username = services["username"] - else: - self.username = 'root' - if "password" in services: - self.password = services["password"] - else: - self.password = 'password' - if "ssh_port" in services: - self.ssh_port = services["ssh_port"] - else: - self.ssh_port = 22 - self.ssh_client = None - # extract out the ipaddress - self.ipaddress = self.nic[0].ipaddress - - @classmethod - def ssh_access_group(cls, apiclient, cmd): - """ - Programs the security group with SSH access before deploying virtualmachine - @return: - """ - zone_list = Zone.list( - apiclient, - id=cmd.zoneid if cmd.zoneid else None, - domainid=cmd.domainid if cmd.domainid else None - ) - zone = zone_list[0] - #check if security groups settings is enabled for the zone - if zone.securitygroupsenabled: - list_security_groups = SecurityGroup.list( - apiclient, - securitygroupname="basic_sec_grp" - ) - - if not isinstance(list_security_groups, list): - basic_mode_security_group = SecurityGroup.create( - apiclient, - {"name": "basic_sec_grp"} - ) - sec_grp_services = { - "protocol": "TCP", - "startport": 22, - "endport": 22, - "cidrlist": "0.0.0.0/0" - } - #Authorize security group for above ingress rule - basic_mode_security_group.authorize(apiclient, sec_grp_services, account=cmd.account, - domainid=cmd.domainid) - else: - basic_mode_security_group = list_security_groups[0] - - if isinstance(cmd.securitygroupids, list): - cmd.securitygroupids.append(basic_mode_security_group.id) - else: - cmd.securitygroupids = [basic_mode_security_group.id] - - @classmethod - def access_ssh_over_nat(cls, apiclient, services, virtual_machine, allow_egress=False): - """ - Program NAT and PF rules to open up ssh access to deployed guest - @return: - """ - public_ip = PublicIPAddress.create( - apiclient=apiclient, - accountid=virtual_machine.account, - zoneid=virtual_machine.zoneid, - domainid=virtual_machine.domainid, - services=services - ) - FireWallRule.create( - apiclient=apiclient, - ipaddressid=public_ip.ipaddress.id, - protocol='TCP', - cidrlist=['0.0.0.0/0'], - startport=22, - endport=22 - ) - nat_rule = NATRule.create( - apiclient=apiclient, - virtual_machine=virtual_machine, - services=services, - ipaddressid=public_ip.ipaddress.id - ) - if allow_egress: - EgressFireWallRule.create( - apiclient=apiclient, - networkid=virtual_machine.nic[0].networkid, - protocol='All', - cidrlist='0.0.0.0/0' - ) - virtual_machine.ssh_ip = nat_rule.ipaddress - virtual_machine.public_ip = nat_rule.ipaddress - - @classmethod - def create(cls, apiclient, services, templateid=None, accountid=None, - domainid=None, zoneid=None, networkids=None, serviceofferingid=None, - securitygroupids=None, projectid=None, startvm=None, - diskofferingid=None, affinitygroupnames=None, affinitygroupids=None, group=None, - hostid=None, keypair=None, ipaddress=None, mode='default', method='GET'): - """Create the instance""" - - cmd = deployVirtualMachine.deployVirtualMachineCmd() - - if serviceofferingid: - cmd.serviceofferingid = serviceofferingid - elif "serviceoffering" in services: - cmd.serviceofferingid = services["serviceoffering"] - - if zoneid: - cmd.zoneid = zoneid - elif "zoneid" in services: - cmd.zoneid = services["zoneid"] - cmd.hypervisor = apiclient.hypervisor - - if "displayname" in services: - cmd.displayname = services["displayname"] - - if "name" in services: - cmd.name = services["name"] - - if accountid: - cmd.account = accountid - elif "account" in services: - cmd.account = services["account"] - - if domainid: - cmd.domainid = domainid - elif "domainid" in services: - cmd.domainid = services["domainid"] - - if networkids: - cmd.networkids = networkids - allow_egress = False - elif "networkids" in services: - cmd.networkids = services["networkids"] - allow_egress = False - else: - # When no networkids are passed, network - # is created using the "defaultOfferingWithSourceNAT" - # which has an egress policy of DENY. But guests in tests - # need access to test network connectivity - allow_egress = True - - if templateid: - cmd.templateid = templateid - elif "template" in services: - cmd.templateid = services["template"] - - if diskofferingid: - cmd.diskofferingid = diskofferingid - elif "diskoffering" in services: - cmd.diskofferingid = services["diskoffering"] - - if keypair: - cmd.keypair = keypair - elif "keypair" in services: - cmd.keypair = services["keypair"] - - if ipaddress: - cmd.ipaddress = ipaddress - elif ipaddress in services: - cmd.ipaddress = services["ipaddress"] - - if securitygroupids: - cmd.securitygroupids = [str(sg_id) for sg_id in securitygroupids] - - if "affinitygroupnames" in services: - cmd.affinitygroupnames = services["affinitygroupnames"] - elif affinitygroupnames: - cmd.affinitygroupnames = affinitygroupnames - - if affinitygroupids: - cmd.affinitygroupids = affinitygroupids - - if projectid: - cmd.projectid = projectid - - if startvm is not None: - cmd.startvm = startvm - - if hostid: - cmd.hostid = hostid - - if "userdata" in services: - cmd.userdata = base64.urlsafe_b64encode(services["userdata"]) - - if group: - cmd.group = group - - #program default access to ssh - if mode.lower() == 'basic': - cls.ssh_access_group(apiclient, cmd) - - virtual_machine = apiclient.deployVirtualMachine(cmd, method=method) - - virtual_machine.ssh_ip = virtual_machine.nic[0].ipaddress - if startvm == False: - virtual_machine.public_ip = virtual_machine.nic[0].ipaddress - return VirtualMachine(virtual_machine.__dict__, services) - - #program ssh access over NAT via PF - if mode.lower() == 'advanced': - cls.access_ssh_over_nat(apiclient, services, virtual_machine, allow_egress=allow_egress) - elif mode.lower() == 'basic': - if virtual_machine.publicip is not None: - vm_ssh_ip = virtual_machine.publicip #EIP/ELB (netscaler) enabled zone - else: - vm_ssh_ip = virtual_machine.nic[0].ipaddress #regular basic zone with security group - virtual_machine.ssh_ip = vm_ssh_ip - virtual_machine.public_ip = vm_ssh_ip - - return VirtualMachine(virtual_machine.__dict__, services) - - def start(self, apiclient): - """Start the instance""" - cmd = startVirtualMachine.startVirtualMachineCmd() - cmd.id = self.id - apiclient.startVirtualMachine(cmd) - - def stop(self, apiclient): - """Stop the instance""" - cmd = stopVirtualMachine.stopVirtualMachineCmd() - cmd.id = self.id - apiclient.stopVirtualMachine(cmd) - - def reboot(self, apiclient): - """Reboot the instance""" - cmd = rebootVirtualMachine.rebootVirtualMachineCmd() - cmd.id = self.id - apiclient.rebootVirtualMachine(cmd) - - def recover(self, apiclient): - """Recover the instance""" - cmd = recoverVirtualMachine.recoverVirtualMachineCmd() - cmd.id = self.id - apiclient.recoverVirtualMachine(cmd) - - def get_ssh_client(self, ipaddress=None, reconnect=False, port=None, keyPairFileLocation=None): - """Get SSH object of VM""" - - # If NAT Rules are not created while VM deployment in Advanced mode - # then, IP address must be passed - if ipaddress != None: - self.ssh_ip = ipaddress - if port: - self.ssh_port = port - - if keyPairFileLocation is not None: - self.password = None - - if reconnect: - self.ssh_client = is_server_ssh_ready( - self.ssh_ip, - self.ssh_port, - self.username, - self.password, - keyPairFileLocation=keyPairFileLocation - ) - self.ssh_client = self.ssh_client or is_server_ssh_ready( - self.ssh_ip, - self.ssh_port, - self.username, - self.password, - keyPairFileLocation=keyPairFileLocation - ) - return self.ssh_client - - def resetSshKey(self, apiclient, **kwargs): - """Resets SSH key""" - - cmd = resetSSHKeyForVirtualMachine.resetSSHKeyForVirtualMachineCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.resetSSHKeyForVirtualMachine(cmd)) - - def update(self, apiclient, **kwargs): - """Updates the VM data""" - - cmd = updateVirtualMachine.updateVirtualMachineCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateVirtualMachine(cmd)) - - def delete(self, apiclient): - """Destroy an Instance""" - cmd = destroyVirtualMachine.destroyVirtualMachineCmd() - cmd.id = self.id - apiclient.destroyVirtualMachine(cmd) - - def migrate(self, apiclient, hostid=None): - """migrate an Instance""" - cmd = migrateVirtualMachine.migrateVirtualMachineCmd() - cmd.virtualmachineid = self.id - if hostid: - cmd.hostid = hostid - apiclient.migrateVirtualMachine(cmd) - - def attach_volume(self, apiclient, volume): - """Attach volume to instance""" - cmd = attachVolume.attachVolumeCmd() - cmd.id = volume.id - cmd.virtualmachineid = self.id - return apiclient.attachVolume(cmd) - - def detach_volume(self, apiclient, volume): - """Detach volume to instance""" - cmd = detachVolume.detachVolumeCmd() - cmd.id = volume.id - return apiclient.detachVolume(cmd) - - def add_nic(self, apiclient, networkId): - """Add a NIC to a VM""" - cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd() - cmd.virtualmachineid = self.id - cmd.networkid = networkId - return apiclient.addNicToVirtualMachine(cmd) - - def remove_nic(self, apiclient, nicId): - """Remove a NIC to a VM""" - cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd() - cmd.nicid = nicId - cmd.virtualmachineid = self.id - return apiclient.removeNicFromVirtualMachine(cmd) - - def update_default_nic(self, apiclient, nicId): - """Set a NIC to be the default network adapter for a VM""" - cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd() - cmd.nicid = nicId - cmd.virtualmachineid = self.id - return apiclient.updateDefaultNicForVirtualMachine(cmd) - - def attach_iso(self, apiclient, iso): - """Attach ISO to instance""" - cmd = attachIso.attachIsoCmd() - cmd.id = iso.id - cmd.virtualmachineid = self.id - return apiclient.attachIso(cmd) - - def detach_iso(self, apiclient): - """Detach ISO to instance""" - cmd = detachIso.detachIsoCmd() - cmd.id = self.id - return apiclient.detachIso(cmd) - - def change_service_offering(self, apiclient, serviceOfferingId): - """Change service offering of the instance""" - cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd() - cmd.id = self.id - cmd.serviceofferingid = serviceOfferingId - return apiclient.changeServiceForVirtualMachine(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all VMs matching criteria""" - - cmd = listVirtualMachines.listVirtualMachinesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVirtualMachines(cmd)) - - def resetPassword(self, apiclient): - """Resets VM password if VM created using password enabled template""" - - cmd = resetPasswordForVirtualMachine.resetPasswordForVirtualMachineCmd() - cmd.id = self.id - try: - response = apiclient.resetPasswordForVirtualMachine(cmd) - except Exception as e: - raise Exception("Reset Password failed! - %s" % e) - if response is not None: - return response.password - - def assign_virtual_machine(self, apiclient, account, domainid): - """Move a user VM to another user under same domain.""" - - cmd = assignVirtualMachine.assignVirtualMachineCmd() - cmd.virtualmachineid = self.id - cmd.account = account - cmd.domainid = domainid - try: - response = apiclient.assignVirtualMachine(cmd) - return response - except Exception as e: - raise Exception("assignVirtualMachine failed - %s" %e) - - def update_affinity_group(self, apiclient, affinitygroupids=None, - affinitygroupnames=None): - """Update affinity group of a VM""" - cmd = updateVMAffinityGroup.updateVMAffinityGroupCmd() - cmd.id = self.id - - if affinitygroupids: - cmd.affinitygroupids = affinitygroupids - - if affinitygroupnames: - cmd.affinitygroupnames = affinitygroupnames - - return apiclient.updateVMAffinityGroup(cmd) - - -class Volume: - """Manage Volume Life cycle - """ - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, zoneid=None, account=None, - domainid=None, diskofferingid=None, projectid=None): - """Create Volume""" - cmd = createVolume.createVolumeCmd() - cmd.name = services["diskname"] - - if diskofferingid: - cmd.diskofferingid = diskofferingid - elif "diskofferingid" in services: - cmd.diskofferingid = services["diskofferingid"] - - if zoneid: - cmd.zoneid = zoneid - elif "zoneid" in services: - cmd.zoneid = services["zoneid"] - - if account: - cmd.account = account - elif "account" in services: - cmd.account = services["account"] - - if domainid: - cmd.domainid = domainid - elif "domainid" in services: - cmd.domainid = services["domainid"] - - if projectid: - cmd.projectid = projectid - return Volume(apiclient.createVolume(cmd).__dict__) - - @classmethod - def create_custom_disk(cls, apiclient, services, account=None, - domainid=None, diskofferingid=None): - """Create Volume from Custom disk offering""" - cmd = createVolume.createVolumeCmd() - cmd.name = services["diskname"] - - if diskofferingid: - cmd.diskofferingid = diskofferingid - elif "customdiskofferingid" in services: - cmd.diskofferingid = services["customdiskofferingid"] - - cmd.size = services["customdisksize"] - cmd.zoneid = services["zoneid"] - - if account: - cmd.account = account - else: - cmd.account = services["account"] - - if domainid: - cmd.domainid = domainid - else: - cmd.domainid = services["domainid"] - - return Volume(apiclient.createVolume(cmd).__dict__) - - @classmethod - def create_from_snapshot(cls, apiclient, snapshot_id, services, - account=None, domainid=None): - """Create Volume from snapshot""" - cmd = createVolume.createVolumeCmd() - cmd.name = "-".join([services["diskname"], random_gen()]) - cmd.snapshotid = snapshot_id - cmd.zoneid = services["zoneid"] - cmd.size = services["size"] - if account: - cmd.account = account - else: - cmd.account = services["account"] - if domainid: - cmd.domainid = domainid - else: - cmd.domainid = services["domainid"] - return Volume(apiclient.createVolume(cmd).__dict__) - - def delete(self, apiclient): - """Delete Volume""" - cmd = deleteVolume.deleteVolumeCmd() - cmd.id = self.id - apiclient.deleteVolume(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all volumes matching criteria""" - - cmd = listVolumes.listVolumesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVolumes(cmd)) - - def resize(self, apiclient, **kwargs): - """Resize a volume""" - cmd = resizeVolume.resizeVolumeCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.resizeVolume(cmd)) - - @classmethod - def upload(cls, apiclient, services, zoneid=None, account=None, domainid=None, url=None): - """Uploads the volume to specified account""" - - cmd = uploadVolume.uploadVolumeCmd() - if zoneid: - cmd.zoneid = zoneid - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - cmd.format = services["format"] - cmd.name = services["diskname"] - if url: - cmd.url = url - else: - cmd.url = services["url"] - return Volume(apiclient.uploadVolume(cmd).__dict__) - - def wait_for_upload(self, apiclient, timeout=5, interval=60): - """Wait for upload""" - # Sleep to ensure template is in proper state before download - time.sleep(interval) - - while True: - volume_response = Volume.list( - apiclient, - id=self.id, - zoneid=self.zoneid, - ) - if isinstance(volume_response, list): - - volume = volume_response[0] - # If volume is ready, - # volume.state = Allocated - if volume.state == 'Uploaded': - break - - elif 'Uploading' in volume.state: - time.sleep(interval) - - elif 'Installing' not in volume.state: - raise Exception( - "Error in uploading volume: status - %s" % - volume.state) - elif timeout == 0: - break - - else: - time.sleep(interval) - timeout = timeout - 1 - return - - @classmethod - def migrate(cls, apiclient, **kwargs): - """Migrate a volume""" - cmd = migrateVolume.migrateVolumeCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.migrateVolume(cmd)) - -class Snapshot: - """Manage Snapshot Lifecycle - """ - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, volume_id, account=None, - domainid=None, projectid=None): - """Create Snapshot""" - cmd = createSnapshot.createSnapshotCmd() - cmd.volumeid = volume_id - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - if projectid: - cmd.projectid = projectid - return Snapshot(apiclient.createSnapshot(cmd).__dict__) - - def delete(self, apiclient): - """Delete Snapshot""" - cmd = deleteSnapshot.deleteSnapshotCmd() - cmd.id = self.id - apiclient.deleteSnapshot(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all snapshots matching criteria""" - - cmd = listSnapshots.listSnapshotsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listSnapshots(cmd)) - - -class Template: - """Manage template life cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, volumeid=None, - account=None, domainid=None, projectid=None): - """Create template from Volume""" - # Create template from Virtual machine and Volume ID - cmd = createTemplate.createTemplateCmd() - cmd.displaytext = services["displaytext"] - cmd.name = "-".join([services["name"], random_gen()]) - if "ostypeid" in services: - cmd.ostypeid = services["ostypeid"] - elif "ostype" in services: - # Find OSTypeId from Os type - sub_cmd = listOsTypes.listOsTypesCmd() - sub_cmd.description = services["ostype"] - ostypes = apiclient.listOsTypes(sub_cmd) - - if not isinstance(ostypes, list): - raise Exception( - "Unable to find Ostype id with desc: %s" % - services["ostype"]) - cmd.ostypeid = ostypes[0].id - else: - raise Exception( - "Unable to find Ostype is required for creating template") - - cmd.isfeatured = services["isfeatured"] if "isfeatured" in services else False - cmd.ispublic = services["ispublic"] if "ispublic" in services else False - cmd.isextractable = services["isextractable"] if "isextractable" in services else False - cmd.passwordenabled = services["passwordenabled"] if "passwordenabled" in services else False - - if volumeid: - cmd.volumeid = volumeid - - if account: - cmd.account = account - - if domainid: - cmd.domainid = domainid - - if projectid: - cmd.projectid = projectid - return Template(apiclient.createTemplate(cmd).__dict__) - - @classmethod - def register(cls, apiclient, services, zoneid=None, - account=None, domainid=None): - """Create template from URL""" - - # Create template from Virtual machine and Volume ID - cmd = registerTemplate.registerTemplateCmd() - cmd.displaytext = services["displaytext"] - cmd.name = "-".join([services["name"], random_gen()]) - cmd.format = services["format"] - cmd.hypervisor = apiclient.hypervisor - - if "ostypeid" in services: - cmd.ostypeid = services["ostypeid"] - elif "ostype" in services: - # Find OSTypeId from Os type - sub_cmd = listOsTypes.listOsTypesCmd() - sub_cmd.description = services["ostype"] - ostypes = apiclient.listOsTypes(sub_cmd) - - if not isinstance(ostypes, list): - raise Exception( - "Unable to find Ostype id with desc: %s" % - services["ostype"]) - cmd.ostypeid = ostypes[0].id - else: - raise Exception( - "Unable to find Ostype is required for registering template") - - cmd.url = services["url"] - - if zoneid: - cmd.zoneid = zoneid - else: - cmd.zoneid = services["zoneid"] - - cmd.isfeatured = services["isfeatured"] if "isfeatured" in services else False - cmd.ispublic = services["ispublic"] if "ispublic" in services else False - cmd.isextractable = services["isextractable"] if "isextractable" in services else False - cmd.passwordenabled = services["passwordenabled"] if "passwordenabled" in services else False - - if account: - cmd.account = account - - if domainid: - cmd.domainid = domainid - - # Register Template - template = apiclient.registerTemplate(cmd) - - if isinstance(template, list): - return Template(template[0].__dict__) - - @classmethod - def extract(cls, apiclient, id, mode, zoneid=None): - "Extract template " - - cmd = extractTemplate.extractTemplateCmd() - cmd.id = id - cmd.mode = mode - cmd.zoneid = zoneid - - return apiclient.extractTemplate(cmd) - - @classmethod - def create_from_snapshot(cls, apiclient, snapshot, services, - random_name=True): - """Create Template from snapshot""" - # Create template from Virtual machine and Snapshot ID - cmd = createTemplate.createTemplateCmd() - cmd.displaytext = services["displaytext"] - cmd.name = "-".join([ - services["name"], - random_gen() - ]) if random_name else services["name"] - - if "ostypeid" in services: - cmd.ostypeid = services["ostypeid"] - elif "ostype" in services: - # Find OSTypeId from Os type - sub_cmd = listOsTypes.listOsTypesCmd() - sub_cmd.description = services["ostype"] - ostypes = apiclient.listOsTypes(sub_cmd) - - if not isinstance(ostypes, list): - raise Exception( - "Unable to find Ostype id with desc: %s" % - services["ostype"]) - cmd.ostypeid = ostypes[0].id - else: - raise Exception( - "Unable to find Ostype is required for creating template") - - cmd.snapshotid = snapshot.id - return Template(apiclient.createTemplate(cmd).__dict__) - - def delete(self, apiclient): - """Delete Template""" - - cmd = deleteTemplate.deleteTemplateCmd() - cmd.id = self.id - apiclient.deleteTemplate(cmd) - - def download(self, apiclient, timeout=5, interval=60): - """Download Template""" - # Sleep to ensure template is in proper state before download - time.sleep(interval) - - while True: - template_response = Template.list( - apiclient, - id=self.id, - zoneid=self.zoneid, - templatefilter='self' - ) - if isinstance(template_response, list): - - template = template_response[0] - # If template is ready, - # template.status = Download Complete - # Downloading - x% Downloaded - # Error - Any other string - if template.status == 'Download Complete': - break - - elif 'Downloaded' in template.status: - time.sleep(interval) - - elif 'Installing' not in template.status: - raise Exception( - "Error in downloading template: status - %s" % - template.status) - - elif timeout == 0: - break - - else: - time.sleep(interval) - timeout = timeout - 1 - return - - def updatePermissions(self, apiclient, **kwargs): - """Updates the template permissions""" - - cmd = updateTemplatePermissions.updateTemplatePermissionsCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateTemplatePermissions(cmd)) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all templates matching criteria""" - - cmd = listTemplates.listTemplatesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listTemplates(cmd)) - - -class Iso: - """Manage ISO life cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, account=None, domainid=None, - projectid=None): - """Create an ISO""" - # Create ISO from URL - cmd = registerIso.registerIsoCmd() - cmd.displaytext = services["displaytext"] - cmd.name = services["name"] - if "ostypeid" in services: - cmd.ostypeid = services["ostypeid"] - elif "ostype" in services: - # Find OSTypeId from Os type - sub_cmd = listOsTypes.listOsTypesCmd() - sub_cmd.description = services["ostype"] - ostypes = apiclient.listOsTypes(sub_cmd) - - if not isinstance(ostypes, list): - raise Exception( - "Unable to find Ostype id with desc: %s" % - services["ostype"]) - cmd.ostypeid = ostypes[0].id - else: - raise Exception( - "Unable to find Ostype is required for creating ISO") - - cmd.url = services["url"] - cmd.zoneid = services["zoneid"] - - if "isextractable" in services: - cmd.isextractable = services["isextractable"] - if "isfeatured" in services: - cmd.isfeatured = services["isfeatured"] - if "ispublic" in services: - cmd.ispublic = services["ispublic"] - - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - if projectid: - cmd.projectid = projectid - # Register ISO - iso = apiclient.registerIso(cmd) - - if iso: - return Iso(iso[0].__dict__) - - def delete(self, apiclient): - """Delete an ISO""" - cmd = deleteIso.deleteIsoCmd() - cmd.id = self.id - apiclient.deleteIso(cmd) - return - - def download(self, apiclient, timeout=5, interval=60): - """Download an ISO""" - # Ensuring ISO is successfully downloaded - while True: - time.sleep(interval) - - cmd = listIsos.listIsosCmd() - cmd.id = self.id - iso_response = apiclient.listIsos(cmd) - - if isinstance(iso_response, list): - response = iso_response[0] - # Again initialize timeout to avoid listISO failure - timeout = 5 - # Check whether download is in progress(for Ex:10% Downloaded) - # or ISO is 'Successfully Installed' - if response.status == 'Successfully Installed': - return - elif 'Downloaded' not in response.status and \ - 'Installing' not in response.status: - raise Exception( - "Error In Downloading ISO: ISO Status - %s" % - response.status) - - elif timeout == 0: - raise Exception("ISO download Timeout Exception") - else: - timeout = timeout - 1 - return - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all available ISO files.""" - - cmd = listIsos.listIsosCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listIsos(cmd)) - - -class PublicIPAddress: - """Manage Public IP Addresses""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, accountid=None, zoneid=None, domainid=None, services=None, - networkid=None, projectid=None, vpcid=None, isportable=False): - """Associate Public IP address""" - cmd = associateIpAddress.associateIpAddressCmd() - - if accountid: - cmd.account = accountid - elif "account" in services: - cmd.account = services["account"] - - if zoneid: - cmd.zoneid = zoneid - elif "zoneid" in services: - cmd.zoneid = services["zoneid"] - - if domainid: - cmd.domainid = domainid - elif "domainid" in services: - cmd.domainid = services["domainid"] - - if isportable: - cmd.isportable = isportable - - if networkid: - cmd.networkid = networkid - - if projectid: - cmd.projectid = projectid - - if vpcid: - cmd.vpcid = vpcid - return PublicIPAddress(apiclient.associateIpAddress(cmd).__dict__) - - def delete(self, apiclient): - """Dissociate Public IP address""" - cmd = disassociateIpAddress.disassociateIpAddressCmd() - cmd.id = self.ipaddress.id - apiclient.disassociateIpAddress(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """List all Public IPs matching criteria""" - - cmd = listPublicIpAddresses.listPublicIpAddressesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listPublicIpAddresses(cmd)) - - -class NATRule: - """Manage port forwarding rule""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, virtual_machine, services, ipaddressid=None, - projectid=None, openfirewall=False, networkid=None, vpcid=None): - """Create Port forwarding rule""" - cmd = createPortForwardingRule.createPortForwardingRuleCmd() - - if ipaddressid: - cmd.ipaddressid = ipaddressid - elif "ipaddressid" in services: - cmd.ipaddressid = services["ipaddressid"] - - cmd.privateport = services["privateport"] - cmd.publicport = services["publicport"] - if "privateendport" in services: - cmd.privateendport = services["privateendport"] - if "publicendport" in services: - cmd.publicendport = services["publicendport"] - cmd.protocol = services["protocol"] - cmd.virtualmachineid = virtual_machine.id - - if projectid: - cmd.projectid = projectid - - if openfirewall: - cmd.openfirewall = True - - if networkid: - cmd.networkid = networkid - - if vpcid: - cmd.vpcid = vpcid - return NATRule(apiclient.createPortForwardingRule(cmd).__dict__) - - def delete(self, apiclient): - """Delete port forwarding""" - cmd = deletePortForwardingRule.deletePortForwardingRuleCmd() - cmd.id = self.id - apiclient.deletePortForwardingRule(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """List all NAT rules matching criteria""" - - cmd = listPortForwardingRules.listPortForwardingRulesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listPortForwardingRules(cmd)) - - -class StaticNATRule: - """Manage Static NAT rule""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, ipaddressid=None, networkid=None, vpcid=None): - """Creates static ip forwarding rule""" - - cmd = createFirewallRule.createFirewallRuleCmd() - cmd.protocol = services["protocol"] - cmd.startport = services["startport"] - - if "endport" in services: - cmd.endport = services["endport"] - - if "cidrlist" in services: - cmd.cidrlist = services["cidrlist"] - - if ipaddressid: - cmd.ipaddressid = ipaddressid - elif "ipaddressid" in services: - cmd.ipaddressid = services["ipaddressid"] - - if networkid: - cmd.networkid = networkid - - if vpcid: - cmd.vpcid = vpcid - return StaticNATRule(apiclient.createFirewallRule(cmd).__dict__) - - def delete(self, apiclient): - """Delete IP forwarding rule""" - cmd = deleteIpForwardingRule.deleteIpForwardingRuleCmd() - cmd.id = self.id - apiclient.deleteIpForwardingRule(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """List all IP forwarding rules matching criteria""" - - cmd = listIpForwardingRules.listIpForwardingRulesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listIpForwardingRules(cmd)) - - @classmethod - def enable(cls, apiclient, ipaddressid, virtualmachineid, networkid=None): - """Enables Static NAT rule""" - - cmd = enableStaticNat.enableStaticNatCmd() - cmd.ipaddressid = ipaddressid - cmd.virtualmachineid = virtualmachineid - if networkid: - cmd.networkid = networkid - apiclient.enableStaticNat(cmd) - return - - @classmethod - def disable(cls, apiclient, ipaddressid, virtualmachineid): - """Disables Static NAT rule""" - - cmd = disableStaticNat.disableStaticNatCmd() - cmd.ipaddressid = ipaddressid - apiclient.disableStaticNat(cmd) - return - - -class EgressFireWallRule: - """Manage Egress Firewall rule""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, networkid, protocol, cidrlist=None, - startport=None, endport=None): - """Create Egress Firewall Rule""" - cmd = createEgressFirewallRule.createEgressFirewallRuleCmd() - cmd.networkid = networkid - cmd.protocol = protocol - if cidrlist: - cmd.cidrlist = cidrlist - if startport: - cmd.startport = startport - if endport: - cmd.endport = endport - - return EgressFireWallRule(apiclient.createEgressFirewallRule(cmd).__dict__) - - def delete(self, apiclient): - """Delete Egress Firewall rule""" - cmd = deleteEgressFirewallRule.deleteEgressFirewallRuleCmd() - cmd.id = self.id - apiclient.deleteEgressFirewallRule(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """List all Egress Firewall Rules matching criteria""" - - cmd = listEgressFirewallRules.listEgressFirewallRulesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listEgressFirewallRules(cmd)) - - - -class FireWallRule: - """Manage Firewall rule""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, ipaddressid, protocol, cidrlist=None, - startport=None, endport=None, projectid=None, vpcid=None): - """Create Firewall Rule""" - cmd = createFirewallRule.createFirewallRuleCmd() - cmd.ipaddressid = ipaddressid - cmd.protocol = protocol - if cidrlist: - cmd.cidrlist = cidrlist - if startport: - cmd.startport = startport - if endport: - cmd.endport = endport - - if projectid: - cmd.projectid = projectid - - if vpcid: - cmd.vpcid = vpcid - - return FireWallRule(apiclient.createFirewallRule(cmd).__dict__) - - def delete(self, apiclient): - """Delete Firewall rule""" - cmd = deleteFirewallRule.deleteFirewallRuleCmd() - cmd.id = self.id - apiclient.deleteFirewallRule(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """List all Firewall Rules matching criteria""" - - cmd = listFirewallRules.listFirewallRulesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listFirewallRules(cmd)) - - -class ServiceOffering: - """Manage service offerings cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, domainid=None, **kwargs): - """Create Service offering""" - cmd = createServiceOffering.createServiceOfferingCmd() - cmd.cpunumber = services["cpunumber"] - cmd.cpuspeed = services["cpuspeed"] - cmd.displaytext = services["displaytext"] - cmd.memory = services["memory"] - cmd.name = services["name"] - if "storagetype" in services: - cmd.storagetype = services["storagetype"] - - if "systemvmtype" in services: - cmd.systemvmtype = services['systemvmtype'] - - if "issystem" in services: - cmd.issystem = services['issystem'] - - if "tags" in services: - cmd.tags = services["tags"] - - if "deploymentplanner" in services: - cmd.deploymentplanner = services["deploymentplanner"] - - # Service Offering private to that domain - if domainid: - cmd.domainid = domainid - - [setattr(cmd, k, v) for k, v in kwargs.items()] - return ServiceOffering(apiclient.createServiceOffering(cmd).__dict__) - - def delete(self, apiclient): - """Delete Service offering""" - cmd = deleteServiceOffering.deleteServiceOfferingCmd() - cmd.id = self.id - apiclient.deleteServiceOffering(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all available service offerings.""" - - cmd = listServiceOfferings.listServiceOfferingsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listServiceOfferings(cmd)) - - -class DiskOffering: - """Manage disk offerings cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, custom=False, domainid=None): - """Create Disk offering""" - cmd = createDiskOffering.createDiskOfferingCmd() - cmd.displaytext = services["displaytext"] - cmd.name = services["name"] - if custom: - cmd.customized = True - else: - cmd.disksize = services["disksize"] - - if domainid: - cmd.domainid = domainid - - if "storagetype" in services: - cmd.storagetype = services["storagetype"] - - return DiskOffering(apiclient.createDiskOffering(cmd).__dict__) - - def delete(self, apiclient): - """Delete Disk offering""" - cmd = deleteDiskOffering.deleteDiskOfferingCmd() - cmd.id = self.id - apiclient.deleteDiskOffering(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all available disk offerings.""" - - cmd = listDiskOfferings.listDiskOfferingsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listDiskOfferings(cmd)) - - -class NetworkOffering: - """Manage network offerings cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, **kwargs): - """Create network offering""" - - cmd = createNetworkOffering.createNetworkOfferingCmd() - cmd.displaytext = "-".join([services["displaytext"], random_gen()]) - cmd.name = "-".join([services["name"], random_gen()]) - cmd.guestiptype = services["guestiptype"] - cmd.supportedservices = '' - if "supportedservices" in services: - cmd.supportedservices = services["supportedservices"] - cmd.traffictype = services["traffictype"] - - if "useVpc" in services: - cmd.useVpc = services["useVpc"] - cmd.serviceproviderlist = [] - if "serviceProviderList" in services: - for service, provider in services["serviceProviderList"].items(): - cmd.serviceproviderlist.append({ - 'service': service, - 'provider': provider - }) - if "serviceCapabilityList" in services: - cmd.servicecapabilitylist = [] - for service, capability in services["serviceCapabilityList"].items(): - for ctype, value in capability.items(): - cmd.servicecapabilitylist.append({ - 'service': service, - 'capabilitytype': ctype, - 'capabilityvalue': value - }) - if "specifyVlan" in services: - cmd.specifyVlan = services["specifyVlan"] - if "specifyIpRanges" in services: - cmd.specifyIpRanges = services["specifyIpRanges"] - if "ispersistent" in services: - cmd.ispersistent = services["ispersistent"] - if "egress_policy" in services: - cmd.egressdefaultpolicy = services["egress_policy"] - - cmd.availability = 'Optional' - - [setattr(cmd, k, v) for k, v in kwargs.items()] - - return NetworkOffering(apiclient.createNetworkOffering(cmd).__dict__) - - def delete(self, apiclient): - """Delete network offering""" - cmd = deleteNetworkOffering.deleteNetworkOfferingCmd() - cmd.id = self.id - apiclient.deleteNetworkOffering(cmd) - return - - def update(self, apiclient, **kwargs): - """Lists all available network offerings.""" - - cmd = updateNetworkOffering.updateNetworkOfferingCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateNetworkOffering(cmd)) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all available network offerings.""" - - cmd = listNetworkOfferings.listNetworkOfferingsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetworkOfferings(cmd)) - - -class SnapshotPolicy: - """Manage snapshot policies""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, volumeid, services): - """Create Snapshot policy""" - cmd = createSnapshotPolicy.createSnapshotPolicyCmd() - cmd.intervaltype = services["intervaltype"] - cmd.maxsnaps = services["maxsnaps"] - cmd.schedule = services["schedule"] - cmd.timezone = services["timezone"] - cmd.volumeid = volumeid - return SnapshotPolicy(apiclient.createSnapshotPolicy(cmd).__dict__) - - def delete(self, apiclient): - """Delete Snapshot policy""" - cmd = deleteSnapshotPolicies.deleteSnapshotPoliciesCmd() - cmd.id = self.id - apiclient.deleteSnapshotPolicies(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists snapshot policies.""" - - cmd = listSnapshotPolicies.listSnapshotPoliciesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listSnapshotPolicies(cmd)) - - -class LoadBalancerRule: - """Manage Load Balancer rule""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, ipaddressid=None, accountid=None, - networkid=None, vpcid=None, projectid=None, domainid=None): - """Create Load balancing Rule""" - - cmd = createLoadBalancerRule.createLoadBalancerRuleCmd() - - if ipaddressid: - cmd.publicipid = ipaddressid - elif "ipaddressid" in services: - cmd.publicipid = services["ipaddressid"] - - if accountid: - cmd.account = accountid - elif "account" in services: - cmd.account = services["account"] - - if domainid: - cmd.domainid = domainid - - if vpcid: - cmd.vpcid = vpcid - cmd.name = services["name"] - cmd.algorithm = services["alg"] - cmd.privateport = services["privateport"] - cmd.publicport = services["publicport"] - - if "openfirewall" in services: - cmd.openfirewall = services["openfirewall"] - - if projectid: - cmd.projectid = projectid - - if networkid: - cmd.networkid = networkid - return LoadBalancerRule(apiclient.createLoadBalancerRule(cmd).__dict__) - - def delete(self, apiclient): - """Delete load balancing rule""" - cmd = deleteLoadBalancerRule.deleteLoadBalancerRuleCmd() - cmd.id = self.id - apiclient.deleteLoadBalancerRule(cmd) - return - - def assign(self, apiclient, vms): - """Assign virtual machines to load balancing rule""" - cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd() - cmd.id = self.id - cmd.virtualmachineids = [str(vm.id) for vm in vms] - apiclient.assignToLoadBalancerRule(cmd) - return - - def remove(self, apiclient, vms): - """Remove virtual machines from load balancing rule""" - cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd() - cmd.id = self.id - cmd.virtualmachineids = [str(vm.id) for vm in vms] - apiclient.removeFromLoadBalancerRule(cmd) - return - - def update(self, apiclient, algorithm=None, description=None, name=None, **kwargs): - """Updates the load balancing rule""" - cmd = updateLoadBalancerRule.updateLoadBalancerRuleCmd() - cmd.id = self.id - if algorithm: - cmd.algorithm = algorithm - if description: - cmd.description = description - if name: - cmd.name = name - - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.updateLoadBalancerRule(cmd) - - def createSticky(self, apiclient, methodname, name, description=None, param=None): - """Creates a sticky policy for the LB rule""" - - cmd = createLBStickinessPolicy.createLBStickinessPolicyCmd() - cmd.lbruleid = self.id - cmd.methodname = methodname - cmd.name = name - if description: - cmd.description = description - if param: - cmd.param = [] - for name, value in param.items(): - cmd.param.append({'name': name, 'value': value}) - return apiclient.createLBStickinessPolicy(cmd) - - def deleteSticky(self, apiclient, id): - """Deletes stickyness policy""" - - cmd = deleteLBStickinessPolicy.deleteLBStickinessPolicyCmd() - cmd.id = id - return apiclient.deleteLBStickinessPolicy(cmd) - - @classmethod - def listStickyPolicies(cls, apiclient, lbruleid, **kwargs): - """Lists stickiness policies for load balancing rule""" - - cmd = listLBStickinessPolicies.listLBStickinessPoliciesCmd() - cmd.lbruleid = lbruleid - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.listLBStickinessPolicies(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all Load balancing rules matching criteria""" - - cmd = listLoadBalancerRules.listLoadBalancerRulesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listLoadBalancerRules(cmd)) - - -class Cluster: - """Manage Cluster life cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, zoneid=None, podid=None): - """Create Cluster""" - cmd = addCluster.addClusterCmd() - cmd.clustertype = services["clustertype"] - cmd.hypervisor = apiclient.hypervisor - - if zoneid: - cmd.zoneid = zoneid - else: - cmd.zoneid = services["zoneid"] - - if podid: - cmd.podid = podid - else: - cmd.podid = services["podid"] - - if "username" in services: - cmd.username = services["username"] - if "password" in services: - cmd.password = services["password"] - if "url" in services: - cmd.url = services["url"] - if "clustername" in services: - cmd.clustername = services["clustername"] - - return Cluster(apiclient.addCluster(cmd)[0].__dict__) - - def delete(self, apiclient): - """Delete Cluster""" - cmd = deleteCluster.deleteClusterCmd() - cmd.id = self.id - apiclient.deleteCluster(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """List all Clusters matching criteria""" - - cmd = listClusters.listClustersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listClusters(cmd)) - - -class Host: - """Manage Host life cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, cluster, services, zoneid=None, podid=None): - """Create Host in cluster""" - - cmd = addHost.addHostCmd() - cmd.hypervisor = apiclient.hypervisor - cmd.url = services["url"] - cmd.clusterid = cluster.id - - if zoneid: - cmd.zoneid = zoneid - else: - cmd.zoneid = services["zoneid"] - - if podid: - cmd.podid = podid - else: - cmd.podid = services["podid"] - - if "clustertype" in services: - cmd.clustertype = services["clustertype"] - if "username" in services: - cmd.username = services["username"] - if "password" in services: - cmd.password = services["password"] - - # Add host - host = apiclient.addHost(cmd) - - if isinstance(host, list): - return Host(host[0].__dict__) - - def delete(self, apiclient): - """Delete Host""" - # Host must be in maintenance mode before deletion - cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd() - cmd.id = self.id - apiclient.prepareHostForMaintenance(cmd) - time.sleep(30) - - cmd = deleteHost.deleteHostCmd() - cmd.id = self.id - apiclient.deleteHost(cmd) - return - - def enableMaintenance(self, apiclient): - """enables maintenance mode Host""" - - cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd() - cmd.id = self.id - return apiclient.prepareHostForMaintenance(cmd) - - @classmethod - def enableMaintenance(cls, apiclient, id): - """enables maintenance mode Host""" - - cmd = prepareHostForMaintenance.prepareHostForMaintenanceCmd() - cmd.id = id - return apiclient.prepareHostForMaintenance(cmd) - - def cancelMaintenance(self, apiclient): - """Cancels maintenance mode Host""" - - cmd = cancelHostMaintenance.cancelHostMaintenanceCmd() - cmd.id = self.id - return apiclient.cancelHostMaintenance(cmd) - - @classmethod - def cancelMaintenance(cls, apiclient, id): - """Cancels maintenance mode Host""" - - cmd = cancelHostMaintenance.cancelHostMaintenanceCmd() - cmd.id = id - return apiclient.cancelHostMaintenance(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all Hosts matching criteria""" - - cmd = listHosts.listHostsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listHosts(cmd)) - - @classmethod - def listForMigration(cls, apiclient, **kwargs): - """List all Hosts for migration matching criteria""" - - cmd = findHostsForMigration.findHostsForMigrationCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.findHostsForMigration(cmd)) - - -class StoragePool: - """Manage Storage pools (Primary Storage)""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, clusterid=None, - zoneid=None, podid=None): - """Create Storage pool (Primary Storage)""" - - cmd = createStoragePool.createStoragePoolCmd() - cmd.name = services["name"] - - if podid: - cmd.podid = podid - else: - cmd.podid = services["podid"] - - cmd.url = services["url"] - if clusterid: - cmd.clusterid = clusterid - elif "clusterid" in services: - cmd.clusterid = services["clusterid"] - - if zoneid: - cmd.zoneid = zoneid - else: - cmd.zoneid = services["zoneid"] - - return StoragePool(apiclient.createStoragePool(cmd).__dict__) - - def delete(self, apiclient): - """Delete Storage pool (Primary Storage)""" - - # Storage pool must be in maintenance mode before deletion - cmd = enableStorageMaintenance.enableStorageMaintenanceCmd() - cmd.id = self.id - apiclient.enableStorageMaintenance(cmd) - time.sleep(30) - cmd = deleteStoragePool.deleteStoragePoolCmd() - cmd.id = self.id - apiclient.deleteStoragePool(cmd) - return - - def enableMaintenance(self, apiclient): - """enables maintenance mode Storage pool""" - - cmd = enableStorageMaintenance.enableStorageMaintenanceCmd() - cmd.id = self.id - return apiclient.enableStorageMaintenance(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all storage pools matching criteria""" - - cmd = listStoragePools.listStoragePoolsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listStoragePools(cmd)) - - @classmethod - def listForMigration(cls, apiclient, **kwargs): - """List all storage pools for migration matching criteria""" - - cmd = findStoragePoolsForMigration.findStoragePoolsForMigrationCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.findStoragePoolsForMigration(cmd)) - -class Network: - """Manage Network pools""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, accountid=None, domainid=None, - networkofferingid=None, projectid=None, - subdomainaccess=None, zoneid=None, - gateway=None, netmask=None, vpcid=None, aclid=None): - """Create Network for account""" - cmd = createNetwork.createNetworkCmd() - cmd.name = services["name"] - cmd.displaytext = services["displaytext"] - - if networkofferingid: - cmd.networkofferingid = networkofferingid - elif "networkoffering" in services: - cmd.networkofferingid = services["networkoffering"] - - if zoneid: - cmd.zoneid = zoneid - elif "zoneid" in services: - cmd.zoneid = services["zoneid"] - - if subdomainaccess is not None: - cmd.subdomainaccess = subdomainaccess - - if gateway: - cmd.gateway = gateway - elif "gateway" in services: - cmd.gateway = services["gateway"] - if netmask: - cmd.netmask = netmask - elif "netmask" in services: - cmd.netmask = services["netmask"] - if "startip" in services: - cmd.startip = services["startip"] - if "endip" in services: - cmd.endip = services["endip"] - if "vlan" in services: - cmd.vlan = services["vlan"] - if "acltype" in services: - cmd.acltype = services["acltype"] - - if accountid: - cmd.account = accountid - if domainid: - cmd.domainid = domainid - if projectid: - cmd.projectid = projectid - if vpcid: - cmd.vpcid = vpcid - if aclid: - cmd.aclid = aclid - return Network(apiclient.createNetwork(cmd).__dict__) - - def delete(self, apiclient): - """Delete Account""" - - cmd = deleteNetwork.deleteNetworkCmd() - cmd.id = self.id - apiclient.deleteNetwork(cmd) - - def update(self, apiclient, **kwargs): - """Updates network with parameters passed""" - - cmd = updateNetwork.updateNetworkCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateNetwork(cmd)) - - def restart(self, apiclient, cleanup=None): - """Restarts the network""" - - cmd = restartNetwork.restartNetworkCmd() - cmd.id = self.id - if cleanup: - cmd.cleanup = cleanup - return(apiclient.restartNetwork(cmd)) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all Networks matching criteria""" - - cmd = listNetworks.listNetworksCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetworks(cmd)) - - -class NetworkACL: - """Manage Network ACL lifecycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, networkid=None, protocol=None, - number=None, aclid=None, action='Allow', traffictype=None, cidrlist=[]): - """Create network ACL rules(Ingress/Egress)""" - - cmd = createNetworkACL.createNetworkACLCmd() - if "networkid" in services: - cmd.networkid = services["networkid"] - elif networkid: - cmd.networkid = networkid - - if "protocol" in services: - cmd.protocol = services["protocol"] - if services["protocol"] == 'ICMP': - cmd.icmptype = -1 - cmd.icmpcode = -1 - elif protocol: - cmd.protocol = protocol - - if "startport" in services: - cmd.startport = services["startport"] - if "endport" in services: - cmd.endport = services["endport"] - - if "cidrlist" in services: - cmd.cidrlist = services["cidrlist"] - elif cidrlist: - cmd.cidrlist = cidrlist - - if "traffictype" in services: - cmd.traffictype = services["traffictype"] - elif traffictype: - cmd.traffictype = traffictype - - if "action" in services: - cmd.action = services["action"] - elif action: - cmd.action = action - - if "number" in services: - cmd.number = services["number"] - elif number: - cmd.number = number - - if "aclid" in services: - cmd.aclid = services["aclid"] - elif aclid: - cmd.aclid = aclid - - # Defaulted to Ingress - return NetworkACL(apiclient.createNetworkACL(cmd).__dict__) - - def delete(self, apiclient): - """Delete network acl""" - - cmd = deleteNetworkACL.deleteNetworkACLCmd() - cmd.id = self.id - return apiclient.deleteNetworkACL(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List Network ACLs""" - - cmd = listNetworkACLs.listNetworkACLsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetworkACLs(cmd)) - - -class NetworkACLList: - """Manage Network ACL lists lifecycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, name=None, description=None, vpcid=None): - """Create network ACL container list""" - - cmd = createNetworkACLList.createNetworkACLListCmd() - if "name" in services: - cmd.name = services["name"] - elif name: - cmd.name = name - - if "description" in services: - cmd.description = services["description"] - elif description: - cmd.description = description - - if "vpcid" in services: - cmd.vpcid = services["vpcid"] - elif vpcid: - cmd.vpcid = vpcid - - return NetworkACLList(apiclient.createNetworkACLList(cmd).__dict__) - - def delete(self, apiclient): - """Delete network acl list""" - - cmd = deleteNetworkACLList.deleteNetworkACLListCmd() - cmd.id = self.id - return apiclient.deleteNetworkACLList(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List Network ACL lists""" - - cmd = listNetworkACLLists.listNetworkACLListsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetworkACLLists(cmd)) - - -class Vpn: - """Manage VPN life cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, publicipid, account=None, domainid=None, - projectid=None, networkid=None, vpcid=None): - """Create VPN for Public IP address""" - cmd = createRemoteAccessVpn.createRemoteAccessVpnCmd() - cmd.publicipid = publicipid - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - if projectid: - cmd.projectid = projectid - if networkid: - cmd.networkid = networkid - if vpcid: - cmd.vpcid = vpcid - return Vpn(apiclient.createRemoteAccessVpn(cmd).__dict__) - - def delete(self, apiclient): - """Delete remote VPN access""" - - cmd = deleteRemoteAccessVpn.deleteRemoteAccessVpnCmd() - cmd.publicipid = self.publicipid - apiclient.deleteRemoteAccessVpn(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all VPN matching criteria""" - - cmd = listRemoteAccessVpns.listRemoteAccessVpnsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listRemoteAccessVpns(cmd)) - - -class VpnUser: - """Manage VPN user""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, username, password, account=None, domainid=None, - projectid=None, rand_name=True): - """Create VPN user""" - cmd = addVpnUser.addVpnUserCmd() - cmd.username = "-".join([username, - random_gen()]) if rand_name else username - cmd.password = password - - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - if projectid: - cmd.projectid = projectid - return VpnUser(apiclient.addVpnUser(cmd).__dict__) - - def delete(self, apiclient, projectid=None): - """Remove VPN user""" - - cmd = removeVpnUser.removeVpnUserCmd() - cmd.username = self.username - if projectid: - cmd.projectid = projectid - else: - cmd.account = self.account - cmd.domainid = self.domainid - apiclient.removeVpnUser(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all VPN Users matching criteria""" - - cmd = listVpnUsers.listVpnUsersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVpnUsers(cmd)) - - -class Zone: - """Manage Zone""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, domainid=None): - """Create zone""" - cmd = createZone.createZoneCmd() - cmd.dns1 = services["dns1"] - cmd.internaldns1 = services["internaldns1"] - cmd.name = services["name"] - cmd.networktype = services["networktype"] - - if "dns2" in services: - cmd.dns2 = services["dns2"] - if "internaldns2" in services: - cmd.internaldns2 = services["internaldns2"] - if domainid: - cmd.domainid = domainid - - return Zone(apiclient.createZone(cmd).__dict__) - - def delete(self, apiclient): - """Delete Zone""" - - cmd = deleteZone.deleteZoneCmd() - cmd.id = self.id - apiclient.deleteZone(cmd) - - def update(self, apiclient, **kwargs): - """Update the zone""" - - cmd = updateZone.updateZoneCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.updateZone(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all Zones matching criteria""" - - cmd = listZones.listZonesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listZones(cmd)) - - -class Pod: - """Manage Pod""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services): - """Create Pod""" - cmd = createPod.createPodCmd() - cmd.gateway = services["gateway"] - cmd.netmask = services["netmask"] - cmd.name = services["name"] - cmd.startip = services["startip"] - cmd.endip = services["endip"] - cmd.zoneid = services["zoneid"] - - return Pod(apiclient.createPod(cmd).__dict__) - - def delete(self, apiclient): - """Delete Pod""" - - cmd = deletePod.deletePodCmd() - cmd.id = self.id - apiclient.deletePod(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - "Returns a default pod for specified zone" - - cmd = listPods.listPodsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.listPods(cmd) - - -class PublicIpRange: - """Manage VlanIpRange""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services): - """Create VlanIpRange""" - - cmd = createVlanIpRange.createVlanIpRangeCmd() - cmd.gateway = services["gateway"] - cmd.netmask = services["netmask"] - cmd.forvirtualnetwork = services["forvirtualnetwork"] - cmd.startip = services["startip"] - cmd.endip = services["endip"] - cmd.zoneid = services["zoneid"] - cmd.podid = services["podid"] - cmd.vlan = services["vlan"] - - return PublicIpRange(apiclient.createVlanIpRange(cmd).__dict__) - - def delete(self, apiclient): - """Delete VlanIpRange""" - - cmd = deleteVlanIpRange.deleteVlanIpRangeCmd() - cmd.id = self.vlan.id - apiclient.deleteVlanIpRange(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all VLAN IP ranges.""" - - cmd = listVlanIpRanges.listVlanIpRangesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVlanIpRanges(cmd)) - - @classmethod - def dedicate(cls, apiclient, id, account=None, domainid=None, projectid=None): - """Dedicate VLAN IP range""" - - cmd = dedicatePublicIpRange.dedicatePublicIpRangeCmd() - cmd.id = id - cmd.account = account - cmd.domainid = domainid - cmd.projectid = projectid - return PublicIpRange(apiclient.dedicatePublicIpRange(cmd).__dict__) - - def release(self, apiclient): - """Release VLAN IP range""" - - cmd = releasePublicIpRange.releasePublicIpRangeCmd() - cmd.id = self.vlan.id - return apiclient.releasePublicIpRange(cmd) - - -class PortablePublicIpRange: - """Manage portable public Ip Range""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services): - """Create portable public Ip Range""" - - cmd = createPortableIpRange.createPortableIpRangeCmd() - cmd.gateway = services["gateway"] - cmd.netmask = services["netmask"] - cmd.startip = services["startip"] - cmd.endip = services["endip"] - cmd.regionid = services["regionid"] - - if "vlan" in services: - cmd.vlan = services["vlan"] - - return PortablePublicIpRange(apiclient.createPortableIpRange(cmd).__dict__) - - def delete(self, apiclient): - """Delete portable IpRange""" - - cmd = deletePortableIpRange.deletePortableIpRangeCmd() - cmd.id = self.id - apiclient.deletePortableIpRange(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all portable public IP ranges.""" - - cmd = listPortableIpRanges.listPortableIpRangesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listPortableIpRanges(cmd)) - -class SecondaryStagingStore: - """Manage Staging Store""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, url, provider, services=None): - """Create Staging Storage""" - cmd = createSecondaryStagingStore.createSecondaryStagingStoreCmd() - cmd.url = url - cmd.provider = provider - if services: - if "zoneid" in services: - cmd.zoneid = services["zoneid"] - if "details" in services: - cmd.details = services["details"] - if "scope" in services: - cmd.scope = services["scope"] - - return SecondaryStagingStore(apiclient.createSecondaryStagingStore(cmd).__dict__) - - def delete(self, apiclient): - """Delete Staging Storage""" - cmd = deleteSecondaryStagingStore.deleteSecondaryStagingStoreCmd() - cmd.id = self.id - apiclient.deleteSecondaryStagingStore(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - cmd = listSecondaryStagingStores.listSecondaryStagingStoresCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listSecondaryStagingStores(cmd)) - - -class ImageStore: - """Manage image stores""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, url, provider, services=None): - """Add Image Store""" - cmd = addImageStore.addImageStoreCmd() - cmd.url = url - cmd.provider = provider - if services: - if "zoneid" in services: - cmd.zoneid = services["zoneid"] - if "details" in services: - cmd.details = services["details"] - if "scope" in services: - cmd.scope = services["scope"] - - return ImageStore(apiclient.addImageStore(cmd).__dict__) - - def delete(self, apiclient): - """Delete Image Store""" - cmd = deleteImageStore.deleteImageStoreCmd() - cmd.id = self.id - apiclient.deleteImageStore(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - cmd = listImageStores.listImageStoresCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listImageStores(cmd)) - - -class PhysicalNetwork: - """Manage physical network storage""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, zoneid, domainid=None): - """Create physical network""" - cmd = createPhysicalNetwork.createPhysicalNetworkCmd() - - cmd.name = services["name"] - cmd.zoneid = zoneid - if domainid: - cmd.domainid = domainid - return PhysicalNetwork(apiclient.createPhysicalNetwork(cmd).__dict__) - - def delete(self, apiclient): - """Delete Physical Network""" - - cmd = deletePhysicalNetwork.deletePhysicalNetworkCmd() - cmd.id = self.id - apiclient.deletePhysicalNetwork(cmd) - - def update(self, apiclient, **kwargs): - """Update Physical network state""" - - cmd = updatePhysicalNetwork.updatePhysicalNetworkCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.updatePhysicalNetwork(cmd) - - def addTrafficType(self, apiclient, type): - """Add Traffic type to Physical network""" - - cmd = addTrafficType.addTrafficTypeCmd() - cmd.physicalnetworkid = self.id - cmd.traffictype = type - return apiclient.addTrafficType(cmd) - - @classmethod - def dedicate(cls, apiclient, vlanrange, physicalnetworkid, account=None, domainid=None, projectid=None): - """Dedicate guest vlan range""" - - cmd = dedicateGuestVlanRange.dedicateGuestVlanRangeCmd() - cmd.vlanrange = vlanrange - cmd.physicalnetworkid = physicalnetworkid - cmd.account = account - cmd.domainid = domainid - cmd.projectid = projectid - return PhysicalNetwork(apiclient.dedicateGuestVlanRange(cmd).__dict__) - - def release(self, apiclient): - """Release guest vlan range""" - - cmd = releaseDedicatedGuestVlanRange.releaseDedicatedGuestVlanRangeCmd() - cmd.id = self.id - return apiclient.releaseDedicatedGuestVlanRange(cmd) - - @classmethod - def listDedicated(cls, apiclient, **kwargs): - """Lists all dedicated guest vlan ranges""" - - cmd = listDedicatedGuestVlanRanges.listDedicatedGuestVlanRangesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.listDedicatedGuestVlanRanges(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all physical networks""" - - cmd = listPhysicalNetworks.listPhysicalNetworksCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return map(lambda pn : PhysicalNetwork(pn.__dict__), apiclient.listPhysicalNetworks(cmd)) - - -class SecurityGroup: - """Manage Security Groups""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, account=None, domainid=None, - description=None, projectid=None): - """Create security group""" - cmd = createSecurityGroup.createSecurityGroupCmd() - - cmd.name = services["name"] - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - if description: - cmd.description = description - if projectid: - cmd.projectid = projectid - - return SecurityGroup(apiclient.createSecurityGroup(cmd).__dict__) - - def delete(self, apiclient): - """Delete Security Group""" - - cmd = deleteSecurityGroup.deleteSecurityGroupCmd() - cmd.id = self.id - apiclient.deleteSecurityGroup(cmd) - - def authorize(self, apiclient, services, - account=None, domainid=None, projectid=None): - """Authorize Ingress Rule""" - - cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd() - - if domainid: - cmd.domainid = domainid - if account: - cmd.account = account - - if projectid: - cmd.projectid = projectid - cmd.securitygroupid = self.id - cmd.protocol = services["protocol"] - - if services["protocol"] == 'ICMP': - cmd.icmptype = -1 - cmd.icmpcode = -1 - else: - cmd.startport = services["startport"] - cmd.endport = services["endport"] - - cmd.cidrlist = services["cidrlist"] - return (apiclient.authorizeSecurityGroupIngress(cmd).__dict__) - - def revoke(self, apiclient, id): - """Revoke ingress rule""" - - cmd = revokeSecurityGroupIngress.revokeSecurityGroupIngressCmd() - cmd.id = id - return apiclient.revokeSecurityGroupIngress(cmd) - - def authorizeEgress(self, apiclient, services, account=None, domainid=None, - projectid=None, user_secgrp_list={}): - """Authorize Egress Rule""" - - cmd = authorizeSecurityGroupEgress.authorizeSecurityGroupEgressCmd() - - if domainid: - cmd.domainid = domainid - if account: - cmd.account = account - - if projectid: - cmd.projectid = projectid - cmd.securitygroupid = self.id - cmd.protocol = services["protocol"] - - if services["protocol"] == 'ICMP': - cmd.icmptype = -1 - cmd.icmpcode = -1 - else: - cmd.startport = services["startport"] - cmd.endport = services["endport"] - - cmd.cidrlist = services["cidrlist"] - - cmd.usersecuritygrouplist = [] - for account, group in user_secgrp_list.items(): - cmd.usersecuritygrouplist.append({ - 'account': account, - 'group': group - }) - - return (apiclient.authorizeSecurityGroupEgress(cmd).__dict__) - - def revokeEgress(self, apiclient, id): - """Revoke Egress rule""" - - cmd = revokeSecurityGroupEgress.revokeSecurityGroupEgressCmd() - cmd.id = id - return apiclient.revokeSecurityGroupEgress(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all security groups.""" - - cmd = listSecurityGroups.listSecurityGroupsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listSecurityGroups(cmd)) - - -class Project: - """Manage Project life cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, account=None, domainid=None): - """Create project""" - - cmd = createProject.createProjectCmd() - cmd.displaytext = services["displaytext"] - cmd.name = "-".join([services["name"], random_gen()]) - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - - return Project(apiclient.createProject(cmd).__dict__) - - def delete(self, apiclient): - """Delete Project""" - - cmd = deleteProject.deleteProjectCmd() - cmd.id = self.id - apiclient.deleteProject(cmd) - - def update(self, apiclient, **kwargs): - """Updates the project""" - - cmd = updateProject.updateProjectCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.updateProject(cmd) - - def activate(self, apiclient): - """Activates the suspended project""" - - cmd = activateProject.activateProjectCmd() - cmd.id = self.id - return apiclient.activateProject(cmd) - - def suspend(self, apiclient): - """Suspend the active project""" - - cmd = suspendProject.suspendProjectCmd() - cmd.id = self.id - return apiclient.suspendProject(cmd) - - def addAccount(self, apiclient, account=None, email=None): - """Add account to project""" - - cmd = addAccountToProject.addAccountToProjectCmd() - cmd.projectid = self.id - if account: - cmd.account = account - if email: - cmd.email = email - return apiclient.addAccountToProject(cmd) - - def deleteAccount(self, apiclient, account): - """Delete account from project""" - - cmd = deleteAccountFromProject.deleteAccountFromProjectCmd() - cmd.projectid = self.id - cmd.account = account - return apiclient.deleteAccountFromProject(cmd) - - @classmethod - def listAccounts(cls, apiclient, **kwargs): - """Lists all accounts associated with projects.""" - - cmd = listProjectAccounts.listProjectAccountsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listProjectAccounts(cmd)) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists all projects.""" - - cmd = listProjects.listProjectsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listProjects(cmd)) - - -class ProjectInvitation: - """Manage project invitations""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def update(cls, apiclient, projectid, accept, account=None, token=None): - """Updates the project invitation for that account""" - - cmd = updateProjectInvitation.updateProjectInvitationCmd() - cmd.projectid = projectid - cmd.accept = accept - if account: - cmd.account = account - if token: - cmd.token = token - - return (apiclient.updateProjectInvitation(cmd).__dict__) - - def delete(self, apiclient, id): - """Deletes the project invitation""" - - cmd = deleteProjectInvitation.deleteProjectInvitationCmd() - cmd.id = id - return apiclient.deleteProjectInvitation(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists project invitations""" - - cmd = listProjectInvitations.listProjectInvitationsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listProjectInvitations(cmd)) - - -class Configurations: - """Manage Configuration""" - - @classmethod - def update(cls, apiclient, name, value=None): - """Updates the specified configuration""" - - cmd = updateConfiguration.updateConfigurationCmd() - cmd.name = name - cmd.value = value - apiclient.updateConfiguration(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists configurations""" - - cmd = listConfigurations.listConfigurationsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listConfigurations(cmd)) - - -class NetScaler: - """Manage external netscaler device""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def add(cls, apiclient, services, physicalnetworkid, username=None, password=None): - """Add external netscaler device to cloudstack""" - - cmd = addNetscalerLoadBalancer.addNetscalerLoadBalancerCmd() - cmd.physicalnetworkid = physicalnetworkid - if username: - cmd.username = username - else: - cmd.username = services["username"] - - if password: - cmd.password = password - else: - cmd.password = services["password"] - - cmd.networkdevicetype = services["networkdevicetype"] - - # Generate the URL - url = 'https://' + str(services["ipaddress"]) + '?' - url = url + 'publicinterface=' + str(services["publicinterface"]) + '&' - url = url + 'privateinterface=' + str(services["privateinterface"]) + '&' - url = url + 'numretries=' + str(services["numretries"]) + '&' - - if not services["lbdevicededicated"] and "lbdevicecapacity" in services: - url = url + 'lbdevicecapacity=' + str(services["lbdevicecapacity"]) + '&' - - url = url + 'lbdevicededicated=' + str(services["lbdevicededicated"]) - - cmd.url = url - return NetScaler(apiclient.addNetscalerLoadBalancer(cmd).__dict__) - - def delete(self, apiclient): - """Deletes a netscaler device from CloudStack""" - - cmd = deleteNetscalerLoadBalancer.deleteNetscalerLoadBalancerCmd() - cmd.lbdeviceid = self.lbdeviceid - apiclient.deleteNetscalerLoadBalancer(cmd) - return - - def configure(self, apiclient, **kwargs): - """List already registered netscaler devices""" - - cmd = configureNetscalerLoadBalancer.configureNetscalerLoadBalancerCmd() - cmd.lbdeviceid = self.lbdeviceid - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.configureNetscalerLoadBalancer(cmd)) - - @classmethod - def list(cls, apiclient, **kwargs): - """List already registered netscaler devices""" - - cmd = listNetscalerLoadBalancers.listNetscalerLoadBalancersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetscalerLoadBalancers(cmd)) - - -class NetworkServiceProvider: - """Manage network serivce providers for CloudStack""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def add(cls, apiclient, name, physicalnetworkid, servicelist): - """Adds network service provider""" - - cmd = addNetworkServiceProvider.addNetworkServiceProviderCmd() - cmd.name = name - cmd.physicalnetworkid = physicalnetworkid - cmd.servicelist = servicelist - return NetworkServiceProvider(apiclient.addNetworkServiceProvider(cmd).__dict__) - - def delete(self, apiclient): - """Deletes network service provider""" - - cmd = deleteNetworkServiceProvider.deleteNetworkServiceProviderCmd() - cmd.id = self.id - return apiclient.deleteNetworkServiceProvider(cmd) - - def update(self, apiclient, **kwargs): - """Updates network service provider""" - - cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.updateNetworkServiceProvider(cmd) - - @classmethod - def update(cls, apiclient, id, **kwargs): - """Updates network service provider""" - - cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd() - cmd.id = id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.updateNetworkServiceProvider(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List network service providers""" - - cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetworkServiceProviders(cmd)) - - -class Router: - """Manage router life cycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def start(cls, apiclient, id): - """Starts the router""" - cmd = startRouter.startRouterCmd() - cmd.id = id - return apiclient.startRouter(cmd) - - @classmethod - def stop(cls, apiclient, id, forced=None): - """Stops the router""" - cmd = stopRouter.stopRouterCmd() - cmd.id = id - if forced: - cmd.forced = forced - return apiclient.stopRouter(cmd) - - @classmethod - def reboot(cls, apiclient, id): - """Reboots the router""" - cmd = rebootRouter.rebootRouterCmd() - cmd.id = id - return apiclient.rebootRouter(cmd) - - @classmethod - def destroy(cls, apiclient, id): - """Destroy the router""" - cmd = destroyRouter.destroyRouterCmd() - cmd.id = id - return apiclient.destroyRouter(cmd) - - @classmethod - def change_service_offering(cls, apiclient, id, serviceofferingid): - """Change service offering of the router""" - cmd = changeServiceForRouter.changeServiceForRouterCmd() - cmd.id = id - cmd.serviceofferingid = serviceofferingid - return apiclient.changeServiceForRouter(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List routers""" - - cmd = listRouters.listRoutersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listRouters(cmd)) - - -class Tag: - """Manage tags""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, resourceIds, resourceType, tags): - """Create tags""" - - cmd = createTags.createTagsCmd() - cmd.resourceIds = resourceIds - cmd.resourcetype = resourceType - cmd.tags = [] - for key, value in tags.items(): - cmd.tags.append({ - 'key': key, - 'value': value - }) - return Tag(apiclient.createTags(cmd).__dict__) - - def delete(self, apiclient, resourceIds, resourceType, tags): - """Delete tags""" - - cmd = deleteTags.deleteTagsCmd() - cmd.resourceIds = resourceIds - cmd.resourcetype = resourceType - cmd.tags = [] - for key, value in tags.items(): - cmd.tags.append({ - 'key': key, - 'value': value - }) - apiclient.deleteTags(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all tags matching the criteria""" - - cmd = listTags.listTagsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listTags(cmd)) - - -class VpcOffering: - """Manage VPC offerings""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services): - """Create vpc offering""" - - cmd = createVPCOffering.createVPCOfferingCmd() - cmd.name = "-".join([services["name"], random_gen()]) - cmd.displaytext = services["displaytext"] - cmd.supportedServices = services["supportedservices"] - return VpcOffering(apiclient.createVPCOffering(cmd).__dict__) - - def update(self, apiclient, name=None, displaytext=None, state=None): - """Updates existing VPC offering""" - - cmd = updateVPCOffering.updateVPCOfferingCmd() - cmd.id = self.id - if name: - cmd.name = name - if displaytext: - cmd.displaytext = displaytext - if state: - cmd.state = state - return apiclient.updateVPCOffering(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List the VPC offerings based on criteria specified""" - - cmd = listVPCOfferings.listVPCOfferingsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVPCOfferings(cmd)) - - def delete(self, apiclient): - """Deletes existing VPC offering""" - - cmd = deleteVPCOffering.deleteVPCOfferingCmd() - cmd.id = self.id - return apiclient.deleteVPCOffering(cmd) - - -class VPC: - """Manage Virtual Private Connection""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, vpcofferingid, - zoneid, networkDomain=None, account=None, domainid=None, **kwargs): - """Creates the virtual private connection (VPC)""" - - cmd = createVPC.createVPCCmd() - cmd.name = "-".join([services["name"], random_gen()]) - cmd.displaytext = "-".join([services["displaytext"], random_gen()]) - cmd.vpcofferingid = vpcofferingid - cmd.zoneid = zoneid - if "cidr" in services: - cmd.cidr = services["cidr"] - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - if networkDomain: - cmd.networkDomain = networkDomain - [setattr(cmd, k, v) for k, v in kwargs.items()] - return VPC(apiclient.createVPC(cmd).__dict__) - - def update(self, apiclient, name=None, displaytext=None): - """Updates VPC configurations""" - - cmd = updateVPC.updateVPCCmd() - cmd.id = self.id - if name: - cmd.name = name - if displaytext: - cmd.displaytext = displaytext - return (apiclient.updateVPC(cmd)) - - def delete(self, apiclient): - """Delete VPC network""" - - cmd = deleteVPC.deleteVPCCmd() - cmd.id = self.id - return apiclient.deleteVPC(cmd) - - def restart(self, apiclient): - """Restarts the VPC connections""" - - cmd = restartVPC.restartVPCCmd() - cmd.id = self.id - return apiclient.restartVPC(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List VPCs""" - - cmd = listVPCs.listVPCsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVPCs(cmd)) - - -class PrivateGateway: - """Manage private gateway lifecycle""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, gateway, ipaddress, netmask, vlan, vpcid, - physicalnetworkid=None): - """Create private gateway""" - - cmd = createPrivateGateway.createPrivateGatewayCmd() - cmd.gateway = gateway - cmd.ipaddress = ipaddress - cmd.netmask = netmask - cmd.vlan = vlan - cmd.vpcid = vpcid - if physicalnetworkid: - cmd.physicalnetworkid = physicalnetworkid - - return PrivateGateway(apiclient.createPrivateGateway(cmd).__dict__) - - def delete(self, apiclient): - """Delete private gateway""" - - cmd = deletePrivateGateway.deletePrivateGatewayCmd() - cmd.id = self.id - return apiclient.deletePrivateGateway(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List private gateways""" - - cmd = listPrivateGateways.listPrivateGatewaysCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listPrivateGateways(cmd)) - - -class AffinityGroup: - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, aff_grp, account=None, domainid=None): - cmd = createAffinityGroup.createAffinityGroupCmd() - cmd.name = aff_grp['name'] - cmd.displayText = aff_grp['name'] - cmd.type = aff_grp['type'] - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - return AffinityGroup(apiclient.createAffinityGroup(cmd).__dict__) - - def update(self, apiclient): - pass - - def delete(self, apiclient): - cmd = deleteAffinityGroup.deleteAffinityGroupCmd() - cmd.id = self.id - return apiclient.deleteAffinityGroup(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - cmd = listAffinityGroups.listAffinityGroupsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.listAffinityGroups(cmd) - -class StaticRoute: - """Manage static route lifecycle""" - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, cidr, gatewayid): - """Create static route""" - - cmd = createStaticRoute.createStaticRouteCmd() - cmd.cidr = cidr - cmd.gatewayid = gatewayid - return StaticRoute(apiclient.createStaticRoute(cmd).__dict__) - - def delete(self, apiclient): - """Delete static route""" - - cmd = deleteStaticRoute.deleteStaticRouteCmd() - cmd.id = self.id - return apiclient.deleteStaticRoute(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List static route""" - - cmd = listStaticRoutes.listStaticRoutesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listStaticRoutes(cmd)) - - -class VNMC: - """Manage VNMC lifecycle""" - def __init__(self, items): - self.__dict__.update(items) - - def create(cls, apiclient, hostname, username, password, physicalnetworkid): - """Registers VNMC appliance""" - - cmd = addCiscoVnmcResource.addCiscoVnmcResourceCmd() - cmd.hostname = hostname - cmd.username = username - cmd.password = password - cmd.physicalnetworkid = physicalnetworkid - return VNMC(apiclient.addCiscoVnmcResource(cmd)) - - def delete(self, apiclient): - """Removes VNMC appliance""" - - cmd = deleteCiscoVnmcResource.deleteCiscoVnmcResourceCmd() - cmd.resourceid = self.resourceid - return apiclient.deleteCiscoVnmcResource(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List VNMC appliances""" - - cmd = listCiscoVnmcResources.listCiscoVnmcResourcesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listCiscoVnmcResources(cmd)) - - -class SSHKeyPair: - """Manage SSH Key pairs""" - - def __init__(self, items, services): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, name=None, account=None, - domainid=None, projectid=None): - """Creates SSH keypair""" - cmd = createSSHKeyPair.createSSHKeyPairCmd() - cmd.name = name - if account is not None: - cmd.account = account - if domainid is not None: - cmd.domainid = domainid - if projectid is not None: - cmd.projectid = projectid - return (apiclient.createSSHKeyPair(cmd)) - - def delete(self, apiclient): - """Delete SSH key pair""" - cmd = deleteSSHKeyPair.deleteSSHKeyPairCmd() - cmd.name = self.name - apiclient.deleteSSHKeyPair(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all SSH key pairs""" - cmd = listSSHKeyPairs.listSSHKeyPairsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listSSHKeyPairs(cmd)) - - -class Capacities: - """Manage Capacities""" - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists capacities""" - - cmd = listCapacity.listCapacityCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listCapacity(cmd)) - - -class Alert: - """Manage alerts""" - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists alerts""" - - cmd = listAlerts.listAlertsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listAlerts(cmd)) - - -class InstanceGroup: - """Manage VM instance groups""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, name=None, account=None, domainid=None, - projectid=None, networkid=None, rand_name=True): - """Creates instance groups""" - - cmd = createInstanceGroup.createInstanceGroupCmd() - cmd.name = "-".join([name, random_gen()]) if rand_name else name - if account is not None: - cmd.account = account - if domainid is not None: - cmd.domainid = domainid - if projectid is not None: - cmd.projectid = projectid - if networkid is not None: - cmd.networkid = networkid - return InstanceGroup(apiclient.createInstanceGroup(cmd).__dict__) - - def delete(self, apiclient): - """Delete instance group""" - cmd = deleteInstanceGroup.deleteInstanceGroupCmd() - cmd.id = self.id - apiclient.deleteInstanceGroup(cmd) - - def update(self, apiclient, **kwargs): - """Updates the instance groups""" - cmd = updateInstanceGroup.updateInstanceGroupCmd() - cmd.id = self.id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return (apiclient.updateInstanceGroup(cmd)) - - @classmethod - def list(cls, apiclient, **kwargs): - """List all instance groups""" - cmd = listInstanceGroups.listInstanceGroupsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return (apiclient.listInstanceGroups(cmd)) - - def startInstances(self, apiclient): - """Starts all instances in a VM tier""" - - cmd = startVirtualMachine.startVirtualMachineCmd() - cmd.group = self.id - return apiclient.startVirtualMachine(cmd) - - def stopInstances(self, apiclient): - """Stops all instances in a VM tier""" - - cmd = stopVirtualMachine.stopVirtualMachineCmd() - cmd.group = self.id - return apiclient.stopVirtualMachine(cmd) - - def rebootInstances(self, apiclient): - """Reboot all instances in a VM tier""" - - cmd = rebootVirtualMachine.rebootVirtualMachineCmd() - cmd.group = self.id - return apiclient.rebootVirtualMachine(cmd) - - def deleteInstances(self, apiclient): - """Stops all instances in a VM tier""" - - cmd = destroyVirtualMachine.destroyVirtualMachineCmd() - cmd.group = self.id - return apiclient.destroyVirtualMachine(cmd) - - def changeServiceOffering(self, apiclient, serviceOfferingId): - """Change service offering of the vm tier""" - - cmd = changeServiceForVirtualMachine.changeServiceForVirtualMachineCmd() - cmd.group = self.id - cmd.serviceofferingid = serviceOfferingId - return apiclient.changeServiceForVirtualMachine(cmd) - - def recoverInstances(self, apiclient): - """Recover the instances from vm tier""" - cmd = recoverVirtualMachine.recoverVirtualMachineCmd() - cmd.group = self.id - apiclient.recoverVirtualMachine(cmd) - - -class ASA1000V: - """Manage ASA 1000v lifecycle""" - def create(cls, apiclient, hostname, insideportprofile, clusterid, physicalnetworkid): - """Registers ASA 1000v appliance""" - - cmd = addCiscoAsa1000vResource.addCiscoAsa1000vResourceCmd() - cmd.hostname = hostname - cmd.insideportprofile = insideportprofile - cmd.clusterid = clusterid - cmd.physicalnetworkid = physicalnetworkid - return ASA1000V(apiclient.addCiscoAsa1000vResource(cmd)) - - def delete(self, apiclient): - """Removes ASA 1000v appliance""" - - cmd = deleteCiscoAsa1000vResource.deleteCiscoAsa1000vResourceCmd() - cmd.resourceid = self.resourceid - return apiclient.deleteCiscoAsa1000vResource(cmd) - - @classmethod - def list(cls, apiclient, **kwargs): - """List ASA 1000v appliances""" - - cmd = listCiscoAsa1000vResources.listCiscoAsa1000vResourcesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listCiscoAsa1000vResources(cmd)) - -class VmSnapshot: - """Manage VM Snapshot life cycle""" - def __init__(self, items): - self.__dict__.update(items) - @classmethod - def create(cls,apiclient,vmid,snapshotmemory="false",name=None,description=None): - cmd = createVMSnapshot.createVMSnapshotCmd() - cmd.virtualmachineid = vmid - - if snapshotmemory: - cmd.snapshotmemory = snapshotmemory - if name: - cmd.name = name - if description: - cmd.description = description - return VmSnapshot(apiclient.createVMSnapshot(cmd).__dict__) - - @classmethod - def list(cls, apiclient, **kwargs): - cmd = listVMSnapshot.listVMSnapshotCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVMSnapshot(cmd)) - - @classmethod - def revertToSnapshot(cls, apiclient,vmsnapshotid): - cmd = revertToVMSnapshot.revertToVMSnapshotCmd() - cmd.vmsnapshotid = vmsnapshotid - - return apiclient.revertToVMSnapshot(cmd) - - @classmethod - def deleteVMSnapshot(cls,apiclient,vmsnapshotid): - cmd = deleteVMSnapshot.deleteVMSnapshotCmd() - cmd.vmsnapshotid = vmsnapshotid - - return apiclient.deleteVMSnapshot(cmd) - -class Region: - """ Regions related Api """ - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services): - cmd = addRegion.addRegionCmd() - cmd.id = services["regionid"] - cmd.endpoint = services["regionendpoint"] - cmd.name = services["regionname"] - try: - region = apiclient.addRegion(cmd) - if region is not None: - return Region(region.__dict__) - except Exception as e: - raise e - - @classmethod - def list(cls, apiclient, **kwargs): - cmd = listRegions.listRegionsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - region = apiclient.listRegions(cmd) - return region - - def update(self, apiclient, services): - cmd = updateRegion.updateRegionCmd() - cmd.id = self.id - if services["regionendpoint"]: - cmd.endpoint = services["regionendpoint"] - if services["regionname"]: - cmd.name = services["regionname"] - region = apiclient.updateRegion(cmd) - return region - - def delete(self, apiclient): - cmd = removeRegion.removeRegionCmd() - cmd.id = self.id - region = apiclient.removeRegion(cmd) - return region - - -class ApplicationLoadBalancer: - """Manage Application Load Balancers in VPC""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def create(cls, apiclient, services, name=None, sourceport=None, instanceport=22, - algorithm="roundrobin", scheme="internal", sourcenetworkid=None, networkid=None): - """Create Application Load Balancer""" - cmd = createLoadBalancer.createLoadBalancerCmd() - - if "name" in services: - cmd.name = services["name"] - elif name: - cmd.name = name - - if "sourceport" in services: - cmd.sourceport = services["sourceport"] - elif sourceport: - cmd.sourceport = sourceport - - if "instanceport" in services: - cmd.instanceport = services["instanceport"] - elif instanceport: - cmd.instanceport = instanceport - - if "algorithm" in services: - cmd.algorithm = services["algorithm"] - elif algorithm: - cmd.algorithm = algorithm - - if "scheme" in services: - cmd.scheme = services["scheme"] - elif scheme: - cmd.scheme = scheme - - if "sourceipaddressnetworkid" in services: - cmd.sourceipaddressnetworkid = services["sourceipaddressnetworkid"] - elif sourcenetworkid: - cmd.sourceipaddressnetworkid = sourcenetworkid - - if "networkid" in services: - cmd.networkid = services["networkid"] - elif networkid: - cmd.networkid = networkid - - return LoadBalancerRule(apiclient.createLoadBalancer(cmd).__dict__) - - def delete(self, apiclient): - """Delete application load balancer""" - cmd = deleteLoadBalancer.deleteLoadBalancerCmd() - cmd.id = self.id - apiclient.deleteLoadBalancerRule(cmd) - return - - def assign(self, apiclient, vms): - """Assign virtual machines to load balancing rule""" - cmd = assignToLoadBalancerRule.assignToLoadBalancerRuleCmd() - cmd.id = self.id - cmd.virtualmachineids = [str(vm.id) for vm in vms] - apiclient.assignToLoadBalancerRule(cmd) - return - - def remove(self, apiclient, vms): - """Remove virtual machines from load balancing rule""" - cmd = removeFromLoadBalancerRule.removeFromLoadBalancerRuleCmd() - cmd.id = self.id - cmd.virtualmachineids = [str(vm.id) for vm in vms] - apiclient.removeFromLoadBalancerRule(cmd) - return - - @classmethod - def list(cls, apiclient, **kwargs): - """List all appln load balancers""" - cmd = listLoadBalancers.listLoadBalancersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listLoadBalancerRules(cmd)) - -class Resources: - """Manage resource limits""" - - def __init__(self, items, services): - self.__dict__.update(items) - - @classmethod - def list(cls, apiclient, **kwargs): - """Lists resource limits""" - - cmd = listResourceLimits.listResourceLimitsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listResourceLimits(cmd)) - - @classmethod - def updateLimit(cls, apiclient, **kwargs): - """Updates resource limits""" - - cmd = updateResourceLimit.updateResourceLimitCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateResourceLimit(cmd)) - - @classmethod - def updateCount(cls, apiclient, **kwargs): - """Updates resource count""" - - cmd = updateResourceCount.updateResourceCountCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateResourceCount(cmd)) diff --git a/tools/marvin/build/lib/marvin/integration/lib/common.py b/tools/marvin/build/lib/marvin/integration/lib/common.py deleted file mode 100644 index 164ef2052dd..00000000000 --- a/tools/marvin/build/lib/marvin/integration/lib/common.py +++ /dev/null @@ -1,739 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -"""Common functions -""" - -#Import Local Modules -from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient -from utils import * -from base import * - -#Import System modules -import time - - -def is_config_suitable(apiclient, name, value): - """ - Ensure if the deployment has the expected `value` for the global setting `name' - @return: true if value is set, else false - """ - configs = Configurations.list(apiclient, name=name) - assert(configs is not None and isinstance(configs, list) and len(configs) > 0) - return configs[0].value == value - -def wait_for_cleanup(apiclient, configs=None): - """Sleeps till the cleanup configs passed""" - - # Configs list consists of the list of global configs - if not isinstance(configs, list): - return - for config in configs: - cmd = listConfigurations.listConfigurationsCmd() - cmd.name = config - cmd.listall = True - try: - config_descs = apiclient.listConfigurations(cmd) - except Exception as e: - raise Exception("Failed to fetch configurations: %s" % e) - - if not isinstance(config_descs, list): - raise Exception("List configs didn't returned a valid data") - - config_desc = config_descs[0] - # Sleep for the config_desc.value time - time.sleep(int(config_desc.value)) - return - -def add_netscaler(apiclient, zoneid, NSservice): - """ Adds Netscaler device and enables NS provider""" - - cmd = listPhysicalNetworks.listPhysicalNetworksCmd() - cmd.zoneid = zoneid - physical_networks = apiclient.listPhysicalNetworks(cmd) - if isinstance(physical_networks, list): - physical_network = physical_networks[0] - - cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd() - cmd.name = 'Netscaler' - cmd.physicalnetworkid=physical_network.id - nw_service_providers = apiclient.listNetworkServiceProviders(cmd) - - if isinstance(nw_service_providers, list): - netscaler_provider = nw_service_providers[0] - else: - cmd1 = addNetworkServiceProvider.addNetworkServiceProviderCmd() - cmd1.name = 'Netscaler' - cmd1.physicalnetworkid = physical_network.id - netscaler_provider = apiclient.addNetworkServiceProvider(cmd1) - - netscaler = NetScaler.add( - apiclient, - NSservice, - physicalnetworkid=physical_network.id - ) - if netscaler_provider.state != 'Enabled': - cmd = updateNetworkServiceProvider.updateNetworkServiceProviderCmd() - cmd.id = netscaler_provider.id - cmd.state = 'Enabled' - response = apiclient.updateNetworkServiceProvider(cmd) - - return netscaler - -def get_region(apiclient, services=None): - "Returns a default region" - - cmd = listRegions.listRegionsCmd() - if services: - if "regionid" in services: - cmd.id = services["regionid"] - - regions = apiclient.listRegions(cmd) - - if isinstance(regions, list): - assert len(regions) > 0 - return regions[0] - else: - raise Exception("Failed to find specified region.") - -def get_domain(apiclient, services=None): - "Returns a default domain" - - cmd = listDomains.listDomainsCmd() - if services: - if "domainid" in services: - cmd.id = services["domainid"] - - domains = apiclient.listDomains(cmd) - - if isinstance(domains, list): - assert len(domains) > 0 - return domains[0] - else: - raise Exception("Failed to find specified domain.") - - -def get_zone(apiclient, services=None): - "Returns a default zone" - - cmd = listZones.listZonesCmd() - if services: - if "zoneid" in services: - cmd.id = services["zoneid"] - - zones = apiclient.listZones(cmd) - - if isinstance(zones, list): - assert len(zones) > 0, "There are no available zones in the deployment" - return zones[0] - else: - raise Exception("Failed to find specified zone.") - - -def get_pod(apiclient, zoneid, services=None): - "Returns a default pod for specified zone" - - cmd = listPods.listPodsCmd() - cmd.zoneid = zoneid - - if services: - if "podid" in services: - cmd.id = services["podid"] - - pods = apiclient.listPods(cmd) - - if isinstance(pods, list): - assert len(pods) > 0, "No pods found for zone %s"%zoneid - return pods[0] - else: - raise Exception("Exception: Failed to find specified pod.") - - -def get_template(apiclient, zoneid, ostype, services=None): - "Returns a template" - - cmd = listOsTypes.listOsTypesCmd() - cmd.description = ostype - ostypes = apiclient.listOsTypes(cmd) - - if isinstance(ostypes, list): - ostypeid = ostypes[0].id - else: - raise Exception( - "Failed to find OS type with description: %s" % ostype) - - cmd = listTemplates.listTemplatesCmd() - cmd.templatefilter = 'featured' - cmd.zoneid = zoneid - - if services: - if "template" in services: - cmd.id = services["template"] - - list_templates = apiclient.listTemplates(cmd) - - if isinstance(list_templates, list): - assert len(list_templates) > 0, "received empty response on template of type %s"%ostype - for template in list_templates: - if template.ostypeid == ostypeid: - return template - elif template.isready: - return template - - raise Exception("Exception: Failed to find template with OSTypeID: %s" % - ostypeid) - return - - -def download_systemplates_sec_storage(server, services): - """Download System templates on sec storage""" - - try: - # Login to management server - ssh = remoteSSHClient( - server["ipaddress"], - server["port"], - server["username"], - server["password"] - ) - except Exception: - raise Exception("SSH access failted for server with IP address: %s" % - server["ipaddess"]) - # Mount Secondary Storage on Management Server - cmds = [ - "mkdir -p %s" % services["mnt_dir"], - "mount -t nfs %s:/%s %s" % ( - services["sec_storage"], - services["path"], - services["mnt_dir"] - ), - "%s -m %s -u %s -h %s -F" % ( - services["command"], - services["mnt_dir"], - services["download_url"], - services["hypervisor"] - ) - ] - for c in cmds: - result = ssh.execute(c) - - res = str(result) - - # Unmount the Secondary storage - ssh.execute("umount %s" % (services["mnt_dir"])) - - if res.count("Successfully installed system VM template") == 1: - return - else: - raise Exception("Failed to download System Templates on Sec Storage") - return - - -def wait_for_ssvms(apiclient, zoneid, podid, interval=60): - """After setup wait for SSVMs to come Up""" - - time.sleep(interval) - timeout = 40 - while True: - list_ssvm_response = list_ssvms( - apiclient, - systemvmtype='secondarystoragevm', - zoneid=zoneid, - podid=podid - ) - ssvm = list_ssvm_response[0] - if ssvm.state != 'Running': - # Sleep to ensure SSVMs are Up and Running - time.sleep(interval) - timeout = timeout - 1 - elif ssvm.state == 'Running': - break - elif timeout == 0: - raise Exception("SSVM failed to come up") - break - - timeout = 40 - while True: - list_ssvm_response = list_ssvms( - apiclient, - systemvmtype='consoleproxy', - zoneid=zoneid, - podid=podid - ) - cpvm = list_ssvm_response[0] - if cpvm.state != 'Running': - # Sleep to ensure SSVMs are Up and Running - time.sleep(interval) - timeout = timeout - 1 - elif cpvm.state == 'Running': - break - elif timeout == 0: - raise Exception("CPVM failed to come up") - break - return - -def get_builtin_template_info(apiclient, zoneid): - """Returns hypervisor specific infor for templates""" - - list_template_response = Template.list( - apiclient, - templatefilter='featured', - zoneid=zoneid, - ) - - for b_template in list_template_response: - if b_template.templatetype == 'BUILTIN': - break - - extract_response = Template.extract(apiclient, - b_template.id, - 'HTTP_DOWNLOAD', - zoneid) - - return extract_response.url, b_template.hypervisor, b_template.format - -def download_builtin_templates(apiclient, zoneid, hypervisor, host, - linklocalip, interval=60): - """After setup wait till builtin templates are downloaded""" - - # Change IPTABLES Rules - get_process_status( - host["ipaddress"], - host["port"], - host["username"], - host["password"], - linklocalip, - "iptables -P INPUT ACCEPT" - ) - time.sleep(interval) - # Find the BUILTIN Templates for given Zone, Hypervisor - list_template_response = list_templates( - apiclient, - hypervisor=hypervisor, - zoneid=zoneid, - templatefilter='self' - ) - - if not isinstance(list_template_response, list): - raise Exception("Failed to download BUILTIN templates") - - # Ensure all BUILTIN templates are downloaded - templateid = None - for template in list_template_response: - if template.templatetype == "BUILTIN": - templateid = template.id - - # Sleep to ensure that template is in downloading state after adding - # Sec storage - time.sleep(interval) - while True: - template_response = list_templates( - apiclient, - id=templateid, - zoneid=zoneid, - templatefilter='self' - ) - template = template_response[0] - # If template is ready, - # template.status = Download Complete - # Downloading - x% Downloaded - # Error - Any other string - if template.status == 'Download Complete': - break - - elif 'Downloaded' in template.status: - time.sleep(interval) - - elif 'Installing' not in template.status: - raise Exception("ErrorInDownload") - - return - - -def update_resource_limit(apiclient, resourcetype, account=None, - domainid=None, max=None, projectid=None): - """Updates the resource limit to 'max' for given account""" - - cmd = updateResourceLimit.updateResourceLimitCmd() - cmd.resourcetype = resourcetype - if account: - cmd.account = account - if domainid: - cmd.domainid = domainid - if max: - cmd.max = max - if projectid: - cmd.projectid = projectid - apiclient.updateResourceLimit(cmd) - return - - -def list_os_types(apiclient, **kwargs): - """List all os types matching criteria""" - - cmd = listOsTypes.listOsTypesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listOsTypes(cmd)) - - -def list_routers(apiclient, **kwargs): - """List all Routers matching criteria""" - - cmd = listRouters.listRoutersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listRouters(cmd)) - - -def list_zones(apiclient, **kwargs): - """List all Zones matching criteria""" - - cmd = listZones.listZonesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listZones(cmd)) - - -def list_networks(apiclient, **kwargs): - """List all Networks matching criteria""" - - cmd = listNetworks.listNetworksCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetworks(cmd)) - - -def list_clusters(apiclient, **kwargs): - """List all Clusters matching criteria""" - - cmd = listClusters.listClustersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listClusters(cmd)) - - -def list_ssvms(apiclient, **kwargs): - """List all SSVMs matching criteria""" - - cmd = listSystemVms.listSystemVmsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listSystemVms(cmd)) - - -def list_storage_pools(apiclient, **kwargs): - """List all storage pools matching criteria""" - - cmd = listStoragePools.listStoragePoolsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listStoragePools(cmd)) - - -def list_virtual_machines(apiclient, **kwargs): - """List all VMs matching criteria""" - - cmd = listVirtualMachines.listVirtualMachinesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVirtualMachines(cmd)) - - -def list_hosts(apiclient, **kwargs): - """List all Hosts matching criteria""" - - cmd = listHosts.listHostsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listHosts(cmd)) - - -def list_configurations(apiclient, **kwargs): - """List configuration with specified name""" - - cmd = listConfigurations.listConfigurationsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listConfigurations(cmd)) - - -def list_publicIP(apiclient, **kwargs): - """List all Public IPs matching criteria""" - - cmd = listPublicIpAddresses.listPublicIpAddressesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listPublicIpAddresses(cmd)) - - -def list_nat_rules(apiclient, **kwargs): - """List all NAT rules matching criteria""" - - cmd = listPortForwardingRules.listPortForwardingRulesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listPortForwardingRules(cmd)) - - -def list_lb_rules(apiclient, **kwargs): - """List all Load balancing rules matching criteria""" - - cmd = listLoadBalancerRules.listLoadBalancerRulesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listLoadBalancerRules(cmd)) - - -def list_lb_instances(apiclient, **kwargs): - """List all Load balancing instances matching criteria""" - - cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listLoadBalancerRuleInstances(cmd)) - - -def list_firewall_rules(apiclient, **kwargs): - """List all Firewall Rules matching criteria""" - - cmd = listFirewallRules.listFirewallRulesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listFirewallRules(cmd)) - - -def list_volumes(apiclient, **kwargs): - """List all volumes matching criteria""" - - cmd = listVolumes.listVolumesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVolumes(cmd)) - - -def list_isos(apiclient, **kwargs): - """Lists all available ISO files.""" - - cmd = listIsos.listIsosCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listIsos(cmd)) - - -def list_snapshots(apiclient, **kwargs): - """List all snapshots matching criteria""" - - cmd = listSnapshots.listSnapshotsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listSnapshots(cmd)) - - -def list_templates(apiclient, **kwargs): - """List all templates matching criteria""" - - cmd = listTemplates.listTemplatesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listTemplates(cmd)) - - -def list_domains(apiclient, **kwargs): - """Lists domains""" - - cmd = listDomains.listDomainsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listDomains(cmd)) - - -def list_accounts(apiclient, **kwargs): - """Lists accounts and provides detailed account information for - listed accounts""" - - cmd = listAccounts.listAccountsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listAccounts(cmd)) - - -def list_users(apiclient, **kwargs): - """Lists users and provides detailed account information for - listed users""" - - cmd = listUsers.listUsersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listUsers(cmd)) - - -def list_snapshot_policy(apiclient, **kwargs): - """Lists snapshot policies.""" - - cmd = listSnapshotPolicies.listSnapshotPoliciesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listSnapshotPolicies(cmd)) - - -def list_events(apiclient, **kwargs): - """Lists events""" - - cmd = listEvents.listEventsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listEvents(cmd)) - - -def list_disk_offering(apiclient, **kwargs): - """Lists all available disk offerings.""" - - cmd = listDiskOfferings.listDiskOfferingsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listDiskOfferings(cmd)) - - -def list_service_offering(apiclient, **kwargs): - """Lists all available service offerings.""" - - cmd = listServiceOfferings.listServiceOfferingsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listServiceOfferings(cmd)) - - -def list_vlan_ipranges(apiclient, **kwargs): - """Lists all VLAN IP ranges.""" - - cmd = listVlanIpRanges.listVlanIpRangesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVlanIpRanges(cmd)) - - -def list_usage_records(apiclient, **kwargs): - """Lists usage records for accounts""" - - cmd = listUsageRecords.listUsageRecordsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listUsageRecords(cmd)) - - -def list_nw_service_prividers(apiclient, **kwargs): - """Lists Network service providers""" - - cmd = listNetworkServiceProviders.listNetworkServiceProvidersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetworkServiceProviders(cmd)) - - -def list_virtual_router_elements(apiclient, **kwargs): - """Lists Virtual Router elements""" - - cmd = listVirtualRouterElements.listVirtualRouterElementsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVirtualRouterElements(cmd)) - - -def list_network_offerings(apiclient, **kwargs): - """Lists network offerings""" - - cmd = listNetworkOfferings.listNetworkOfferingsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listNetworkOfferings(cmd)) - - -def list_resource_limits(apiclient, **kwargs): - """Lists resource limits""" - - cmd = listResourceLimits.listResourceLimitsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listResourceLimits(cmd)) - -def list_vpc_offerings(apiclient, **kwargs): - """ Lists VPC offerings """ - - cmd = listVPCOfferings.listVPCOfferingsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listVPCOfferings(cmd)) - -def update_resource_count(apiclient, domainid, accountid=None, - projectid=None, rtype=None): - """updates the resource count - 0 - VM - 1 - Public IP - 2 - Volume - 3 - Snapshot - 4 - Template - 5 - Projects - 6 - Network - 7 - VPC - 8 - CPUs - 9 - RAM - 10 - Primary (shared) storage (Volumes) - 11 - Secondary storage (Snapshots, Templates & ISOs) - """ - - Resources.updateCount(apiclient, - domainid=domainid, - account=accountid if accountid else None, - projectid=projectid if projectid else None, - resourcetype=rtype if rtype else None - ) - return - -def find_suitable_host(apiclient, vm): - """Returns a suitable host for VM migration""" - - hosts = Host.list(apiclient, - virtualmachineid=vm.id, - listall=True) - - if isinstance(hosts, list): - assert len(hosts) > 0, "List host should return valid response" - else: - raise Exception("Exception: List host should return valid response") - return hosts[0] - -def get_resource_type(resource_id): - """Returns resource type""" - - lookup = { 0: "VM", - 1: "Public IP", - 2: "Volume", - 3: "Snapshot", - 4: "Template", - 5: "Projects", - 6: "Network", - 7: "VPC", - 8: "CPUs", - 9: "RAM", - 10: "Primary (shared) storage (Volumes)", - 11: "Secondary storage (Snapshots, Templates & ISOs)" - } - - return lookup[resource_id] - -def get_portable_ip_range_services(config): - """ Reads config values related to portable ip and fills up - services accordingly""" - - services = {} - attributeError = False - - if config.portableIpRange.startip: - services["startip"] = config.portableIpRange.startip - else: - attributeError = True - - if config.portableIpRange.endip: - services["endip"] = config.portableIpRange.endip - else: - attributeError = True - - if config.portableIpRange.netmask: - services["netmask"] = config.portableIpRange.netmask - else: - attributeError = True - - if config.portableIpRange.gateway: - services["gateway"] = config.portableIpRange.gateway - else: - attributeError = True - - if config.portableIpRange.vlan: - services["vlan"] = config.portableIpRange.vlan - - if attributeError: - services = None - - return services diff --git a/tools/marvin/build/lib/marvin/integration/lib/utils.py b/tools/marvin/build/lib/marvin/integration/lib/utils.py deleted file mode 100644 index d81e80d8025..00000000000 --- a/tools/marvin/build/lib/marvin/integration/lib/utils.py +++ /dev/null @@ -1,320 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -"""Utilities functions -""" - -import marvin -import os -import time -import logging -import string -import random -import imaplib -import email -import socket -import urlparse -import datetime -from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient - - -def restart_mgmt_server(server): - """Restarts the management server""" - - try: - # Get the SSH client - ssh = is_server_ssh_ready( - server["ipaddress"], - server["port"], - server["username"], - server["password"], - ) - result = ssh.execute("/etc/init.d/cloud-management restart") - res = str(result) - # Server Stop - OK - # Server Start - OK - if res.count("OK") != 2: - raise ("ErrorInReboot!") - except Exception as e: - raise e - return - - -def fetch_latest_mail(services, from_mail): - """Fetch mail""" - - # Login to mail server to verify email - mail = imaplib.IMAP4_SSL(services["server"]) - mail.login( - services["email"], - services["password"] - ) - mail.list() - mail.select(services["folder"]) - date = (datetime.date.today() - datetime.timedelta(1)).strftime("%d-%b-%Y") - - result, data = mail.uid( - 'search', - None, - '(SENTSINCE {date} HEADER FROM "{mail}")'.format( - date=date, - mail=from_mail - ) - ) - # Return False if email is not present - if data == []: - return False - - latest_email_uid = data[0].split()[-1] - result, data = mail.uid('fetch', latest_email_uid, '(RFC822)') - raw_email = data[0][1] - email_message = email.message_from_string(raw_email) - result = get_first_text_block(email_message) - return result - - -def get_first_text_block(email_message_instance): - """fetches first text block from the mail""" - maintype = email_message_instance.get_content_maintype() - if maintype == 'multipart': - for part in email_message_instance.get_payload(): - if part.get_content_maintype() == 'text': - return part.get_payload() - elif maintype == 'text': - return email_message_instance.get_payload() - - -def random_gen(id=None, size=6, chars=string.ascii_uppercase + string.digits): - """Generate Random Strings of variable length""" - randomstr = ''.join(random.choice(chars) for x in range(size)) - if id: - return ''.join([id, '-', randomstr]) - return randomstr - - -def cleanup_resources(api_client, resources): - """Delete resources""" - for obj in resources: - obj.delete(api_client) - - -def is_server_ssh_ready(ipaddress, port, username, password, retries=10, timeout=30, keyPairFileLocation=None): - """Return ssh handle else wait till sshd is running""" - try: - ssh = remoteSSHClient( - host=ipaddress, - port=port, - user=username, - passwd=password, - keyPairFileLocation=keyPairFileLocation, - retries=retries, - delay=timeout) - except Exception, e: - raise Exception("Failed to bring up ssh service in time. Waited %ss. Error is %s" % (retries * timeout, e)) - else: - return ssh - - -def format_volume_to_ext3(ssh_client, device="/dev/sda"): - """Format attached storage to ext3 fs""" - cmds = [ - "echo -e 'n\np\n1\n\n\nw' | fdisk %s" % device, - "mkfs.ext3 %s1" % device, - ] - for c in cmds: - ssh_client.execute(c) - - -def fetch_api_client(config_file='datacenterCfg'): - """Fetch the Cloudstack API Client""" - config = marvin.configGenerator.get_setup_config(config_file) - mgt = config.mgtSvr[0] - testClientLogger = logging.getLogger("testClient") - asyncTimeout = 3600 - return cloudstackAPIClient.CloudStackAPIClient( - marvin.cloudstackConnection.cloudConnection( - mgt.mgtSvrIp, - mgt.port, - mgt.apiKey, - mgt.securityKey, - asyncTimeout, - testClientLogger - ) - ) - -def get_host_credentials(config, hostip): - """Get login information for a host `hostip` (ipv4) from marvin's `config` - - @return the tuple username, password for the host else raise keyerror""" - for zone in config.zones: - for pod in zone.pods: - for cluster in pod.clusters: - for host in cluster.hosts: - if str(host.url).startswith('http'): - hostname = urlparse.urlsplit(str(host.url)).netloc - else: - hostname = str(host.url) - try: - if socket.getfqdn(hostip) == socket.getfqdn(hostname): - return host.username, host.password - except socket.error, e: - raise Exception("Unresolvable host %s error is %s" % (hostip, e)) - raise KeyError("Please provide the marvin configuration file with credentials to your hosts") - - -def get_process_status(hostip, port, username, password, linklocalip, process, hypervisor=None): - """Double hop and returns a process status""" - - #SSH to the machine - ssh = remoteSSHClient(hostip, port, username, password) - if str(hypervisor).lower() == 'vmware': - ssh_command = "ssh -i /var/cloudstack/management/.ssh/id_rsa -ostricthostkeychecking=no " - else: - ssh_command = "ssh -i ~/.ssh/id_rsa.cloud -ostricthostkeychecking=no " - - ssh_command = ssh_command +\ - "-oUserKnownHostsFile=/dev/null -p 3922 %s %s" % ( - linklocalip, - process) - - # Double hop into router - timeout = 5 - # Ensure the SSH login is successful - while True: - res = ssh.execute(ssh_command) - - if res[0] != "Host key verification failed.": - break - elif timeout == 0: - break - - time.sleep(5) - timeout = timeout - 1 - return res - - -def isAlmostEqual(first_digit, second_digit, range=0): - digits_equal_within_range = False - - try: - if ((first_digit - range) < second_digit < (first_digit + range)): - digits_equal_within_range = True - except Exception as e: - raise e - return digits_equal_within_range - - -def xsplit(txt, seps): - """ - Split a string in `txt` by list of delimiters in `seps` - @param txt: string to split - @param seps: list of separators - @return: list of split units - """ - default_sep = seps[0] - for sep in seps[1:]: # we skip seps[0] because that's the default separator - txt = txt.replace(sep, default_sep) - return [i.strip() for i in txt.split(default_sep)] - -def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): - """ - Checks whether a snapshot with id (not UUID) `snapshotid` is present on the nfs storage - - @param apiclient: api client connection - @param @dbconn: connection to the cloudstack db - @param config: marvin configuration file - @param zoneid: uuid of the zone on which the secondary nfs storage pool is mounted - @param snapshotid: uuid of the snapshot - @return: True if snapshot is found, False otherwise - """ - - from base import ImageStore, Snapshot - secondaryStores = ImageStore.list(apiclient, zoneid=zoneid) - - assert isinstance(secondaryStores, list), "Not a valid response for listImageStores" - assert len(secondaryStores) != 0, "No image stores found in zone %s" % zoneid - - secondaryStore = secondaryStores[0] - - if str(secondaryStore.providername).lower() != "nfs": - raise Exception( - "is_snapshot_on_nfs works only against nfs secondary storage. found %s" % str(secondaryStore.providername)) - - qresultset = dbconn.execute( - "select id from snapshots where uuid = '%s';" \ - % str(snapshotid) - ) - if len(qresultset) == 0: - raise Exception( - "No snapshot found in cloudstack with id %s" % snapshotid) - - - snapshotid = qresultset[0][0] - qresultset = dbconn.execute( - "select install_path from snapshot_store_ref where snapshot_id='%s' and store_role='Image';" % snapshotid - ) - - assert isinstance(qresultset, list), "Invalid db query response for snapshot %s" % snapshotid - - if len(qresultset) == 0: - #Snapshot does not exist - return False - - snapshotPath = qresultset[0][0] - - nfsurl = secondaryStore.url - from urllib2 import urlparse - parse_url = urlparse.urlsplit(nfsurl, scheme='nfs') - host, path = parse_url.netloc, parse_url.path - - if not config.mgtSvr: - raise Exception("Your marvin configuration does not contain mgmt server credentials") - mgtSvr, user, passwd = config.mgtSvr[0].mgtSvrIp, config.mgtSvr[0].user, config.mgtSvr[0].passwd - - try: - ssh_client = remoteSSHClient( - mgtSvr, - 22, - user, - passwd - ) - cmds = [ - "mkdir -p %s /mnt/tmp", - "mount -t %s %s%s /mnt/tmp" % ( - 'nfs', - host, - path, - ), - "test -f %s && echo 'snapshot exists'" % ( - os.path.join("/mnt/tmp", snapshotPath) - ), - ] - - for c in cmds: - result = ssh_client.execute(c) - - # Unmount the Sec Storage - cmds = [ - "cd", - "umount /mnt/tmp", - ] - for c in cmds: - ssh_client.execute(c) - except Exception as e: - raise Exception("SSH failed for management server: %s - %s" % - (config.mgtSvr[0].mgtSvrIp, e)) - return 'snapshot exists' in result diff --git a/tools/marvin/build/lib/marvin/jsonHelper.py b/tools/marvin/build/lib/marvin/jsonHelper.py deleted file mode 100644 index ae40b8dabf0..00000000000 --- a/tools/marvin/build/lib/marvin/jsonHelper.py +++ /dev/null @@ -1,381 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 cloudstackException -import json -import inspect -from cloudstackAPI import * - - -class jsonLoader(object): - '''The recursive class for building and representing objects with.''' - def __init__(self, obj): - for k in obj: - v = obj[k] - if isinstance(v, dict): - setattr(self, k, jsonLoader(v)) - elif isinstance(v, (list, tuple)): - if len(v) > 0 and isinstance(v[0], dict): - setattr(self, k, [jsonLoader(elem) for elem in v]) - else: - setattr(self, k, v) - else: - setattr(self, k, v) - - def __getattr__(self, val): - if val in self.__dict__: - return self.__dict__[val] - else: - return None - - def __repr__(self): - return '{%s}' % str(', '.join('%s : %s' % (k, repr(v)) for (k, v) - in self.__dict__.iteritems())) - - def __str__(self): - return '{%s}' % str(', '.join('%s : %s' % (k, repr(v)) for (k, v) - in self.__dict__.iteritems())) - - -class jsonDump(object): - @staticmethod - def __serialize(obj): - """Recursively walk object's hierarchy.""" - if isinstance(obj, (bool, int, long, float, basestring)): - return obj - elif isinstance(obj, dict): - obj = obj.copy() - newobj = {} - for key in obj: - if obj[key] is not None: - if (isinstance(obj[key], list) and len(obj[key]) == 0): - continue - newobj[key] = jsonDump.__serialize(obj[key]) - - return newobj - elif isinstance(obj, list): - return [jsonDump.__serialize(item) for item in obj] - elif isinstance(obj, tuple): - return tuple(jsonDump.__serialize([item for item in obj])) - elif hasattr(obj, '__dict__'): - return jsonDump.__serialize(obj.__dict__) - else: - return repr(obj) # Don't know how to handle, convert to string - - @staticmethod - def dump(obj): - return jsonDump.__serialize(obj) - - -def getclassFromName(cmd, name): - module = inspect.getmodule(cmd) - return getattr(module, name)() - - -def finalizeResultObj(result, responseName, responsecls): - responsclsLoadable = (responsecls is None - and responseName.endswith("response") - and responseName != "queryasyncjobresultresponse") - if responsclsLoadable: - '''infer the response class from the name''' - moduleName = responseName.replace("response", "") - try: - responsecls = getclassFromName(moduleName, responseName) - except: - pass - - responsNameValid = (responseName is not None - and responseName == "queryasyncjobresultresponse" - and responsecls is not None - and result.jobresult is not None) - if responsNameValid: - result.jobresult = finalizeResultObj(result.jobresult, None, - responsecls) - return result - elif responsecls is not None: - for k, v in result.__dict__.iteritems(): - if k in responsecls.__dict__: - return result - - attr = result.__dict__.keys()[0] - - value = getattr(result, attr) - if not isinstance(value, jsonLoader): - return result - - findObj = False - for k, v in value.__dict__.iteritems(): - if k in responsecls.__dict__: - findObj = True - break - if findObj: - return value - else: - return result - else: - return result - - -def getResultObj(returnObj, responsecls=None): - if len(returnObj) == 0: - return None - responseName = filter(lambda a: a != u'cloudstack-version', - returnObj.keys())[0] - - response = returnObj[responseName] - if len(response) == 0: - return None - - result = jsonLoader(response) - if result.errorcode is not None: - errMsg = "errorCode: %s, errorText:%s" % (result.errorcode, - result.errortext) - respname = responseName.replace("response", "") - raise cloudstackException.cloudstackAPIException(respname, errMsg) - - if result.count is not None: - for key in result.__dict__.iterkeys(): - if key == "count": - continue - else: - return getattr(result, key) - else: - return finalizeResultObj(result, responseName, responsecls) - -if __name__ == "__main__": - - result = '''{ "listnetworkserviceprovidersresponse" : { "count" : 1, - "networkserviceprovider" : [ { "destinationphysicalnetworkid" : "0", - "id" : "d827cae4-4998-4037-95a2-55b92b6318b1", - "name" : "VirtualRouter", - "physicalnetworkid" : "ad2948fc-1054-46c7-b1c7-61d990b86710", - "servicelist" : [ "Vpn", - "Dhcp", - "Dns", - "Gateway", - "Firewall", - "Lb", - "SourceNat", - "StaticNat", - "PortForwarding", - "UserData" - ], - "state" : "Disabled" - } ] - } }''' - nsp = getResultObj(result) - print nsp[0].id - - result = '''{ "listzonesresponse" : { - "count" : 1, - "zone" : [ { "allocationstate" : "Enabled", - "dhcpprovider" : "DhcpServer", - "dns1" : "8.8.8.8", - "dns2" : "8.8.4.4", - "id" : 1, - "internaldns1" : "192.168.110.254", - "internaldns2" : "192.168.110.253", - "name" : "test0", - "networktype" : "Basic", - "securitygroupsenabled" : true, - "zonetoken" : "5e818a11-6b00-3429-9a07-e27511d3169a" - } ] - } -}''' - zones = getResultObj(result) - print zones[0].id - res = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressResponse() - result = '''{ - "queryasyncjobresultresponse" : { - "jobid" : 10, - "jobprocstatus" : 0, - "jobresult" : { - "securitygroup" : { - "account" : "admin", - "description" : "Default Security Group", - "domain" : "ROOT", - "domainid" : 1, - "id" : 1, - "ingressrule" : [ { "account" : "a", - "endport" : 22, - "protocol" : "tcp", - "ruleid" : 1, - "securitygroupname" : "default", - "startport" : 22 - }, - { "account" : "b", - "endport" : 22, - "protocol" : "tcp", - "ruleid" : 2, - "securitygroupname" : "default", - "startport" : 22 - } - ], - "name" : "default" - } - }, - "jobresultcode" : 0, - "jobresulttype" : "object", - "jobstatus" : 1 - } -}''' - asynJob = getResultObj(result, res) - print asynJob.jobid, repr(asynJob.jobresult) - print asynJob.jobresult.ingressrule[0].account - - result = '''{ - "queryasyncjobresultresponse" : { - "errorcode" : 431, - "errortext" : -"Unable to execute API command queryasyncjobresultresponse \ -due to missing parameter jobid" - } -}''' - try: - asynJob = getResultObj(result) - except cloudstackException.cloudstackAPIException, e: - print e - - result = '{ "queryasyncjobresultresponse" : {} }' - asynJob = getResultObj(result) - print asynJob - - result = '{}' - asynJob = getResultObj(result) - print asynJob - - result = '''{ - "createzoneresponse" : { - "zone" : { - "id":1,"name":"test0","dns1":"8.8.8.8","dns2":"8.8.4.4", - "internaldns1":"192.168.110.254","internaldns2":"192.168.110.253", - "networktype":"Basic","securitygroupsenabled":true, - "allocationstate":"Enabled", - "zonetoken":"3442f287-e932-3111-960b-514d1f9c4610", - "dhcpprovider":"DhcpServer" - } - } -}''' - res = createZone.createZoneResponse() - zone = getResultObj(result, res) - print zone.id - - result = '{ "attachvolumeresponse" : {"jobid":24} }' - res = attachVolume.attachVolumeResponse() - res = getResultObj(result, res) - print res - - result = '{ "listtemplatesresponse" : { } }' - print getResultObj(result, listTemplates.listTemplatesResponse()) - - result = '''{ - "queryasyncjobresultresponse" : { - "jobid":34,"jobstatus":2,"jobprocstatus":0,"jobresultcode":530, - "jobresulttype":"object","jobresult":{ - "errorcode":431, - "errortext": -"Please provide either a volume id, or a tuple(device id, instance id)" - } - } -}''' - print getResultObj(result, listTemplates.listTemplatesResponse()) - result = '''{ - "queryasyncjobresultresponse" : { - "jobid":41,"jobstatus":1,"jobprocstatus":0, - "jobresultcode":0,"jobresulttype":"object","jobresult":{ - "virtualmachine":{ - "id":37,"name":"i-2-37-TEST", - "displayname":"i-2-37-TEST","account":"admin", - "domainid":1,"domain":"ROOT", - "created":"2011-08-25T11:13:42-0700", - "state":"Running","haenable":false,"zoneid":1, - "zonename":"test0","hostid":5, - "hostname": - "SimulatedAgent.1e629060-f547-40dd-b792-57cdc4b7d611", - "templateid":10, - "templatename":"CentOS 5.3(64-bit) no GUI (Simulator)", - "templatedisplaytext": - "CentOS 5.3(64-bit) no GUI (Simulator)", - "passwordenabled":false,"serviceofferingid":7, - "serviceofferingname":"Small Instance","cpunumber":1, - "cpuspeed":500,"memory":512,"guestosid":11, - "rootdeviceid":0,"rootdevicetype":"NetworkFilesystem", - "securitygroup":[{"id":1,"name":"default", - "description":"Default Security Group"}], - "nic":[{"id":43,"networkid":204, - "netmask":"255.255.255.0","gateway":"192.168.1.1", - "ipaddress":"192.168.1.27", - "isolationuri":"ec2://untagged", - "broadcasturi":"vlan://untagged", - "traffictype":"Guest","type":"Direct", - "isdefault":true,"macaddress":"06:56:b8:00:00:53"}], - "hypervisor":"Simulator" - } - } - } -}''' - - result = '''{ - "queryasyncjobresultresponse" : { - "accountid":"30910093-22e4-4d3c-a464-8b36b60c8001", - "userid":"cb0aeca3-42ee-47c4-838a-2cd9053441f2", - "cmd":"com.cloud.api.commands.DeployVMCmd","jobstatus":1, - "jobprocstatus":0,"jobresultcode":0,"jobresulttype":"object", - "jobresult":{ - "virtualmachine":{ - "id":"d2e4d724-e089-4e59-be8e-647674059016", - "name":"i-2-14-TEST","displayname":"i-2-14-TEST", - "account":"admin", - "domainid":"8cfafe79-81eb-445e-8608-c5b7c31fc3a5", - "domain":"ROOT","created":"2012-01-15T18:30:11+0530", - "state":"Running","haenable":false, - "zoneid":"30a397e2-1c85-40c0-8463-70278952b046", - "zonename":"Sandbox-simulator", - "hostid":"cc0105aa-a2a9-427a-8ad7-4d835483b8a9", - "hostname": - "SimulatedAgent.9fee20cc-95ca-48b1-8268-5513d6e83a1b", - "templateid":"d92570fa-bf40-44db-9dff-45cc7042604d", - "templatename":"CentOS 5.3(64-bit) no GUI (Simulator)", - "templatedisplaytext":"CentOS 5.3(64-bit) no GUI (Simulator)", - "passwordenabled":false, - "serviceofferingid":"3734d632-797b-4f1d-ac62-33f9cf70d005", - "serviceofferingname":"Sample SO","cpunumber":1,"cpuspeed":100, - "memory":128, - "guestosid":"1e36f523-23e5-4e90-869b-a1b5e9ba674d", - "rootdeviceid":0,"rootdevicetype":"NetworkFilesystem", - "nic":[{"id":"4d3ab903-f511-4dab-8a6d-c2a3b51de7e0", - "networkid":"faeb7f24-a4b9-447d-bec6-c4956c4ab0f6", - "netmask":"255.255.240.0","gateway":"10.6.240.1",' - "ipaddress":"10.6.253.89","isolationuri":"vlan://211", - "broadcasturi":"vlan://211","traffictype":"Guest", - "type":"Isolated","isdefault":true, - "macaddress":"02:00:04:74:00:09"}], - "hypervisor":"Simulator" - } - }, - "created":"2012-01-15T18:30:11+0530", - "jobid":"f4a13f28-fcd6-4d7f-b9cd-ba7eb5a5701f" - } -}''' - vm = getResultObj(result, - deployVirtualMachine.deployVirtualMachineResponse()) - print vm.jobresult.id - - cmd = deployVirtualMachine.deployVirtualMachineCmd() - responsename = cmd.__class__.__name__.replace("Cmd", "Response") - response = getclassFromName(cmd, responsename) - print response.id diff --git a/tools/marvin/build/lib/marvin/marvinPlugin.py b/tools/marvin/build/lib/marvin/marvinPlugin.py deleted file mode 100644 index aded17cca55..00000000000 --- a/tools/marvin/build/lib/marvin/marvinPlugin.py +++ /dev/null @@ -1,144 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 marvin -import sys -import logging -import nose.core -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin import deployDataCenter -from nose.plugins.base import Plugin - - -class MarvinPlugin(Plugin): - """ - Custom plugin for the cloudstackTestCases to be run using nose - """ - - name = "marvin" - - def configure(self, options, config): - if hasattr(options, self.enableOpt): - if not getattr(options, self.enableOpt): - self.enabled = False - return - else: - self.enabled = True - - self.logformat = logging.Formatter("%(asctime)s - %(levelname)s - " + - "%(name)s - %(message)s") - - if options.debug_log: - self.logger = logging.getLogger("NoseTestExecuteEngine") - self.debug_stream = logging.FileHandler(options.debug_log) - self.debug_stream.setFormatter(self.logformat) - self.logger.addHandler(self.debug_stream) - self.logger.setLevel(logging.DEBUG) - - if options.result_log: - ch = logging.StreamHandler() - ch.setLevel(logging.ERROR) - ch.setFormatter(self.logformat) - self.logger.addHandler(ch) - self.result_stream = open(options.result_log, "w") - else: - self.result_stream = sys.stdout - - deploy = deployDataCenter.deployDataCenters(options.config) - deploy.loadCfg() if options.load else deploy.deploy() - self.setClient(deploy.testClient) - self.setConfig(deploy.getCfg()) - - self.testrunner = nose.core.TextTestRunner(stream=self.result_stream, - descriptions=True, - verbosity=2, config=config) - - def options(self, parser, env): - """ - Register command line options - """ - parser.add_option("--marvin-config", action="store", - default=env.get('MARVIN_CONFIG', './datacenter.cfg'), - dest="config", - help="Marvin's configuration file where the " + - "datacenter information is specified " + - "[MARVIN_CONFIG]") - parser.add_option("--result-log", action="store", - default=env.get('RESULT_LOG', None), - dest="result_log", - help="The path to the results file where test " + - "summary will be written to [RESULT_LOG]") - parser.add_option("--client-log", action="store", - default=env.get('DEBUG_LOG', 'debug.log'), - dest="debug_log", - help="The path to the testcase debug logs " + - "[DEBUG_LOG]") - parser.add_option("--load", action="store_true", default=False, - dest="load", - help="Only load the deployment configuration given") - - Plugin.options(self, parser, env) - - def __init__(self): - self.identifier = None - Plugin.__init__(self) - - def prepareTestRunner(self, runner): - return self.testrunner - - def wantClass(self, cls): - if cls.__name__ == 'cloudstackTestCase': - return False - if issubclass(cls, cloudstackTestCase): - return True - return None - - def loadTestsFromTestCase(self, cls): - if cls.__name__ != 'cloudstackTestCase': - self.identifier = cls.__name__ - self._injectClients(cls) - - def setClient(self, client): - if client is not None: - self.testclient = client - - def setConfig(self, config): - if config is not None: - self.config = config - - def beforeTest(self, test): - testname = test.__str__().split()[0] - self.testclient.identifier = '-'.join([self.identifier, testname]) - self.logger.name = test.__str__() - - def _injectClients(self, test): - self.debug_stream. \ - setFormatter(logging. - Formatter("%(asctime)s - %(levelname)s - %(name)s" + - " - %(message)s")) - setattr(test, "debug", self.logger.debug) - setattr(test, "info", self.logger.info) - setattr(test, "warn", self.logger.warning) - setattr(test, "testClient", self.testclient) - setattr(test, "config", self.config) - if self.testclient.identifier is None: - self.testclient.identifier = self.identifier - setattr(test, "clstestclient", self.testclient) - if hasattr(test, "user"): - # when the class-level attr applied. all test runs as 'user' - self.testclient.createUserApiClient(test.UserName, test.DomainName, - test.AcctType) diff --git a/tools/marvin/build/lib/marvin/remoteSSHClient.py b/tools/marvin/build/lib/marvin/remoteSSHClient.py deleted file mode 100644 index fea9b125d19..00000000000 --- a/tools/marvin/build/lib/marvin/remoteSSHClient.py +++ /dev/null @@ -1,108 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 paramiko -import time -import cloudstackException -import contextlib -import logging -from contextlib import closing - - -class remoteSSHClient(object): - def __init__(self, host, port, user, passwd, retries=10, delay=30, - log_lvl=logging.INFO, keyPairFileLocation=None): - self.host = host - self.port = port - self.user = user - self.passwd = passwd - self.keyPairFile = keyPairFileLocation - self.ssh = paramiko.SSHClient() - self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - self.logger = logging.getLogger('sshClient') - ch = logging.StreamHandler() - ch.setLevel(log_lvl) - self.logger.addHandler(ch) - - retry_count = retries - while retry_count >= 0: - try: - if keyPairFileLocation is None: - self.ssh.connect(str(host), int(port), user, passwd) - self.logger.debug("SSH connect: %s@%s with passwd %s" % - (user, str(host), passwd)) - else: - self.ssh.connect(hostname=str(host), - port=int(port), - username=str(user), - key_filename=str(keyPairFileLocation), - look_for_keys=False - ) - self.logger.debug( - "connecting to server %s with user %s key %s" % - (str(host), user, keyPairFileLocation)) - self.logger.debug("SSH connect: %s@%s with passwd %s" % - (user, str(host), passwd)) - #except paramiko.AuthenticationException, authEx: - # raise cloudstackException. \ - # InvalidParameterException("Invalid credentials to " - # + "login to %s on port %s" % - # (str(host), port)) - except Exception as se: - if retry_count == 0: - raise cloudstackException. \ - InvalidParameterException(repr(se)) - else: - return - - retry_count = retry_count - 1 - time.sleep(delay) - - def execute(self, command): - stdin, stdout, stderr = self.ssh.exec_command(command) - output = stdout.readlines() - errors = stderr.readlines() - results = [] - if output is not None and len(output) == 0: - if errors is not None and len(errors) > 0: - for error in errors: - results.append(error.rstrip()) - - else: - for strOut in output: - results.append(strOut.rstrip()) - self.logger.debug("{Cmd: %s via Host: %s} {returns: %s}" % - (command, str(self.host), results)) - return results - - def scp(self, srcFile, destPath): - transport = paramiko.Transport((self.host, int(self.port))) - transport.connect(username=self.user, password=self.passwd) - sftp = paramiko.SFTPClient.from_transport(transport) - try: - sftp.put(srcFile, destPath) - except IOError, e: - raise e - - def close(self): - self.ssh.close() - - -if __name__ == "__main__": - with contextlib.closing(remoteSSHClient("10.223.75.10", 22, "root", - "password")) as ssh: - print ssh.execute("ls -l") diff --git a/tools/marvin/build/lib/marvin/sandbox/__init__.py b/tools/marvin/build/lib/marvin/sandbox/__init__.py deleted file mode 100644 index 57823fcc162..00000000000 --- a/tools/marvin/build/lib/marvin/sandbox/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - diff --git a/tools/marvin/build/lib/marvin/sandbox/advanced/__init__.py b/tools/marvin/build/lib/marvin/sandbox/advanced/__init__.py deleted file mode 100644 index 57823fcc162..00000000000 --- a/tools/marvin/build/lib/marvin/sandbox/advanced/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - diff --git a/tools/marvin/build/lib/marvin/sandbox/advanced/advanced_env.py b/tools/marvin/build/lib/marvin/sandbox/advanced/advanced_env.py deleted file mode 100644 index 1728e61fb19..00000000000 --- a/tools/marvin/build/lib/marvin/sandbox/advanced/advanced_env.py +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env python -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -''' -############################################################ -# Experimental state of scripts -# * Need to be reviewed -# * Only a sandbox -############################################################ -''' -import random -import marvin -from ConfigParser import SafeConfigParser -from optparse import OptionParser -from marvin.configGenerator import * - - -def getGlobalSettings(config): - for k, v in dict(config.items('globals')).iteritems(): - cfg = configuration() - cfg.name = k - cfg.value = v - yield cfg - - -def describeResources(config): - zs = cloudstackConfiguration() - - z = zone() - z.dns1 = config.get('environment', 'dns') - z.internaldns1 = config.get('environment', 'dns') - z.name = 'Sandbox-%s'%(config.get('cloudstack', 'hypervisor')) - z.networktype = 'Advanced' - z.guestcidraddress = '10.1.1.0/24' - z.securitygroupenabled = 'false' - - vpcprovider = provider() - vpcprovider.name = 'VpcVirtualRouter' - - lbprovider = provider() - lbprovider.name = 'InternalLbVm' - - pn = physical_network() - pn.name = "Sandbox-pnet" - pn.vlan = config.get('cloudstack', 'pnet.vlan') - pn.tags = ["cloud-simulator-public"] - pn.traffictypes = [traffictype("Guest"), - traffictype("Management", {"simulator" : "cloud-simulator-mgmt"}), - traffictype("Public", {"simulator":"cloud-simulator-public"})] - pn.isolationmethods = ["VLAN"] - pn.providers.append(vpcprovider) - pn.providers.append(lbprovider) - - pn2 = physical_network() - pn2.name = "Sandbox-pnet2" - pn2.vlan = config.get('cloudstack', 'pnet2.vlan') - pn2.tags = ["cloud-simulator-guest"] - pn2.traffictypes = [traffictype('Guest', {'simulator': 'cloud-simulator-guest'})] - pn2.isolationmethods = ["VLAN"] - pn2.providers.append(vpcprovider) - pn2.providers.append(lbprovider) - - z.physical_networks.append(pn) - z.physical_networks.append(pn2) - - p = pod() - p.name = 'POD0' - p.gateway = config.get('cloudstack', 'private.gateway') - p.startip = config.get('cloudstack', 'private.pod.startip') - p.endip = config.get('cloudstack', 'private.pod.endip') - p.netmask = config.get('cloudstack', 'private.netmask') - - v = iprange() - v.gateway = config.get('cloudstack', 'public.gateway') - v.startip = config.get('cloudstack', 'public.vlan.startip') - v.endip = config.get('cloudstack', 'public.vlan.endip') - v.netmask = config.get('cloudstack', 'public.netmask') - v.vlan = config.get('cloudstack', 'public.vlan') - z.ipranges.append(v) - - c = cluster() - c.clustername = 'C0' - c.hypervisor = config.get('cloudstack', 'hypervisor') - c.clustertype = 'CloudManaged' - - h = host() - h.username = 'root' - h.password = config.get('cloudstack', 'host.password') - h.url = 'http://%s'%(config.get('cloudstack', 'host')) - c.hosts.append(h) - - ps = primaryStorage() - ps.name = 'PS0' - ps.url = config.get('cloudstack', 'primary.pool') - c.primaryStorages.append(ps) - - p.clusters.append(c) - z.pods.append(p) - - secondary = secondaryStorage() - secondary.url = config.get('cloudstack', 'secondary.pool') - secondary.provider = "NFS" - z.secondaryStorages.append(secondary) - - '''Add zone''' - zs.zones.append(z) - - '''Add mgt server''' - mgt = managementServer() - mgt.mgtSvrIp = config.get('environment', 'mshost') - mgt.user = config.get('environment', 'mshost.user') - mgt.passwd = config.get('environment', 'mshost.passwd') - zs.mgtSvr.append(mgt) - - '''Add a database''' - db = dbServer() - db.dbSvr = config.get('environment', 'mysql.host') - db.user = config.get('environment', 'mysql.cloud.user') - db.passwd = config.get('environment', 'mysql.cloud.passwd') - zs.dbSvr = db - - '''Add some configuration''' - [zs.globalConfig.append(cfg) for cfg in getGlobalSettings(config)] - - ''''add loggers''' - testClientLogger = logger() - testClientLogger.name = 'TestClient' - testClientLogger.file = 'testclient.log' - - testCaseLogger = logger() - testCaseLogger.name = 'TestCase' - testCaseLogger.file = 'testcase.log' - - zs.logger.append(testClientLogger) - zs.logger.append(testCaseLogger) - return zs - - -if __name__ == '__main__': - parser = OptionParser() - parser.add_option('-i', '--input', action='store', default='setup.properties', \ - dest='input', help='file containing environment setup information') - parser.add_option('-o', '--output', action='store', default='./sandbox.cfg', \ - dest='output', help='path where environment json will be generated') - - - (opts, args) = parser.parse_args() - - cfg_parser = SafeConfigParser() - cfg_parser.read(opts.input) - - cfg = describeResources(cfg_parser) - generate_setup_config(cfg, opts.output) diff --git a/tools/marvin/build/lib/marvin/sandbox/advancedsg/__init__.py b/tools/marvin/build/lib/marvin/sandbox/advancedsg/__init__.py deleted file mode 100644 index 57823fcc162..00000000000 --- a/tools/marvin/build/lib/marvin/sandbox/advancedsg/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - diff --git a/tools/marvin/build/lib/marvin/sandbox/advancedsg/advancedsg_env.py b/tools/marvin/build/lib/marvin/sandbox/advancedsg/advancedsg_env.py deleted file mode 100644 index 9cf4a0aa98f..00000000000 --- a/tools/marvin/build/lib/marvin/sandbox/advancedsg/advancedsg_env.py +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/env python -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -''' -############################################################ -# Experimental state of scripts -# * Need to be reviewed -# * Only a sandbox -############################################################ -''' -import random -import marvin -from ConfigParser import SafeConfigParser -from optparse import OptionParser -from marvin.configGenerator import * - - -def getGlobalSettings(config): - for k, v in dict(config.items('globals')).iteritems(): - cfg = configuration() - cfg.name = k - cfg.value = v - yield cfg - - -def describeResources(config): - zs = cloudstackConfiguration() - - z = zone() - z.dns1 = config.get('environment', 'dns') - z.internaldns1 = config.get('environment', 'dns') - z.name = 'Sandbox-%s'%(config.get('cloudstack', 'hypervisor')) - z.networktype = 'Advanced' - z.securitygroupenabled = 'true' - - sgprovider = provider() - sgprovider.broadcastdomainrange = 'ZONE' - sgprovider.name = 'SecurityGroupProvider' - - pn = physical_network() - pn.name = "Sandbox-pnet" - pn.tags = ["cloud-simulator-pnet"] - pn.traffictypes = [traffictype("Guest"), - traffictype("Management", {"simulator" : "cloud-simulator-mgmt"})] - pn.isolationmethods = ["VLAN"] - pn.providers.append(sgprovider) - - z.physical_networks.append(pn) - - p = pod() - p.name = 'POD0' - p.gateway = config.get('cloudstack', 'private.gateway') - p.startip = config.get('cloudstack', 'private.pod.startip') - p.endip = config.get('cloudstack', 'private.pod.endip') - p.netmask = config.get('cloudstack', 'private.netmask') - - v = iprange() - v.gateway = config.get('cloudstack', 'guest.gateway') - v.startip = config.get('cloudstack', 'guest.vlan.startip') - v.endip = config.get('cloudstack', 'guest.vlan.endip') - v.netmask = config.get('cloudstack', 'guest.netmask') - v.vlan = config.get('cloudstack', 'guest.vlan') - z.ipranges.append(v) - - c = cluster() - c.clustername = 'C0' - c.hypervisor = config.get('cloudstack', 'hypervisor') - c.clustertype = 'CloudManaged' - - h = host() - h.username = 'root' - h.password = config.get('cloudstack', 'host.password') - h.url = 'http://%s'%(config.get('cloudstack', 'host')) - c.hosts.append(h) - - ps = primaryStorage() - ps.name = 'PS0' - ps.url = config.get('cloudstack', 'primary.pool') - c.primaryStorages.append(ps) - - p.clusters.append(c) - z.pods.append(p) - - secondary = secondaryStorage() - secondary.url = config.get('cloudstack', 'secondary.pool') - secondary.provider = "NFS" - z.secondaryStorages.append(secondary) - - '''Add zone''' - zs.zones.append(z) - - '''Add mgt server''' - mgt = managementServer() - mgt.mgtSvrIp = config.get('environment', 'mshost') - mgt.user = config.get('environment', 'mshost.user') - mgt.passwd = config.get('environment', 'mshost.passwd') - zs.mgtSvr.append(mgt) - - '''Add a database''' - db = dbServer() - db.dbSvr = config.get('environment', 'mysql.host') - db.user = config.get('environment', 'mysql.cloud.user') - db.passwd = config.get('environment', 'mysql.cloud.passwd') - zs.dbSvr = db - - '''Add some configuration''' - [zs.globalConfig.append(cfg) for cfg in getGlobalSettings(config)] - - ''''add loggers''' - testClientLogger = logger() - testClientLogger.name = 'TestClient' - testClientLogger.file = 'testclient.log' - - testCaseLogger = logger() - testCaseLogger.name = 'TestCase' - testCaseLogger.file = 'testcase.log' - - zs.logger.append(testClientLogger) - zs.logger.append(testCaseLogger) - return zs - - -if __name__ == '__main__': - parser = OptionParser() - parser.add_option('-i', '--input', action='store', default='setup.properties', \ - dest='input', help='file containing environment setup information') - parser.add_option('-o', '--output', action='store', default='./sandbox.cfg', \ - dest='output', help='path where environment json will be generated') - - - (opts, args) = parser.parse_args() - - cfg_parser = SafeConfigParser() - cfg_parser.read(opts.input) - - cfg = describeResources(cfg_parser) - generate_setup_config(cfg, opts.output) diff --git a/tools/marvin/build/lib/marvin/sandbox/basic/__init__.py b/tools/marvin/build/lib/marvin/sandbox/basic/__init__.py deleted file mode 100644 index 57823fcc162..00000000000 --- a/tools/marvin/build/lib/marvin/sandbox/basic/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - diff --git a/tools/marvin/build/lib/marvin/sandbox/basic/basic_env.py b/tools/marvin/build/lib/marvin/sandbox/basic/basic_env.py deleted file mode 100644 index bf106fcb8de..00000000000 --- a/tools/marvin/build/lib/marvin/sandbox/basic/basic_env.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -''' -############################################################ -# Experimental state of scripts -# * Need to be reviewed -# * Only a sandbox -############################################################ -''' -import random -import marvin -from ConfigParser import SafeConfigParser -from optparse import OptionParser -from marvin.configGenerator import * - - -def getGlobalSettings(config): - for k, v in dict(config.items('globals')).iteritems(): - cfg = configuration() - cfg.name = k - cfg.value = v - yield cfg - - -def describeResources(config): - zs = cloudstackConfiguration() - - z = zone() - z.dns1 = config.get('environment', 'dns') - z.internaldns1 = config.get('environment', 'dns') - z.name = 'Sandbox-%s'%(config.get('cloudstack', 'hypervisor')) - z.networktype = 'Basic' - z.securitygroupenabled = 'true' - - sgprovider = provider() - sgprovider.broadcastdomainrange = 'Pod' - sgprovider.name = 'SecurityGroupProvider' - - pn = physical_network() - pn.name = "Sandbox-pnet" - pn.traffictypes = [traffictype("Guest"), traffictype("Management")] - pn.isolationmethods = ["L3"] - pn.providers.append(sgprovider) - - z.physical_networks.append(pn) - - p = pod() - p.name = 'POD0' - p.gateway = config.get('cloudstack', 'private.gateway') - p.startip = config.get('cloudstack', 'private.pod.startip') - p.endip = config.get('cloudstack', 'private.pod.endip') - p.netmask = config.get('cloudstack', 'private.netmask') - - v = iprange() - v.gateway = config.get('cloudstack', 'public.gateway') - v.startip = config.get('cloudstack', 'public.vlan.startip') - v.endip = config.get('cloudstack', 'public.vlan.endip') - v.netmask = config.get('cloudstack', 'public.netmask') - p.guestIpRanges.append(v) - - c = cluster() - c.clustername = 'C0' - c.hypervisor = config.get('cloudstack', 'hypervisor') - c.clustertype = 'CloudManaged' - - h = host() - h.username = 'root' - h.password = config.get('cloudstack', 'host.password') - h.url = 'http://%s'%(config.get('cloudstack', 'host')) - c.hosts.append(h) - - ps = primaryStorage() - ps.name = 'PS0' - ps.url = config.get('cloudstack', 'primary.pool') - c.primaryStorages.append(ps) - - p.clusters.append(c) - z.pods.append(p) - - secondary = secondaryStorage() - secondary.url = config.get('cloudstack', 'secondary.pool') - secondary.provider = "NFS" - z.secondaryStorages.append(secondary) - - '''Add zone''' - zs.zones.append(z) - - '''Add mgt server''' - mgt = managementServer() - mgt.mgtSvrIp = config.get('environment', 'mshost') - mgt.user = config.get('environment', 'mshost.user') - mgt.passwd = config.get('environment', 'mshost.passwd') - zs.mgtSvr.append(mgt) - - '''Add a database''' - db = dbServer() - db.dbSvr = config.get('environment', 'mysql.host') - db.user = config.get('environment', 'mysql.cloud.user') - db.passwd = config.get('environment', 'mysql.cloud.passwd') - zs.dbSvr = db - - '''Add some configuration''' - [zs.globalConfig.append(cfg) for cfg in getGlobalSettings(config)] - - ''''add loggers''' - testClientLogger = logger() - testClientLogger.name = 'TestClient' - testClientLogger.file = '/var/log/testclient.log' - - testCaseLogger = logger() - testCaseLogger.name = 'TestCase' - testCaseLogger.file = '/var/log/testcase.log' - - zs.logger.append(testClientLogger) - zs.logger.append(testCaseLogger) - return zs - - -if __name__ == '__main__': - parser = OptionParser() - parser.add_option('-i', '--input', action='store', default='setup.properties', \ - dest='input', help='file containing environment setup information') - parser.add_option('-o', '--output', action='store', default='./sandbox.cfg', \ - dest='output', help='path where environment json will be generated') - - - (opts, args) = parser.parse_args() - - cfg_parser = SafeConfigParser() - cfg_parser.read(opts.input) - - cfg = describeResources(cfg_parser) - generate_setup_config(cfg, opts.output) diff --git a/tools/marvin/build/lib/marvin/sandbox/testSetupSuccess.py b/tools/marvin/build/lib/marvin/sandbox/testSetupSuccess.py deleted file mode 100644 index 8a0034cfa9b..00000000000 --- a/tools/marvin/build/lib/marvin/sandbox/testSetupSuccess.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. - -import marvin -import unittest -from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from time import sleep as delay - -class TestSetupSuccess(cloudstackTestCase): - """ - Test to verify if the cloudstack is ready to launch tests upon - 1. Verify that system VMs are up and running in all zones - 2. Verify that built-in templates are Ready in all zones - """ - @classmethod - def setUpClass(cls): - cls.apiClient = super(TestSetupSuccess, cls).getClsTestClient().getApiClient() - - zones = listZones.listZonesCmd() - cls.zones_list = cls.apiClient.listZones(zones) - cls.retry = 50 - - def test_systemVmReady(self): - """ - system VMs need to be ready and Running for each zone in cloudstack - """ - for z in self.zones_list: - retry = self.retry - while retry != 0: - self.debug("looking for system VMs in zone: %s, %s"%(z.id, z.name)) - sysvms = listSystemVms.listSystemVmsCmd() - sysvms.zoneid = z.id - sysvms.state = 'Running' - sysvms_list = self.apiClient.listSystemVms(sysvms) - if sysvms_list is not None and len(sysvms_list) == 2: - assert len(sysvms_list) == 2 - self.debug("found %d system VMs running {%s}"%(len(sysvms_list), sysvms_list)) - break - retry = retry - 1 - delay(60) #wait a minute for retry - self.assertNotEqual(retry, 0, "system VMs not Running in zone %s"%z.name) - - def test_templateBuiltInReady(self): - """ - built-in templates CentOS to be ready - """ - for z in self.zones_list: - retry = self.retry - while retry != 0: - self.debug("Looking for at least one ready builtin template") - templates = listTemplates.listTemplatesCmd() - templates.templatefilter = 'featured' - templates.listall = 'true' - templates_list = self.apiClient.listTemplates(templates) - if templates_list is not None: - builtins = [tmpl for tmpl in templates_list if tmpl.templatetype == 'BUILTIN' and tmpl.isready == True] - if len(builtins) > 0: - self.debug("Found %d builtins ready for use %s"%(len(builtins), builtins)) - break - retry = retry - 1 - delay(60) #wait a minute for retry - self.assertNotEqual(retry, 0, "builtIn templates not ready in zone %s"%z.name) - - @classmethod - def tearDownClass(cls): - pass diff --git a/tools/marvin/build/lib/marvin/settings.py b/tools/marvin/build/lib/marvin/settings.py deleted file mode 100644 index a31e182b3dc..00000000000 --- a/tools/marvin/build/lib/marvin/settings.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. - -# Settings for the XML test runner - -# Use this setting to choose between a verbose and a non-verbose output. -TEST_OUTPUT_VERBOSE = 2. - -# If your test methods contains docstrings, you can display such docstrings -# instead of display the test name (ex: module.TestCase.test_method). -# In order to use this feature, you have to enable verbose output by setting -# TEST_OUTPUT_VERBOSE = 2. - -TEST_OUTPUT_DESCRIPTIONS = True diff --git a/tools/marvin/build/lib/marvin/testSetupSuccess.py b/tools/marvin/build/lib/marvin/testSetupSuccess.py deleted file mode 100644 index 1701626a820..00000000000 --- a/tools/marvin/build/lib/marvin/testSetupSuccess.py +++ /dev/null @@ -1,98 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT 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 marvin -import unittest -from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from time import sleep as delay - - -class TestSetupSuccess(cloudstackTestCase): - """ - Test to verify if the cloudstack is ready to launch tests upon - 1. Verify that system VMs are up and running in all zones - 2. Verify that built-in templates are Ready in all zones - """ - @classmethod - def setUpClass(cls): - testClient = super(TestSetupSuccess, cls).getClsTestClient() - cls.apiClient = testClient.getApiClient() - - zones = listZones.listZonesCmd() - cls.zones_list = cls.apiClient.listZones(zones) - cls.retry = 2 - - def test_systemVmReady(self): - """ - system VMs need to be ready and Running for each zone in cloudstack - """ - for z in self.zones_list: - retry = self.retry - while retry != 0: - self.debug("looking for system VMs in zone: %s, %s" % - (z.id, z.name)) - sysvms = listSystemVms.listSystemVmsCmd() - sysvms.zoneid = z.id - sysvms.state = 'Running' - sysvms_list = self.apiClient.listSystemVms(sysvms) - if sysvms_list is not None and len(sysvms_list) == 2: - assert len(sysvms_list) == 2 - self.debug("found %d system VMs running {%s}" % - (len(sysvms_list), sysvms_list)) - break - retry = retry - 1 - delay(60) # wait a minute for retry - self.assertNotEqual(retry, 0, - "system VMs not Running in zone %s" % - z.name) - - def test_templateBuiltInReady(self): - """ - built-in templates CentOS to be ready - """ - for z in self.zones_list: - retry = self.retry - while retry != 0: - self.debug("Looking for at least one ready builtin template") - templates = listTemplates.listTemplatesCmd() - templates.templatefilter = 'featured' - templates.listall = 'true' - templates_list = self.apiClient.listTemplates(templates) - if templates_list is not None: - builtins = [tmpl - for tmpl in templates_list - if tmpl.templatetype == 'BUILTIN' - and tmpl.isready] - if len(builtins) > 0: - self.debug("Found %d builtins ready for use %s" % - (len(builtins), builtins)) - break - retry = retry - 1 - delay(60) # wait a minute for retry - self.assertNotEqual(retry, 0, - "builtIn templates not ready in zone %s" % - z.name) - - def test_deployVmWithBuiltIn(self): - """ - Deploys a VM with the built-in CentOS template - """ - - @classmethod - def tearDownClass(cls): - pass diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index d2bfb8f6505..58a9bf9ae99 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -118,7 +118,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin @Name: is_server_ssh_ready @Input: timeout: tcp connection timeout flag, others information need to be added - @Output:object for SshClient + @Output:object for remoteSSHClient Name of the function is little misnomer and is not verifying anything as such mentioned ''' @@ -129,12 +129,12 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin port=port, user=username, passwd=password, - keyPairFiles=keyPairFileLocation, + keyPairFileLocation=keyPairFileLocation, retries=retries, delay=retryinterv, timeout=timeout) except Exception, e: - raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, str(e))) + raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, e)) else: return ssh diff --git a/tools/marvin/marvin/integration/lib/utils.py.rej b/tools/marvin/marvin/integration/lib/utils.py.rej deleted file mode 100644 index acae5287eae..00000000000 --- a/tools/marvin/marvin/integration/lib/utils.py.rej +++ /dev/null @@ -1,10 +0,0 @@ -diff a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py (rejected hunks) -@@ -118,7 +118,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin - @Name: is_server_ssh_ready - @Input: timeout: tcp connection timeout flag, - others information need to be added -- @Output:object for remoteSSHClient -+ @Output:object for SshClient - Name of the function is little misnomer and is not - verifying anything as such mentioned - ''' diff --git a/tools/marvin/marvin/sshClient.py b/tools/marvin/marvin/remoteSSHClient.py similarity index 96% rename from tools/marvin/marvin/sshClient.py rename to tools/marvin/marvin/remoteSSHClient.py index 58f2602107b..c9720e39e40 100644 --- a/tools/marvin/marvin/sshClient.py +++ b/tools/marvin/marvin/remoteSSHClient.py @@ -26,7 +26,7 @@ from marvin.codes import ( from contextlib import closing -class SshClient(object): +class remoteSSHClient(object): ''' Added timeout flag for ssh connect calls.Default to 3.0 seconds ''' @@ -92,9 +92,9 @@ class SshClient(object): while self.retryCnt >= 0: try: self.logger.debug("SSH Connection: Host:%s User:%s\ - Port:%s" % - (self.host, self.user, str(self.port) - )) + Port:%s KeyPairFile: %s" % + (self.host, self.user, str(self.port), + str(self.keyPairFiles))) if self.keyPairFiles is None: self.ssh.connect(hostname=self.host, port=self.port, @@ -177,6 +177,6 @@ class SshClient(object): if __name__ == "__main__": - with contextlib.closing(SshClient("10.223.75.10", 22, "root", + with contextlib.closing(remoteSSHClient("10.223.75.10", 22, "root", "password")) as ssh: print ssh.execute("ls -l") From d27c6eb9a91e4b883258738328666458166a8fb6 Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Fri, 8 Nov 2013 16:13:24 +0530 Subject: [PATCH 094/108] Fixing build break due to console proxy rdp client. --- services/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/services/pom.xml b/services/pom.xml index 5d1403b18c8..c2f7f88ad88 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -32,7 +32,6 @@ console-proxy - console-proxy-rdp/rdpconsole secondary-storage From dcd3c44279478b237f8fdcb6f8f9e301b9ae3195 Mon Sep 17 00:00:00 2001 From: Damodar Reddy Date: Fri, 8 Nov 2013 14:03:03 +0530 Subject: [PATCH 095/108] CLOUDSTACK-4916: To Enable Master High Availability using mysql connector params and mysql's 2 way replication Signed-off-by: Abhinandan Prateek --- client/tomcatconf/db.properties.in | 24 ++++++++++- .../cloud/utils/db/ConnectionConcierge.java | 6 ++- .../src/com/cloud/utils/db/Merovingian2.java | 10 +++-- .../com/cloud/utils/db/TransactionLegacy.java | 43 +++++++++++++------ 4 files changed, 63 insertions(+), 20 deletions(-) diff --git a/client/tomcatconf/db.properties.in b/client/tomcatconf/db.properties.in index b0cb22b26f0..50b8d334136 100644 --- a/client/tomcatconf/db.properties.in +++ b/client/tomcatconf/db.properties.in @@ -32,7 +32,6 @@ db.cloud.name=cloud db.cloud.maxActive=250 db.cloud.maxIdle=30 db.cloud.maxWait=10000 -db.cloud.autoReconnect=true db.cloud.validationQuery=SELECT 1 db.cloud.testOnBorrow=true db.cloud.testWhileIdle=true @@ -63,7 +62,6 @@ db.usage.name=cloud_usage db.usage.maxActive=100 db.usage.maxIdle=30 db.usage.maxWait=10000 -db.usage.autoReconnect=true db.usage.url.params= # awsapi database settings @@ -84,3 +82,25 @@ db.simulator.maxIdle=30 db.simulator.maxWait=10000 db.simulator.autoReconnect=true + +# High Availability And Cluster Properties +db.ha.enabled=false +# cloud stack Database +db.cloud.slaves=localhost,localhost #Comma Separated list of slaves +db.cloud.autoReconnect=true +db.cloud.failOverReadOnly=false #Do not change this parameter to true +db.cloud.reconnectAtTxEnd=true +db.cloud.autoReconnectForPools=true +db.cloud.secondsBeforeRetryMaster=3600 +db.cloud.queriesBeforeRetryMaster=5000 +db.cloud.initialTimeout=3600 + +#usage Database +db.usage.slaves=localhost,localhost #Comma Separated list of slaves +db.usage.autoReconnect=true +db.usage.failOverReadOnly=false #Do not change this parameter to true +db.usage.reconnectAtTxEnd=true +db.usage.autoReconnectForPools=true +db.usage.secondsBeforeRetryMaster=3600 +db.usage.queriesBeforeRetryMaster=5000 +db.usage.initialTimeout=3600 diff --git a/framework/db/src/com/cloud/utils/db/ConnectionConcierge.java b/framework/db/src/com/cloud/utils/db/ConnectionConcierge.java index acb9cc6851b..bb76d0f03c8 100644 --- a/framework/db/src/com/cloud/utils/db/ConnectionConcierge.java +++ b/framework/db/src/com/cloud/utils/db/ConnectionConcierge.java @@ -144,8 +144,10 @@ public class ConnectionConcierge { PreparedStatement pstmt = null; try { if (conn != null) { - pstmt = conn.prepareStatement("SELECT 1"); - pstmt.executeQuery(); + synchronized (conn) { + pstmt = conn.prepareStatement("SELECT 1"); + pstmt.executeQuery(); + } } return null; } catch (Throwable th) { diff --git a/framework/db/src/com/cloud/utils/db/Merovingian2.java b/framework/db/src/com/cloud/utils/db/Merovingian2.java index 8544aab0384..15e3d24299f 100644 --- a/framework/db/src/com/cloud/utils/db/Merovingian2.java +++ b/framework/db/src/com/cloud/utils/db/Merovingian2.java @@ -253,10 +253,12 @@ public class Merovingian2 extends StandardMBean implements MerovingianMBean { s_logger.info("Cleaning up locks for " + msId); PreparedStatement pstmt = null; try { - pstmt = _concierge.conn().prepareStatement(CLEANUP_MGMT_LOCKS_SQL); - pstmt.setLong(1, msId); - int rows = pstmt.executeUpdate(); - s_logger.info("Released " + rows + " locks for " + msId); + synchronized (_concierge.conn()) { + pstmt = _concierge.conn().prepareStatement(CLEANUP_MGMT_LOCKS_SQL); + pstmt.setLong(1, msId); + int rows = pstmt.executeUpdate(); + s_logger.info("Released " + rows + " locks for " + msId); + } } catch (SQLException e) { throw new CloudRuntimeException("Unable to clear the locks", e); } finally { diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java index a874ce10a56..39893bd4eab 100755 --- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java +++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java @@ -17,7 +17,6 @@ package com.cloud.utils.db; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; @@ -41,12 +40,9 @@ import org.apache.commons.pool.KeyedObjectPoolFactory; import org.apache.commons.pool.impl.GenericObjectPool; import org.apache.commons.pool.impl.StackKeyedObjectPoolFactory; import org.apache.log4j.Logger; -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.properties.EncryptableProperties; import com.cloud.utils.Pair; import com.cloud.utils.PropertiesUtil; -import com.cloud.utils.crypt.EncryptionSecretKeyChecker; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.mgmt.JmxUtil; @@ -108,8 +104,6 @@ public class TransactionLegacy { private Statement _stmt; private String _creator; - private TransactionLegacy _prev = null; - public static TransactionLegacy currentTxn() { return currentTxn(true); } @@ -1016,6 +1010,7 @@ public class TransactionLegacy { private static DataSource s_usageDS; private static DataSource s_awsapiDS; private static DataSource s_simulatorDS; + private static boolean s_dbHAEnabled; static { // Initialize with assumed db.properties file @@ -1031,11 +1026,15 @@ public class TransactionLegacy { } } + @SuppressWarnings({ "rawtypes", "unchecked" }) public static void initDataSource(Properties dbProps) { try { if (dbProps.size() == 0) return; + s_dbHAEnabled = Boolean.valueOf(dbProps.getProperty("db.ha.enabled")); + s_logger.info("Is Data Base High Availiability enabled? Ans : " + s_dbHAEnabled); + // FIXME: If params are missing...default them???? final int cloudMaxActive = Integer.parseInt(dbProps.getProperty("db.cloud.maxActive")); final int cloudMaxIdle = Integer.parseInt(dbProps.getProperty("db.cloud.maxIdle")); @@ -1071,6 +1070,14 @@ public class TransactionLegacy { final boolean cloudPoolPreparedStatements = Boolean.parseBoolean(dbProps.getProperty("db.cloud.poolPreparedStatements")); final String url = dbProps.getProperty("db.cloud.url.params"); + String cloudDbHAParams = null; + String cloudSlaves = null; + if(s_dbHAEnabled) { + cloudDbHAParams = getDBHAParams("cloud", dbProps); + cloudSlaves = dbProps.getProperty("db.cloud.slaves"); + s_logger.info("The slaves configured for Cloud Data base is/are : " + cloudSlaves); + } + final boolean useSSL = Boolean.parseBoolean(dbProps.getProperty("db.cloud.useSSL")); if (useSSL) { System.setProperty("javax.net.ssl.keyStore", dbProps.getProperty("db.cloud.keyStore")); @@ -1082,8 +1089,8 @@ public class TransactionLegacy { final GenericObjectPool cloudConnectionPool = new GenericObjectPool(null, cloudMaxActive, GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION, cloudMaxWait, cloudMaxIdle, cloudTestOnBorrow, false, cloudTimeBtwEvictionRunsMillis, 1, cloudMinEvcitableIdleTimeMillis, cloudTestWhileIdle); - final ConnectionFactory cloudConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + ":" + cloudPort + "/" + cloudDbName + - "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : ""), cloudUsername, cloudPassword); + final ConnectionFactory cloudConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + (s_dbHAEnabled ? "," + cloudSlaves : "") + ":" + cloudPort + "/" + cloudDbName + + "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : "") + (s_dbHAEnabled ? "&" + cloudDbHAParams : ""), cloudUsername, cloudPassword); final KeyedObjectPoolFactory poolableObjFactory = (cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null); @@ -1108,8 +1115,8 @@ public class TransactionLegacy { final GenericObjectPool usageConnectionPool = new GenericObjectPool(null, usageMaxActive, GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION, usageMaxWait, usageMaxIdle); - final ConnectionFactory usageConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + usageHost + ":" + usagePort + "/" + usageDbName + - "?autoReconnect=" + usageAutoReconnect + (usageUrl != null ? "&" + usageUrl : ""), usageUsername, usagePassword); + final ConnectionFactory usageConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + usageHost + (s_dbHAEnabled ? "," + dbProps.getProperty("db.cloud.slaves") : "") + ":" + usagePort + "/" + usageDbName + + "?autoReconnect=" + usageAutoReconnect + (usageUrl != null ? "&" + usageUrl : "") + (s_dbHAEnabled ? "&" + getDBHAParams("usage", dbProps) : ""), usageUsername, usagePassword); final PoolableConnectionFactory usagePoolableConnectionFactory = new PoolableConnectionFactory(usageConnectionFactory, usageConnectionPool, new StackKeyedObjectPoolFactory(), null, false, false); @@ -1121,8 +1128,8 @@ public class TransactionLegacy { final String awsapiDbName = dbProps.getProperty("db.awsapi.name"); final GenericObjectPool awsapiConnectionPool = new GenericObjectPool(null, usageMaxActive, GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION, usageMaxWait, usageMaxIdle); - final ConnectionFactory awsapiConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + ":" + cloudPort + "/" + awsapiDbName + - "?autoReconnect=" + usageAutoReconnect, cloudUsername, cloudPassword); + final ConnectionFactory awsapiConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + (s_dbHAEnabled ? "," + cloudSlaves : "") + ":" + cloudPort + "/" + awsapiDbName + + "?autoReconnect=" + cloudAutoReconnect + (s_dbHAEnabled ? "&" + cloudDbHAParams : ""), cloudUsername, cloudPassword); final PoolableConnectionFactory awsapiPoolableConnectionFactory = new PoolableConnectionFactory(awsapiConnectionFactory, awsapiConnectionPool, new StackKeyedObjectPoolFactory(), null, false, false); @@ -1160,7 +1167,19 @@ public class TransactionLegacy { s_logger.warn("Unable to load db configuration, using defaults with 5 connections. Falling back on assumed datasource on localhost:3306 using username:password=cloud:cloud. Please check your configuration", e); } } + + private static String getDBHAParams(String dbName,Properties dbProps) { + StringBuilder sb = new StringBuilder(); + sb.append("failOverReadOnly=" + dbProps.getProperty("db." + dbName + ".failOverReadOnly")); + sb.append("&").append("reconnectAtTxEnd=" + dbProps.getProperty("db." + dbName + ".reconnectAtTxEnd")); + sb.append("&").append("autoReconnectForPools=" + dbProps.getProperty("db." + dbName + ".autoReconnectForPools")); + sb.append("&").append("secondsBeforeRetryMaster=" + dbProps.getProperty("db." + dbName + ".secondsBeforeRetryMaster")); + sb.append("&").append("queriesBeforeRetryMaster=" + dbProps.getProperty("db." + dbName + ".queriesBeforeRetryMaster")); + sb.append("&").append("initialTimeout=" + dbProps.getProperty("db." + dbName + ".initialTimeout")); + return sb.toString(); + } + @SuppressWarnings({ "unchecked", "rawtypes" }) private static DataSource getDefaultDataSource(final String database) { final GenericObjectPool connectionPool = new GenericObjectPool(null, 5); final ConnectionFactory connectionFactory = new DriverManagerConnectionFactory( From 39c201a593f54752512ec9e7e65012de31f4d2ad Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Fri, 8 Nov 2013 22:53:36 +0530 Subject: [PATCH 096/108] Changes in hyperv agent to handle an add shared (SMB) storage pool command. ModifyStoragePoolCommand was updated to map (net use) the share and give an answer with the capacity details of the pool. --- .../HypervResourceController.cs | 124 +++++++++++++++--- .../ServerResource/HypervResource/Utils.cs | 25 +++- 2 files changed, 127 insertions(+), 22 deletions(-) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs index 6d5c599c2a3..0d56fef0acd 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs @@ -203,7 +203,7 @@ namespace HypervResource if (dataStore.nfsDataStoreTO != null) { NFSTO share = dataStore.nfsDataStoreTO; - Utils.connectToRemote(share.UncPath, share.Domain, share.User, share.Password); + Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password); // The share is mapped, now attach the iso string isoPath = Path.Combine(share.UncPath.Replace('/', Path.DirectorySeparatorChar), dataStore.path); @@ -763,23 +763,40 @@ namespace HypervResource logger.Info(CloudStackTypes.ModifyStoragePoolCommand + cmd.ToString()); string details = null; string localPath; + StoragePoolType poolType; object ansContent; - bool result = ValidateStoragePoolCommand(cmd, out localPath, ref details); + bool result = ValidateStoragePoolCommand(cmd, out localPath, out poolType, ref details); if (!result) { ansContent = new - { - result = result, - details = details - }; + { + result = result, + details = details + }; return ReturnCloudStackTypedJArray(ansContent, CloudStackTypes.Answer); } var tInfo = new Dictionary(); - long capacityBytes; - long availableBytes; - GetCapacityForLocalPath(localPath, out capacityBytes, out availableBytes); + long capacityBytes = 0; + long availableBytes = 0; + if (poolType == StoragePoolType.Filesystem) + { + GetCapacityForLocalPath(localPath, out capacityBytes, out availableBytes); + } + else if (poolType == StoragePoolType.NetworkFilesystem) + { + NFSTO share = new NFSTO(); + String uriStr = "cifs://" + (string)cmd.pool.host + (string)cmd.pool.path; + share.uri = new Uri(uriStr); + // Check access to share. + Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password); + Utils.GetShareDetails(share.UncPath, out capacityBytes, out availableBytes); + } + else + { + result = false; + } String uuid = null; var poolInfo = new @@ -794,34 +811,37 @@ namespace HypervResource }; ansContent = new - { - result = result, - details = details, - templateInfo = tInfo, - poolInfo = poolInfo - }; + { + result = result, + details = details, + templateInfo = tInfo, + poolInfo = poolInfo + }; + return ReturnCloudStackTypedJArray(ansContent, CloudStackTypes.ModifyStoragePoolAnswer); } } - private bool ValidateStoragePoolCommand(dynamic cmd, out string localPath, ref string details) + private bool ValidateStoragePoolCommand(dynamic cmd, out string localPath, out StoragePoolType poolType, ref string details) { dynamic pool = cmd.pool; string poolTypeStr = pool.type; - StoragePoolType poolType; localPath = cmd.localPath; - if (!Enum.TryParse(poolTypeStr, out poolType) || poolType != StoragePoolType.Filesystem) + if (!Enum.TryParse(poolTypeStr, out poolType)) { details = "Request to create / modify unsupported pool type: " + (poolTypeStr == null ? "NULL" : poolTypeStr) + "in cmd " + JsonConvert.SerializeObject(cmd); logger.Error(details); return false; } - if (!Directory.Exists(localPath)) + + if (poolType != StoragePoolType.Filesystem && + poolType != StoragePoolType.NetworkFilesystem) { - details = "Request to create / modify unsupported StoragePoolType.Filesystem with non-existent path:" + (localPath == null ? "NULL" : localPath) + "in cmd " + JsonConvert.SerializeObject(cmd); + details = "Request to create / modify unsupported pool type: " + (poolTypeStr == null ? "NULL" : poolTypeStr) + "in cmd " + JsonConvert.SerializeObject(cmd); logger.Error(details); return false; } + return true; } @@ -1385,6 +1405,70 @@ namespace HypervResource } } + // POST api/HypervResource/PrepareForMigrationCommand + [HttpPost] + [ActionName(CloudStackTypes.PrepareForMigrationCommand)] + public JContainer PrepareForMigrationCommand([FromBody]dynamic cmd) + { + using (log4net.NDC.Push(Guid.NewGuid().ToString())) + { + logger.Info(CloudStackTypes.PrepareForMigrationCommand + cmd.ToString()); + + string details = null; + bool result = false; + + try + { + details = "NOP - failure"; + } + catch (Exception sysEx) + { + details = CloudStackTypes.PrepareForMigrationCommand + " failed due to " + sysEx.Message; + logger.Error(details, sysEx); + } + + object ansContent = new + { + result = result, + details = details + }; + + return ReturnCloudStackTypedJArray(ansContent, CloudStackTypes.PrepareForMigrationAnswer); + } + } + + // POST api/HypervResource/MigrateCommand + [HttpPost] + [ActionName(CloudStackTypes.MigrateCommand)] + public JContainer MigrateCommand([FromBody]dynamic cmd) + { + using (log4net.NDC.Push(Guid.NewGuid().ToString())) + { + logger.Info(CloudStackTypes.MigrateCommand + cmd.ToString()); + + string details = null; + bool result = false; + + try + { + details = "NOP - failure"; + } + catch (Exception sysEx) + { + details = CloudStackTypes.MigrateCommand + " failed due to " + sysEx.Message; + logger.Error(details, sysEx); + } + + object ansContent = new + { + result = result, + details = details + }; + + return ReturnCloudStackTypedJArray(ansContent, CloudStackTypes.MigrateAnswer); + } + } + // POST api/HypervResource/StartupCommand [HttpPost] [ActionName(CloudStackTypes.StartupCommand)] diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs index cc2b6673fd6..0f7505d67d8 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs @@ -113,7 +113,7 @@ namespace HypervResource } } - public static void connectToRemote(string remoteUNC, string domain, string username, string password) + public static void ConnectToRemote(string remoteUNC, string domain, string username, string password) { NETRESOURCE nr = new NETRESOURCE(); nr.dwType = RESOURCETYPE_DISK; @@ -130,7 +130,7 @@ namespace HypervResource } } - public static void disconnectRemote(string remoteUNC) + public static void DisconnectRemote(string remoteUNC) { int ret = WNetCancelConnection2(remoteUNC, CONNECT_UPDATE_PROFILE, false); if (ret != NO_ERROR) @@ -139,6 +139,21 @@ namespace HypervResource } } + public static void GetShareDetails(string remoteUNC, out long capacity, out long available) + { + ulong freeBytesAvailable; + ulong totalNumberOfBytes; + ulong totalNumberOfFreeBytes; + + if (!GetDiskFreeSpaceEx(remoteUNC, out freeBytesAvailable, out totalNumberOfBytes, out totalNumberOfFreeBytes)) + { + throw new ArgumentException("Not able to retrieve the capcity details of the share " + remoteUNC); + } + + available = freeBytesAvailable > 0 ? (long)freeBytesAvailable : 0; + capacity = totalNumberOfBytes > 0 ? (long)totalNumberOfBytes : 0; + } + // from http://stackoverflow.com/a/2541569/939250 #region imports [DllImport("advapi32.dll", SetLastError = true)] @@ -156,6 +171,12 @@ namespace HypervResource [DllImport("Mpr.dll")] private static extern int WNetCancelConnection2(string lpName, int dwFlags, bool fForce); + + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + private static extern bool GetDiskFreeSpaceEx(string lpDirectoryName, + out ulong lpFreeBytesAvailable, + out ulong lpTotalNumberOfBytes, + out ulong lpTotalNumberOfFreeBytes); #endregion #region consts From c7fe212c3bdffc5a9ecbdafb026bb493603d22aa Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Fri, 8 Nov 2013 16:33:43 +0530 Subject: [PATCH 097/108] CLOUDSTACK-5099: Utils.py-has-wrong-reference, cleaned it. As well added Uniform naming convention Signed-off-by: SrikanteswaraRao Talluri --- .../test_egress_rules_host_maintenance.py | 2 +- .../component/maint/test_high_availability.py | 2 +- .../maint/test_vpc_host_maintenance.py | 2 +- test/integration/component/test_accounts.py | 2 +- .../component/test_affinity_groups.py | 2 +- .../integration/component/test_asa1000v_fw.py | 2 +- test/integration/component/test_baremetal.py | 2 +- .../component/test_deploy_vm_userdata_reg.py | 2 +- .../component/test_egress_fw_rules.py | 4 +-- .../component/test_egress_rules.py | 2 +- test/integration/component/test_eip_elb.py | 18 +++++------ .../component/test_explicit_dedication.py | 2 +- test/integration/component/test_haproxy.py | 4 +-- .../component/test_implicit_planner.py | 2 +- .../component/test_netscaler_configs.py | 16 +++++----- .../component/test_netscaler_lb.py | 20 ++++++------ .../component/test_netscaler_lb_algo.py | 32 +++++++++---------- .../component/test_netscaler_lb_sticky.py | 20 ++++++------ .../component/test_netscaler_nw_off.py | 2 +- .../component/test_network_offering.py | 2 +- .../integration/component/test_portable_ip.py | 6 ++-- .../component/test_project_configs.py | 2 +- .../component/test_project_resources.py | 2 +- .../component/test_project_usage.py | 2 +- test/integration/component/test_projects.py | 2 +- .../component/test_security_groups.py | 6 ++-- .../component/test_snapshot_limits.py | 2 +- test/integration/component/test_stopped_vm.py | 2 +- .../component/test_storage_motion.py | 2 +- test/integration/component/test_templates.py | 2 +- test/integration/component/test_usage.py | 2 +- .../component/test_vm_passwdenabled.py | 2 +- .../integration/component/test_vpc_network.py | 2 +- .../component/test_vpc_offerings.py | 2 +- .../integration/component/test_vpc_routers.py | 2 +- .../component/test_vpc_vm_life_cycle.py | 2 +- .../component/test_vpc_vms_deployment.py | 2 +- .../integration/smoke/test_affinity_groups.py | 2 +- test/integration/smoke/test_loadbalance.py | 4 +-- test/integration/smoke/test_network.py | 10 +++--- test/integration/smoke/test_nic.py | 2 +- test/integration/smoke/test_pvlan.py | 2 +- .../integration/smoke/test_resource_detail.py | 2 +- test/integration/smoke/test_routers.py | 2 +- test/integration/smoke/test_ssvm.py | 2 +- test/integration/smoke/test_templates.py | 2 +- test/integration/smoke/test_volumes.py | 2 +- tools/marvin/marvin/integration/lib/utils.py | 6 ++-- .../{remoteSSHClient.py => sshClient.py} | 10 +++--- 49 files changed, 114 insertions(+), 114 deletions(-) rename tools/marvin/marvin/{remoteSSHClient.py => sshClient.py} (96%) diff --git a/test/integration/component/maint/test_egress_rules_host_maintenance.py b/test/integration/component/maint/test_egress_rules_host_maintenance.py index 6f0f768d37c..2b817879c4b 100644 --- a/test/integration/component/maint/test_egress_rules_host_maintenance.py +++ b/test/integration/component/maint/test_egress_rules_host_maintenance.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/maint/test_high_availability.py b/test/integration/component/maint/test_high_availability.py index 7b0f78e2446..6ada659cd4f 100644 --- a/test/integration/component/maint/test_high_availability.py +++ b/test/integration/component/maint/test_high_availability.py @@ -26,7 +26,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/maint/test_vpc_host_maintenance.py b/test/integration/component/maint/test_vpc_host_maintenance.py index 0946cebdb7e..57dfb4be8d0 100644 --- a/test/integration/component/maint/test_vpc_host_maintenance.py +++ b/test/integration/component/maint/test_vpc_host_maintenance.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index 4c73c3acc84..650a595936e 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -22,7 +22,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from nose.plugins.attrib import attr from marvin.cloudstackException import cloudstackAPIException diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py index ae53e399df9..7e4fabe5475 100644 --- a/test/integration/component/test_affinity_groups.py +++ b/test/integration/component/test_affinity_groups.py @@ -20,7 +20,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from nose.plugins.attrib import attr class Services: diff --git a/test/integration/component/test_asa1000v_fw.py b/test/integration/component/test_asa1000v_fw.py index 0d8cad09802..c8a11ab1701 100644 --- a/test/integration/component/test_asa1000v_fw.py +++ b/test/integration/component/test_asa1000v_fw.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_baremetal.py b/test/integration/component/test_baremetal.py index c6a877eca6e..2439d0d2132 100644 --- a/test/integration/component/test_baremetal.py +++ b/test/integration/component/test_baremetal.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_deploy_vm_userdata_reg.py b/test/integration/component/test_deploy_vm_userdata_reg.py index ca9179d77d2..b282a860816 100755 --- a/test/integration/component/test_deploy_vm_userdata_reg.py +++ b/test/integration/component/test_deploy_vm_userdata_reg.py @@ -23,7 +23,7 @@ from marvin.integration.lib.base import * from marvin.integration.lib.utils import * from marvin.integration.lib.common import * from nose.plugins.attrib import attr -from marvin import remoteSSHClient +from marvin.sshClient import SshClient import unittest import random import string diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py index 253cc46cab9..0aed95742ec 100644 --- a/test/integration/component/test_egress_fw_rules.py +++ b/test/integration/component/test_egress_fw_rules.py @@ -39,7 +39,7 @@ from marvin.integration.lib.common import (get_domain, from marvin.cloudstackAPI.createEgressFirewallRule import createEgressFirewallRuleCmd from marvin.cloudstackAPI.deleteEgressFirewallRule import deleteEgressFirewallRuleCmd -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import time class Services: @@ -270,7 +270,7 @@ class TestEgressFWRules(cloudstackTestCase): fd.write(expect_script) fd.close() - ssh = remoteSSHClient(host=sourceip, + ssh = SshClient(host=sourceip, port=22, user='root', passwd=self.services["host_password"]) diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py index f8e8e790248..34995ffd1a0 100644 --- a/test/integration/component/test_egress_rules.py +++ b/test/integration/component/test_egress_rules.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_eip_elb.py b/test/integration/component/test_eip_elb.py index 42a5148762e..d639d82d9f5 100644 --- a/test/integration/component/test_eip_elb.py +++ b/test/integration/component/test_eip_elb.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -314,7 +314,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -458,7 +458,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -657,7 +657,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -871,7 +871,7 @@ class TestEIP(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1138,7 +1138,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1287,7 +1287,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1366,7 +1366,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -1512,7 +1512,7 @@ class TestELB(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], diff --git a/test/integration/component/test_explicit_dedication.py b/test/integration/component/test_explicit_dedication.py index bd97551b5c6..7aefc21a1fb 100644 --- a/test/integration/component/test_explicit_dedication.py +++ b/test/integration/component/test_explicit_dedication.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_haproxy.py b/test/integration/component/test_haproxy.py index 799cfa3e925..c7340126b36 100644 --- a/test/integration/component/test_haproxy.py +++ b/test/integration/component/test_haproxy.py @@ -38,7 +38,7 @@ from marvin.integration.lib.common import (get_domain, random_gen ) from marvin.cloudstackAPI import createLBStickinessPolicy -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient class Services: @@ -383,7 +383,7 @@ class TestHAProxyStickyness(cloudstackTestCase): # If Round Robin Algorithm is chosen, # each ssh command should alternate between VMs - ssh_1 = remoteSSHClient( + ssh_1 = SshClient( ip_addr, 22, self.services["natrule"]["username"], diff --git a/test/integration/component/test_implicit_planner.py b/test/integration/component/test_implicit_planner.py index f233ba9791e..2b656d9f2c6 100644 --- a/test/integration/component/test_implicit_planner.py +++ b/test/integration/component/test_implicit_planner.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_netscaler_configs.py b/test/integration/component/test_netscaler_configs.py index c10f6882334..98c47485e34 100644 --- a/test/integration/component/test_netscaler_configs.py +++ b/test/integration/component/test_netscaler_configs.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -1745,7 +1745,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1891,7 +1891,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2051,7 +2051,7 @@ class TestGuestNetworkWithNetScaler(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2249,7 +2249,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2334,7 +2334,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2396,7 +2396,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2458,7 +2458,7 @@ class TestGuestNetworkShutDown(cloudstackTestCase): listall=True ) nw = network_list[0] - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb.py b/test/integration/component/test_netscaler_lb.py index 4b380e904e1..5a8d6a4f6b5 100644 --- a/test/integration/component/test_netscaler_lb.py +++ b/test/integration/component/test_netscaler_lb.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -1228,7 +1228,7 @@ class TestAddMultipleVmsLb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], 22, self.services["netscaler"]["username"], @@ -2104,7 +2104,7 @@ class TestLoadBalancingRule(cloudstackTestCase): self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2430,7 +2430,7 @@ class TestVmWithLb(cloudstackTestCase): ) self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2523,7 +2523,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2596,7 +2596,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2709,7 +2709,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2797,7 +2797,7 @@ class TestVmWithLb(cloudstackTestCase): e)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2880,7 +2880,7 @@ class TestVmWithLb(cloudstackTestCase): time.sleep(int(delay[0].value) + int(wait[0].value)) self.debug("SSH into Netscaler to rules still persist") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -2936,7 +2936,7 @@ class TestVmWithLb(cloudstackTestCase): ) self.debug("SSH into Netscaler to verify other resources are deleted") try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb_algo.py b/test/integration/component/test_netscaler_lb_algo.py index 4df7b897a5b..a5e1fe80b7b 100644 --- a/test/integration/component/test_netscaler_lb_algo.py +++ b/test/integration/component/test_netscaler_lb_algo.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -300,7 +300,7 @@ class TestLbWithRoundRobin(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -524,7 +524,7 @@ class TestLbWithLeastConn(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -739,7 +739,7 @@ class TestLbWithSourceIp(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -912,7 +912,7 @@ class TestLbAlgoRrLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -945,7 +945,7 @@ class TestLbAlgoRrLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1115,7 +1115,7 @@ class TestLbAlgoLcRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1147,7 +1147,7 @@ class TestLbAlgoLcRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1318,7 +1318,7 @@ class TestLbAlgoRrSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1351,7 +1351,7 @@ class TestLbAlgoRrSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1526,7 +1526,7 @@ class TestLbAlgoSbRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1560,7 +1560,7 @@ class TestLbAlgoSbRr(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1734,7 +1734,7 @@ class TestLbAlgoSbLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1767,7 +1767,7 @@ class TestLbAlgoSbLc(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1939,7 +1939,7 @@ class TestLbAlgoLcSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -1972,7 +1972,7 @@ class TestLbAlgoLcSb(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_lb_sticky.py b/test/integration/component/test_netscaler_lb_sticky.py index 56964a9fd9e..6c27a08052a 100644 --- a/test/integration/component/test_netscaler_lb_sticky.py +++ b/test/integration/component/test_netscaler_lb_sticky.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime @@ -267,7 +267,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -356,7 +356,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -445,7 +445,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -536,7 +536,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -627,7 +627,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -718,7 +718,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -809,7 +809,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -900,7 +900,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], @@ -991,7 +991,7 @@ class TestLbStickyPolicy(cloudstackTestCase): self.debug("SSH into netscaler: %s" % self.services["netscaler"]["ipaddress"]) try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( self.services["netscaler"]["ipaddress"], self.services["netscaler"]["port"], self.services["netscaler"]["username"], diff --git a/test/integration/component/test_netscaler_nw_off.py b/test/integration/component/test_netscaler_nw_off.py index b94d47ea164..3372612abab 100644 --- a/test/integration/component/test_netscaler_nw_off.py +++ b/test/integration/component/test_netscaler_nw_off.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 335f8592ff0..04777b0c2a8 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index 917e7f2d1a9..a532b362751 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -23,7 +23,7 @@ from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * from netaddr import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from nose.plugins.attrib import attr @@ -808,7 +808,7 @@ class TestAssociatePublicIp(cloudstackTestCase): self.debug("Trying to SSH to ip: %s" % portableip.ipaddress.ipaddress) - remoteSSHClient( + SshClient( portableip.ipaddress.ipaddress, self.services['natrule']["publicport"], self.virtual_machine.username, @@ -1533,7 +1533,7 @@ class TestPortableIpTransferAcrossNetworks(cloudstackTestCase): self.debug("Trying to SSH to ip: %s" % portableip.ipaddress.ipaddress) - remoteSSHClient( + SshClient( portableip.ipaddress.ipaddress, self.services['natrule']["publicport"], self.virtual_machine2.username, diff --git a/test/integration/component/test_project_configs.py b/test/integration/component/test_project_configs.py index a9654c82f57..be6cf1ce279 100644 --- a/test/integration/component/test_project_configs.py +++ b/test/integration/component/test_project_configs.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index 131a9e21050..9b9b2e6ac2e 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index e836768591b..ba0a63c97e8 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index e4c2180dd42..4b82fc2639c 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index 5ec3ffb00d5..c90ccf6ee28 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient #Import System modules import time @@ -361,7 +361,7 @@ class TestDefaultSecurityGroup(cloudstackTestCase): # SSH Attempt to VM should fail with self.assertRaises(Exception): self.debug("SSH into VM: %s" % self.virtual_machine.ssh_ip) - ssh = remoteSSHClient.remoteSSHClient( + ssh = SshClient( self.virtual_machine.ssh_ip, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -656,7 +656,7 @@ class TestRevokeIngressRule(cloudstackTestCase): # SSH Attempt to VM should fail with self.assertRaises(Exception): self.debug("SSH into VM: %s" % self.virtual_machine.id) - remoteSSHClient.remoteSSHClient( + SshClient( self.virtual_machine.ssh_ip, self.virtual_machine.ssh_port, self.virtual_machine.username, diff --git a/test/integration/component/test_snapshot_limits.py b/test/integration/component/test_snapshot_limits.py index 2af77c3923d..e52a893587c 100644 --- a/test/integration/component/test_snapshot_limits.py +++ b/test/integration/component/test_snapshot_limits.py @@ -21,7 +21,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import is_snapshot_on_nfs import os diff --git a/test/integration/component/test_stopped_vm.py b/test/integration/component/test_stopped_vm.py index 3be915166ee..5a5c2981e2f 100644 --- a/test/integration/component/test_stopped_vm.py +++ b/test/integration/component/test_stopped_vm.py @@ -22,7 +22,7 @@ import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_storage_motion.py b/test/integration/component/test_storage_motion.py index 36376f373bc..bae5acf5514 100644 --- a/test/integration/component/test_storage_motion.py +++ b/test/integration/component/test_storage_motion.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_templates.py b/test/integration/component/test_templates.py index ea4b27755ca..af86d32a3bd 100644 --- a/test/integration/component/test_templates.py +++ b/test/integration/component/test_templates.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import urllib from random import random #Import System modules diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 75326f70a75..5979a0a495c 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -24,7 +24,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_vm_passwdenabled.py b/test/integration/component/test_vm_passwdenabled.py index a6b45acc9d9..5cfa52556f7 100644 --- a/test/integration/component/test_vm_passwdenabled.py +++ b/test/integration/component/test_vm_passwdenabled.py @@ -17,7 +17,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/component/test_vpc_network.py b/test/integration/component/test_vpc_network.py index b9b4f0049f6..9f5e6f623f0 100644 --- a/test/integration/component/test_vpc_network.py +++ b/test/integration/component/test_vpc_network.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime # For more info on ddt refer to http://ddt.readthedocs.org/en/latest/api.html#module-ddt from ddt import ddt, data diff --git a/test/integration/component/test_vpc_offerings.py b/test/integration/component/test_vpc_offerings.py index 109c8d13687..4f5802285f2 100644 --- a/test/integration/component/test_vpc_offerings.py +++ b/test/integration/component/test_vpc_offerings.py @@ -26,7 +26,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_vpc_routers.py b/test/integration/component/test_vpc_routers.py index 9b772e41c67..8ed99ca3c36 100644 --- a/test/integration/component/test_vpc_routers.py +++ b/test/integration/component/test_vpc_routers.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/component/test_vpc_vm_life_cycle.py b/test/integration/component/test_vpc_vm_life_cycle.py index 5893cc35bc5..cc65eedff8a 100644 --- a/test/integration/component/test_vpc_vm_life_cycle.py +++ b/test/integration/component/test_vpc_vm_life_cycle.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.codes import PASS import time diff --git a/test/integration/component/test_vpc_vms_deployment.py b/test/integration/component/test_vpc_vms_deployment.py index b01137b1ccd..ebf3b317d2b 100644 --- a/test/integration/component/test_vpc_vms_deployment.py +++ b/test/integration/component/test_vpc_vms_deployment.py @@ -25,7 +25,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient import datetime diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py index db11adabe16..c96a580f199 100644 --- a/test/integration/smoke/test_affinity_groups.py +++ b/test/integration/smoke/test_affinity_groups.py @@ -21,7 +21,7 @@ from marvin.cloudstackAPI import * from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from nose.plugins.attrib import attr class Services: diff --git a/test/integration/smoke/test_loadbalance.py b/test/integration/smoke/test_loadbalance.py index 3e48158442a..5f80c38303a 100644 --- a/test/integration/smoke/test_loadbalance.py +++ b/test/integration/smoke/test_loadbalance.py @@ -17,7 +17,7 @@ from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * @@ -197,7 +197,7 @@ class TestLoadBalance(cloudstackTestCase): # If Round Robin Algorithm is chosen, # each ssh command should alternate between VMs - ssh_1 = remoteSSHClient( + ssh_1 = SshClient( ip_addr, self.services['lbrule']["publicport"], self.vm_1.username, diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index f2045959697..09d6437cd86 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -21,7 +21,7 @@ import marvin from marvin.cloudstackException import cloudstackAPIException from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * @@ -460,7 +460,7 @@ class TestPortForwarding(cloudstackTestCase): "SSHing into VM with IP address %s after NAT rule deletion" % self.virtual_machine.ipaddress) - remoteSSHClient( + SshClient( src_nat_ip_addr.ipaddress, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -578,7 +578,7 @@ class TestPortForwarding(cloudstackTestCase): "SSHing into VM with IP address %s after NAT rule deletion" % self.virtual_machine.ipaddress) - remoteSSHClient( + SshClient( ip_address.ipaddress.ipaddress, self.virtual_machine.ssh_port, self.virtual_machine.username, @@ -741,7 +741,7 @@ class TestRebootRouter(cloudstackTestCase): try: self.debug("SSH into VM (ID : %s ) after reboot" % self.vm_1.id) - remoteSSHClient( + SshClient( self.public_ip.ipaddress.ipaddress, self.services["natrule"]["publicport"], self.vm_1.username, @@ -883,7 +883,7 @@ class TestReleaseIP(cloudstackTestCase): # SSH Attempt though public IP should fail with self.assertRaises(Exception): - ssh_2 = remoteSSHClient( + ssh_2 = SshClient( self.ip_addr.ipaddress, self.services["natrule"]["publicport"], self.virtual_machine.username, diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py index 583fc29c2c1..ac95685f37a 100644 --- a/test/integration/smoke/test_nic.py +++ b/test/integration/smoke/test_nic.py @@ -18,7 +18,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py index 0a427ba229d..aeb47f953c4 100644 --- a/test/integration/smoke/test_pvlan.py +++ b/test/integration/smoke/test_pvlan.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_resource_detail.py b/test/integration/smoke/test_resource_detail.py index 93bc2ffc1f1..00a7b5c4171 100644 --- a/test/integration/smoke/test_resource_detail.py +++ b/test/integration/smoke/test_resource_detail.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index 0f32e274338..7d324136e89 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index 9fa59a94d3f..a2b9eabc13c 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index 9478440f77e..e371ad436a8 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index b60b70e86ed..816ae03f267 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -21,7 +21,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackException import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.integration.lib.utils import * from marvin.integration.lib.base import * from marvin.integration.lib.common import * diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index 58a9bf9ae99..a106fc0e2f8 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -118,7 +118,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin @Name: is_server_ssh_ready @Input: timeout: tcp connection timeout flag, others information need to be added - @Output:object for remoteSSHClient + @Output:object for SshClient Name of the function is little misnomer and is not verifying anything as such mentioned ''' @@ -129,12 +129,12 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin port=port, user=username, passwd=password, - keyPairFileLocation=keyPairFileLocation, + keyPairFiles=keyPairFileLocation, retries=retries, delay=retryinterv, timeout=timeout) except Exception, e: - raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, e)) + raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, str(e))) else: return ssh diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/sshClient.py similarity index 96% rename from tools/marvin/marvin/remoteSSHClient.py rename to tools/marvin/marvin/sshClient.py index c9720e39e40..58f2602107b 100644 --- a/tools/marvin/marvin/remoteSSHClient.py +++ b/tools/marvin/marvin/sshClient.py @@ -26,7 +26,7 @@ from marvin.codes import ( from contextlib import closing -class remoteSSHClient(object): +class SshClient(object): ''' Added timeout flag for ssh connect calls.Default to 3.0 seconds ''' @@ -92,9 +92,9 @@ class remoteSSHClient(object): while self.retryCnt >= 0: try: self.logger.debug("SSH Connection: Host:%s User:%s\ - Port:%s KeyPairFile: %s" % - (self.host, self.user, str(self.port), - str(self.keyPairFiles))) + Port:%s" % + (self.host, self.user, str(self.port) + )) if self.keyPairFiles is None: self.ssh.connect(hostname=self.host, port=self.port, @@ -177,6 +177,6 @@ class remoteSSHClient(object): if __name__ == "__main__": - with contextlib.closing(remoteSSHClient("10.223.75.10", 22, "root", + with contextlib.closing(SshClient("10.223.75.10", 22, "root", "password")) as ssh: print ssh.execute("ls -l") From 07b68742c970049aaef1459f51425c5f7d6abcad Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Fri, 8 Nov 2013 16:44:32 +0530 Subject: [PATCH 098/108] CLOUDSTACK-4916: removing spurious comments --- client/tomcatconf/db.properties.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/tomcatconf/db.properties.in b/client/tomcatconf/db.properties.in index 50b8d334136..31e08033370 100644 --- a/client/tomcatconf/db.properties.in +++ b/client/tomcatconf/db.properties.in @@ -86,9 +86,9 @@ db.simulator.autoReconnect=true # High Availability And Cluster Properties db.ha.enabled=false # cloud stack Database -db.cloud.slaves=localhost,localhost #Comma Separated list of slaves +db.cloud.slaves=localhost,localhost db.cloud.autoReconnect=true -db.cloud.failOverReadOnly=false #Do not change this parameter to true +db.cloud.failOverReadOnly=false db.cloud.reconnectAtTxEnd=true db.cloud.autoReconnectForPools=true db.cloud.secondsBeforeRetryMaster=3600 @@ -96,9 +96,9 @@ db.cloud.queriesBeforeRetryMaster=5000 db.cloud.initialTimeout=3600 #usage Database -db.usage.slaves=localhost,localhost #Comma Separated list of slaves +db.usage.slaves=localhost,localhost db.usage.autoReconnect=true -db.usage.failOverReadOnly=false #Do not change this parameter to true +db.usage.failOverReadOnly=false db.usage.reconnectAtTxEnd=true db.usage.autoReconnectForPools=true db.usage.secondsBeforeRetryMaster=3600 From 0076307863e9155273d9e4c14282de429388c9e9 Mon Sep 17 00:00:00 2001 From: Syed Date: Wed, 6 Nov 2013 15:08:42 -0500 Subject: [PATCH 099/108] Squashed merge of Ssl Termination feature Bug: https://issues.apache.org/jira/browse/CLOUDSTACK-4821 FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/SSL+Termination+Support This patch implements the SSL offload feature for loadbalancers and includes the implementaion for this to work with Netscaler. The following are the new API's that this patch adds uploadSslCert deleteSslCert listSslCert assignCertToLoadBalancer removeCertFromLoadBalancer Unit tests are also included in the patch. --- CHANGES | 1 + .../cloud/agent/api/to/LoadBalancerTO.java | 23 +- api/src/com/cloud/event/EventTypes.java | 8 + api/src/com/cloud/network/Network.java | 1 + api/src/com/cloud/network/lb/CertService.java | 32 + .../cloud/network/lb/LoadBalancingRule.java | 61 +- .../network/lb/LoadBalancingRulesService.java | 8 +- api/src/com/cloud/network/lb/SslCert.java | 16 + .../apache/cloudstack/api/ApiConstants.java | 3 + .../AssignCertToLoadBalancerCmd.java | 92 ++ .../CreateLoadBalancerRuleCmd.java | 9 +- .../user/loadbalancer/DeleteSslCertCmd.java | 83 ++ .../user/loadbalancer/ListSslCertsCmd.java | 106 +++ .../RemoveCertFromLoadBalancerCmd.java | 82 ++ .../user/loadbalancer/UploadSslCertCmd.java | 103 +++ .../api/response/SslCertResponse.java | 90 ++ client/tomcatconf/commands.properties.in | 8 + .../routing/LoadBalancerConfigCommand.java | 1 + .../network/lb/LoadBalancingRulesManager.java | 5 +- ...spring-engine-schema-core-daos-context.xml | 2 + .../network/dao/LoadBalancerCertMapDao.java | 29 + .../dao/LoadBalancerCertMapDaoImpl.java | 79 ++ .../network/dao/LoadBalancerCertMapVO.java | 96 +++ .../com/cloud/network/dao/LoadBalancerVO.java | 16 +- .../src/com/cloud/network/dao/SslCertDao.java | 27 + .../com/cloud/network/dao/SslCertDaoImpl.java | 31 + .../src/com/cloud/network/dao/SslCertVO.java | 132 +++ .../lb/ElasticLoadBalancerManagerImpl.java | 10 +- .../lb/InternalLoadBalancerVMManagerImpl.java | 1 + .../InternalLBVMManagerTest.java | 8 +- .../network/element/NetscalerElement.java | 14 +- .../network/resource/NetscalerResource.java | 259 +++++- .../spring-server-core-managers-context.xml | 2 + ...ExternalLoadBalancerDeviceManagerImpl.java | 6 +- .../lb/LoadBalancingRulesManagerImpl.java | 200 ++++- .../VirtualNetworkApplianceManagerImpl.java | 12 +- .../cloud/server/ManagementServerImpl.java | 10 + .../ApplicationLoadBalancerManagerImpl.java | 2 +- .../network/lb/CertServiceImpl.java | 477 +++++++++++ .../lb/ApplicationLoadBalancerTest.java | 5 +- .../network/lb/CertServiceTest.java | 791 ++++++++++++++++++ .../test/resources/certs/bad_format_cert.crt | 1 + .../test/resources/certs/dsa_self_signed.crt | 26 + .../test/resources/certs/dsa_self_signed.key | 20 + server/test/resources/certs/expired_cert.crt | 20 + server/test/resources/certs/non_x509_pem.crt | 17 + server/test/resources/certs/root_chain.crt | 22 + server/test/resources/certs/rsa_ca_signed.crt | 23 + server/test/resources/certs/rsa_ca_signed.key | 30 + .../test/resources/certs/rsa_ca_signed2.crt | 23 + .../test/resources/certs/rsa_ca_signed2.key | 30 + .../test/resources/certs/rsa_random_pkey.key | 28 + .../test/resources/certs/rsa_self_signed.crt | 19 + .../test/resources/certs/rsa_self_signed.key | 27 + .../certs/rsa_self_signed_with_pwd.crt | 19 + .../certs/rsa_self_signed_with_pwd.key | 30 + setup/db/db/schema-421to430.sql | 28 + utils/src/com/cloud/utils/net/NetUtils.java | 3 + 58 files changed, 3265 insertions(+), 42 deletions(-) create mode 100644 api/src/com/cloud/network/lb/CertService.java create mode 100644 api/src/com/cloud/network/lb/SslCert.java create mode 100644 api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java create mode 100644 api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteSslCertCmd.java create mode 100644 api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListSslCertsCmd.java create mode 100644 api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveCertFromLoadBalancerCmd.java create mode 100644 api/src/org/apache/cloudstack/api/command/user/loadbalancer/UploadSslCertCmd.java create mode 100644 api/src/org/apache/cloudstack/api/response/SslCertResponse.java create mode 100644 engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapDao.java create mode 100644 engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapDaoImpl.java create mode 100644 engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapVO.java create mode 100644 engine/schema/src/com/cloud/network/dao/SslCertDao.java create mode 100644 engine/schema/src/com/cloud/network/dao/SslCertDaoImpl.java create mode 100644 engine/schema/src/com/cloud/network/dao/SslCertVO.java create mode 100644 server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java rename server/test/org/apache/cloudstack/{ => network}/lb/ApplicationLoadBalancerTest.java (99%) create mode 100644 server/test/org/apache/cloudstack/network/lb/CertServiceTest.java create mode 100644 server/test/resources/certs/bad_format_cert.crt create mode 100644 server/test/resources/certs/dsa_self_signed.crt create mode 100644 server/test/resources/certs/dsa_self_signed.key create mode 100644 server/test/resources/certs/expired_cert.crt create mode 100644 server/test/resources/certs/non_x509_pem.crt create mode 100644 server/test/resources/certs/root_chain.crt create mode 100644 server/test/resources/certs/rsa_ca_signed.crt create mode 100644 server/test/resources/certs/rsa_ca_signed.key create mode 100644 server/test/resources/certs/rsa_ca_signed2.crt create mode 100644 server/test/resources/certs/rsa_ca_signed2.key create mode 100644 server/test/resources/certs/rsa_random_pkey.key create mode 100644 server/test/resources/certs/rsa_self_signed.crt create mode 100644 server/test/resources/certs/rsa_self_signed.key create mode 100644 server/test/resources/certs/rsa_self_signed_with_pwd.crt create mode 100644 server/test/resources/certs/rsa_self_signed_with_pwd.key diff --git a/CHANGES b/CHANGES index 054e7b06615..e3e316e9dc9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,4 @@ + Apache CloudStack CHANGES ====================================== diff --git a/api/src/com/cloud/agent/api/to/LoadBalancerTO.java b/api/src/com/cloud/agent/api/to/LoadBalancerTO.java index df2f8a87490..4caa1b2f85c 100644 --- a/api/src/com/cloud/agent/api/to/LoadBalancerTO.java +++ b/api/src/com/cloud/agent/api/to/LoadBalancerTO.java @@ -33,6 +33,7 @@ import com.cloud.network.lb.LoadBalancingRule.LbCondition; import com.cloud.network.lb.LoadBalancingRule.LbDestination; import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy; import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy; +import com.cloud.network.lb.LoadBalancingRule.LbSslCert; import com.cloud.utils.Pair; @@ -41,6 +42,7 @@ public class LoadBalancerTO { String srcIp; int srcPort; String protocol; + String lbProtocol; String algorithm; boolean revoked; boolean alreadyAdded; @@ -48,6 +50,7 @@ public class LoadBalancerTO { DestinationTO[] destinations; private StickinessPolicyTO[] stickinessPolicies; private HealthCheckPolicyTO[] healthCheckPolicies; + private LbSslCert sslCert; /* XXX: Should this be SslCertTO? */ private AutoScaleVmGroupTO autoScaleVmGroupTO; final static int MAX_STICKINESS_POLICIES = 1; final static int MAX_HEALTHCHECK_POLICIES = 1; @@ -66,6 +69,8 @@ public class LoadBalancerTO { this.inline = inline; this.destinations = new DestinationTO[destinations.size()]; this.stickinessPolicies = null; + this.sslCert = null; + this.lbProtocol = null; int i = 0; for (LbDestination destination : destinations) { this.destinations[i++] = new DestinationTO(destination.getIpAddress(), destination.getDestinationPortStart(), destination.isRevoked(), false); @@ -77,12 +82,12 @@ public class LoadBalancerTO { List stickinessPolicies) { this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, inline, arg_destinations, - stickinessPolicies, null); + stickinessPolicies, null, null, null); } public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, List arg_destinations, - List stickinessPolicies, List healthCheckPolicies) { + List stickinessPolicies, List healthCheckPolicies, LbSslCert sslCert, String lbProtocol) { this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, inline, arg_destinations); this.stickinessPolicies = null; this.healthCheckPolicies = null; @@ -117,6 +122,9 @@ public class LoadBalancerTO { if (index == 0) this.healthCheckPolicies = null; } + + this.sslCert = sslCert; + this.lbProtocol = lbProtocol; } protected LoadBalancerTO() { @@ -142,6 +150,10 @@ public class LoadBalancerTO { return protocol; } + public String getLbProtocol() { + return lbProtocol; + } + public boolean isRevoked() { return revoked; } @@ -178,6 +190,10 @@ public class LoadBalancerTO { return this.autoScaleVmGroupTO != null; } + public LbSslCert getSslCert(){ + return this.sslCert; + } + public static class StickinessPolicyTO { private String _methodName; private List> _paramsList; @@ -294,6 +310,8 @@ public class LoadBalancerTO { public String getMonitorState() { return monitorState; } + + } public static class CounterTO implements Serializable { private final String name; @@ -558,5 +576,4 @@ public class LoadBalancerTO { autoScaleVmGroupTO = new AutoScaleVmGroupTO(autoScaleVmGroup.getUuid(), autoScaleVmGroup.getMinMembers(), autoScaleVmGroup.getMaxMembers(), autoScaleVmGroup.getMemberPort(), autoScaleVmGroup.getInterval(), autoScalePolicyTOs, autoScaleVmProfileTO, autoScaleVmGroup.getState(), lbAutoScaleVmGroup.getCurrentState()); } - } diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java index d9f80eb2a2c..a3e45fadce2 100755 --- a/api/src/com/cloud/event/EventTypes.java +++ b/api/src/com/cloud/event/EventTypes.java @@ -133,6 +133,10 @@ public class EventTypes { public static final String EVENT_LB_HEALTHCHECKPOLICY_CREATE = "LB.HEALTHCHECKPOLICY.CREATE"; public static final String EVENT_LB_HEALTHCHECKPOLICY_DELETE = "LB.HEALTHCHECKPOLICY.DELETE"; public static final String EVENT_LOAD_BALANCER_UPDATE = "LB.UPDATE"; + public static final String EVENT_LB_CERT_UPLOAD = "LB.CERT.UPLOAD"; + public static final String EVENT_LB_CERT_DELETE = "LB.CERT.DELETE"; + public static final String EVENT_LB_CERT_ASSIGN = "LB.CERT.ASSIGN"; + public static final String EVENT_LB_CERT_REMOVE = "LB.CERT.REMOVE"; // Global Load Balancer rules public static final String EVENT_ASSIGN_TO_GLOBAL_LOAD_BALANCER_RULE = "GLOBAL.LB.ASSIGN"; @@ -511,6 +515,10 @@ public class EventTypes { entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_CREATE, LoadBalancer.class.getName()); entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_DELETE, LoadBalancer.class.getName()); entityEventDetails.put(EVENT_LOAD_BALANCER_UPDATE, LoadBalancer.class.getName()); + entityEventDetails.put(EVENT_LB_CERT_UPLOAD, LoadBalancer.class.getName()); + entityEventDetails.put(EVENT_LB_CERT_DELETE, LoadBalancer.class.getName()); + entityEventDetails.put(EVENT_LB_CERT_ASSIGN, LoadBalancer.class.getName()); + entityEventDetails.put(EVENT_LB_CERT_REMOVE, LoadBalancer.class.getName()); // Account events entityEventDetails.put(EVENT_ACCOUNT_DISABLE, Account.class.getName()); diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java index 318ac192252..4eadd61aa25 100644 --- a/api/src/com/cloud/network/Network.java +++ b/api/src/com/cloud/network/Network.java @@ -181,6 +181,7 @@ public interface Network extends ControlledEntity, StateObject, I public static final Capability SupportedTrafficDirection = new Capability("SupportedTrafficDirection"); public static final Capability SupportedEgressProtocols = new Capability("SupportedEgressProtocols"); public static final Capability HealthCheckPolicy = new Capability("HealthCheckPolicy"); + public static final Capability SslTermination = new Capability("SslTermination"); public static final Capability LbSchemes = new Capability("LbSchemes"); public static final Capability DhcpAccrossMultipleSubnets = new Capability("DhcpAccrossMultipleSubnets"); diff --git a/api/src/com/cloud/network/lb/CertService.java b/api/src/com/cloud/network/lb/CertService.java new file mode 100644 index 00000000000..69d77d6ff4d --- /dev/null +++ b/api/src/com/cloud/network/lb/CertService.java @@ -0,0 +1,32 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.lb; + + +import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; +import org.apache.cloudstack.api.response.SslCertResponse; + +import java.util.List; + +public interface CertService { + + public SslCertResponse uploadSslCert(UploadSslCertCmd certCmd); + public void deleteSslCert(DeleteSslCertCmd deleteSslCertCmd); + public List listSslCerts(ListSslCertsCmd listSslCertCmd); +} \ No newline at end of file diff --git a/api/src/com/cloud/network/lb/LoadBalancingRule.java b/api/src/com/cloud/network/lb/LoadBalancingRule.java index 4b37782a8c7..39c969c7001 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRule.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRule.java @@ -36,9 +36,11 @@ public class LoadBalancingRule { private List stickinessPolicies; private LbAutoScaleVmGroup autoScaleVmGroup; private List healthCheckPolicies; + private LbSslCert sslCert; + private String lbProtocol; public LoadBalancingRule(LoadBalancer lb, List destinations, - List stickinessPolicies, List healthCheckPolicies, Ip sourceIp) { + List stickinessPolicies, List healthCheckPolicies, Ip sourceIp) { this.lb = lb; this.destinations = destinations; this.stickinessPolicies = stickinessPolicies; @@ -46,6 +48,17 @@ public class LoadBalancingRule { this.sourceIp = sourceIp; } + public LoadBalancingRule(LoadBalancer lb, List destinations, + List stickinessPolicies, List healthCheckPolicies, Ip sourceIp, LbSslCert sslCert, String lbProtocol) { + this.lb = lb; + this.destinations = destinations; + this.stickinessPolicies = stickinessPolicies; + this.healthCheckPolicies = healthCheckPolicies; + this.sourceIp = sourceIp; + this.sslCert = sslCert; + this.lbProtocol = lbProtocol; + } + public long getId() { return lb.getId(); } @@ -90,6 +103,10 @@ public class LoadBalancingRule { return lb.getProtocol(); } + public String getLbProtocol() { + return this.lbProtocol; + } + public FirewallRule.Purpose getPurpose() { return FirewallRule.Purpose.LoadBalancing; } @@ -123,6 +140,10 @@ public class LoadBalancingRule { return healthCheckPolicies; } + public LbSslCert getLbSslCert(){ + return sslCert; + } + public interface Destination { String getIpAddress(); @@ -415,6 +436,44 @@ public class LoadBalancingRule { } } + public static class LbSslCert { + private String cert; + private String key; + private String password=null; + private String chain=null; + private boolean revoked; + + + public LbSslCert(String cert, String key, String password, String chain, boolean revoked) { + this.cert = cert; + this.key = key; + this.password = password; + this.chain = chain; + this.revoked = revoked; + } + + public String getCert() { + + return cert; + } + + public String getKey() { + return key; + } + + public String getPassword() { + return password; + } + + public String getChain() { + return chain; + } + + public boolean isRevoked(){ + return revoked; + } + } + public Ip getSourceIp() { return sourceIp; } diff --git a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java index 59d5c8dec05..298426b27b4 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java @@ -52,7 +52,7 @@ public interface LoadBalancingRulesService { */ LoadBalancer createPublicLoadBalancerRule(String xId, String name, String description, int srcPortStart, int srcPortEnd, int defPortStart, int defPortEnd, Long ipAddrId, String protocol, String algorithm, - long networkId, long lbOwnerId, boolean openFirewall) throws NetworkRuleConflictException, InsufficientAddressCapacityException; + long networkId, long lbOwnerId, boolean openFirewall, String lbProtocol) throws NetworkRuleConflictException, InsufficientAddressCapacityException; LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd); @@ -94,10 +94,16 @@ public interface LoadBalancingRulesService { */ boolean assignToLoadBalancer(long lbRuleId, List vmIds); + boolean assignSSLCertToLoadBalancerRule(Long lbRuleId, String certName, String publicCert, String privateKey); + boolean removeFromLoadBalancer(long lbRuleId, List vmIds); boolean applyLoadBalancerConfig(long lbRuleId) throws ResourceUnavailableException; + boolean assignCertToLoadBalancer(long lbRuleId, Long CertId); + boolean removeCertFromLoadBalancer(long lbRuleId); + + /** * List instances that have either been applied to a load balancer or are eligible to be assigned to a load * balancer. diff --git a/api/src/com/cloud/network/lb/SslCert.java b/api/src/com/cloud/network/lb/SslCert.java new file mode 100644 index 00000000000..f7a7c4b790e --- /dev/null +++ b/api/src/com/cloud/network/lb/SslCert.java @@ -0,0 +1,16 @@ +package com.cloud.network.lb; + + +import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Identity; +import org.apache.cloudstack.api.InternalIdentity; + +public interface SslCert extends InternalIdentity, Identity, ControlledEntity { + + public String getCertificate(); + public String getKey() ; + public String getChain(); + public String getPassword(); + public String getFingerPrint(); + +} diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index a348684f18f..ae6be63dcf9 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -36,6 +36,9 @@ public class ApiConstants { public static final String CATEGORY = "category"; public static final String CAN_REVERT = "canrevert"; public static final String CERTIFICATE = "certificate"; + public static final String CERTIFICATE_CHAIN = "certchain"; + public static final String CERTIFICATE_FINGERPRINT = "fingerprint"; + public static final String CERTIFICATE_ID = "certid"; public static final String PRIVATE_KEY = "privatekey"; public static final String DOMAIN_SUFFIX = "domainsuffix"; public static final String DNS_SEARCH_ORDER = "dnssearchorder"; diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java new file mode 100644 index 00000000000..253c015469e --- /dev/null +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignCertToLoadBalancerCmd.java @@ -0,0 +1,92 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.user.loadbalancer; + +import com.cloud.event.EventTypes; +import com.cloud.exception.*; +import com.cloud.network.rules.LoadBalancer; +import com.cloud.user.Account; +import org.apache.cloudstack.api.*; +import org.apache.cloudstack.api.response.FirewallRuleResponse; +import org.apache.cloudstack.api.response.SslCertResponse; +import org.apache.cloudstack.api.response.SuccessResponse; +import org.apache.log4j.Logger; + +@APICommand(name = "assignCertToLoadBalancer", description = "Assigns a certificate to a Load Balancer Rule", responseObject = SuccessResponse.class) +public class AssignCertToLoadBalancerCmd extends BaseAsyncCmd { + + public static final Logger s_logger = Logger + .getLogger(AssignCertToLoadBalancerCmd.class.getName()); + + private static final String s_name = "assignCertToLoadBalancer"; + + + @Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, + required = true, description = "the ID of the load balancer rule") + Long lbRuleId; + + @Parameter(name = ApiConstants.CERTIFICATE_ID, type = CommandType.UUID, entityType = SslCertResponse.class, + required = true, description = "the ID of the certificate") + Long certId; + + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { + //To change body of implemented methods use File | Settings | File Templates. + if ( _lbService.assignCertToLoadBalancer( getLbRuleId(), getCertId()) ) { + SuccessResponse response = new SuccessResponse(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign certificate to loadbalancer"); + } + } + + @Override + public String getEventType() { + return EventTypes.EVENT_LB_CERT_ASSIGN; + } + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public String getEventDescription() { + return "Assigining a certificate to a loadbalancer"; + } + + + @Override + public long getEntityOwnerId() { + LoadBalancer lb = _entityMgr.findById(LoadBalancer.class, getLbRuleId()); + if (lb == null) { + return Account.ACCOUNT_ID_SYSTEM; // bad id given, parent this command to SYSTEM so ERROR events are tracked + } + return lb.getAccountId(); + } + + + + public Long getCertId(){ + return certId; + } + + public Long getLbRuleId(){ + return lbRuleId; + } +} diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java index a36843634cc..e4cc0e613db 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java @@ -102,6 +102,9 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements "rule will be created for. Required when public Ip address is not associated with any Guest network yet (VPC case)") private Long networkId; + @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, description="The protocol for the LB") + private String lbProtocol; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -227,6 +230,10 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements return null; } + public String getLbProtocol(){ + return lbProtocol; + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @@ -282,7 +289,7 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements try { LoadBalancer result = _lbService.createPublicLoadBalancerRule(getXid(), getName(), getDescription(), getSourcePortStart(), getSourcePortEnd(), getDefaultPortStart(), getDefaultPortEnd(), getSourceIpAddressId(), getProtocol(), getAlgorithm(), - getNetworkId(), getEntityOwnerId(), getOpenFirewall()); + getNetworkId(), getEntityOwnerId(), getOpenFirewall(), getLbProtocol()); this.setEntityId(result.getId()); this.setEntityUuid(result.getUuid()); } catch (NetworkRuleConflictException e) { diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteSslCertCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteSslCertCmd.java new file mode 100644 index 00000000000..19e36d2b7b6 --- /dev/null +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteSslCertCmd.java @@ -0,0 +1,83 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.user.loadbalancer; + + +import com.cloud.network.lb.CertService; +import org.apache.cloudstack.api.response.SslCertResponse; +import com.cloud.exception.*; +import com.cloud.utils.exception.CloudRuntimeException; +import org.apache.cloudstack.api.*; +import org.apache.cloudstack.api.response.SuccessResponse; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; + +import javax.inject.Inject; + +@APICommand(name = "deleteSslCert", description="Delete a certificate to cloudstack", responseObject=SuccessResponse.class) +public class DeleteSslCertCmd extends BaseCmd { + public static final Logger s_logger = Logger.getLogger(DeleteSslCertCmd.class.getName()); + + private static final String s_name = "deletesslcertresponse"; + + @Inject + CertService _certService; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name= ApiConstants.ID, type=CommandType.UUID, entityType = SslCertResponse.class, required=true, description="Id of SSL certificate") + private Long id; + + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getId() { + return id; + } + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { + try { + _certService.deleteSslCert(this); + SuccessResponse rsp = new SuccessResponse(); + rsp.setResponseName(getCommandName()); + rsp.setObjectName("success"); + this.setResponseObject(rsp); + } catch (Exception e) { + throw new CloudRuntimeException(e); + } + } + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return CallContext.current().getCallingAccount().getId(); + } + +} \ No newline at end of file diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListSslCertsCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListSslCertsCmd.java new file mode 100644 index 00000000000..3df28a39b80 --- /dev/null +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListSslCertsCmd.java @@ -0,0 +1,106 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.user.loadbalancer; + + +import org.apache.cloudstack.api.response.FirewallRuleResponse; +import org.apache.cloudstack.api.response.SslCertResponse; +import com.cloud.network.lb.CertService; +import com.cloud.utils.exception.CloudRuntimeException; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.response.AccountResponse; +import org.apache.cloudstack.api.response.ListResponse; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; + +import javax.inject.Inject; +import java.util.List; + +@APICommand(name = "listSslCerts", description="Lists SSL certificates", responseObject=SslCertResponse.class) +public class ListSslCertsCmd extends BaseCmd { + public static final Logger s_logger = Logger.getLogger(DeleteSslCertCmd.class.getName()); + + private static final String s_name = "listsslcertsresponse"; + + @Inject + CertService _certService; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name= ApiConstants.CERTIFICATE_ID, type=CommandType.UUID, entityType = SslCertResponse.class, required=false, description="Id of SSL certificate") + private Long certId; + + @Parameter(name= ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType = AccountResponse.class, required=false, description="Account Id") + private Long accountId; + + @Parameter(name= ApiConstants.LBID, type=CommandType.UUID, entityType = FirewallRuleResponse.class, required=false, description="Loadbalancer Rule Id") + private Long lbId; + + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public Long getCertId() { + return certId; + } + + public Long getAccountId() { + return accountId; + } + + public Long getLbId(){ + return lbId; + } + + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute(){ + + + try { + List certResponseList = _certService.listSslCerts(this); + ListResponse response = new ListResponse(); + + response.setResponses(certResponseList); + response.setResponseName(getCommandName()); + this.setResponseObject(response); + + } catch (Exception e) { + throw new CloudRuntimeException(e); + } + } + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return CallContext.current().getCallingAccount().getId(); + } +} \ No newline at end of file diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveCertFromLoadBalancerCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveCertFromLoadBalancerCmd.java new file mode 100644 index 00000000000..059d16320f6 --- /dev/null +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveCertFromLoadBalancerCmd.java @@ -0,0 +1,82 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.user.loadbalancer; + + +import com.cloud.event.EventTypes; +import com.cloud.exception.*; +import com.cloud.network.rules.LoadBalancer; +import com.cloud.user.Account; +import org.apache.cloudstack.api.*; +import org.apache.cloudstack.api.response.FirewallRuleResponse; +import org.apache.cloudstack.api.response.SuccessResponse; +import org.apache.log4j.Logger; + + +@APICommand(name = "removeCertFromLoadBalancer", description = "Removes a certificate from a Load Balancer Rule", responseObject = SuccessResponse.class) +public class RemoveCertFromLoadBalancerCmd extends BaseAsyncCmd{ + + public static final Logger s_logger = Logger.getLogger(RemoveCertFromLoadBalancerCmd.class.getName()); + + private static final String s_name = "removeCertFromLoadBalancer"; + + + @Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, + required = true, description = "the ID of the load balancer rule") + Long lbRuleId; + + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { + boolean result = _lbService.removeCertFromLoadBalancer(getLbRuleId()); + if (result) { + SuccessResponse response = new SuccessResponse(getCommandName()); + this.setResponseObject(response); + } else { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove certificate from load balancer rule"); + } + } + + @Override + public String getEventType() { + return EventTypes.EVENT_LB_CERT_REMOVE; + } + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public String getEventDescription() { + return "Removing a certificate from a loadbalancer with ID " + getLbRuleId(); + } + + + @Override + public long getEntityOwnerId() { + LoadBalancer lb = _entityMgr.findById(LoadBalancer.class, getLbRuleId()); + if (lb == null) { + return Account.ACCOUNT_ID_SYSTEM; // bad id given, parent this command to SYSTEM so ERROR events are tracked + } + return lb.getAccountId(); + } + + public Long getLbRuleId(){ + return this.lbRuleId; + } +} diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UploadSslCertCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UploadSslCertCmd.java new file mode 100644 index 00000000000..897d66b73c1 --- /dev/null +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UploadSslCertCmd.java @@ -0,0 +1,103 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.user.loadbalancer; + + +import org.apache.cloudstack.api.response.SslCertResponse; +import com.cloud.exception.*; +import com.cloud.network.lb.CertService; +import org.apache.cloudstack.api.*; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; + +import javax.inject.Inject; + +@APICommand(name = "uploadSslCert", description="Upload a certificate to cloudstack", responseObject=SslCertResponse.class) +public class UploadSslCertCmd extends BaseCmd { + public static final Logger s_logger = Logger.getLogger(UploadSslCertCmd.class.getName()); + + private static final String s_name = "uploadsslcertresponse"; + + @Inject CertService _certService; + + ///////////////////////////////////////////////////// + //////////////// API parameters ///////////////////// + ///////////////////////////////////////////////////// + + @Parameter(name= ApiConstants.CERTIFICATE, type=CommandType.STRING, required=true, description="SSL certificate",length=16384) + private String cert; + + @Parameter(name=ApiConstants.PRIVATE_KEY, type=CommandType.STRING, required=true, description="Private key", length=16384) + private String key; + + @Parameter(name=ApiConstants.CERTIFICATE_CHAIN, type=CommandType.STRING, description="Certificate chain of trust", length=2097152) + private String chain; + + @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, description="Password for the private key") + private String password; + + + + ///////////////////////////////////////////////////// + /////////////////// Accessors /////////////////////// + ///////////////////////////////////////////////////// + + public String getCert() { + return cert; + } + + public String getKey() { + return key; + } + + public String getChain() { + return chain; + } + + public String getPassword() { + return password; + } + + + ///////////////////////////////////////////////////// + /////////////// API Implementation/////////////////// + ///////////////////////////////////////////////////// + + @Override + public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { + + try{ + SslCertResponse response = _certService.uploadSslCert(this); + setResponseObject(response); + response.setResponseName(getCommandName()); + } catch (Exception e){ + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage()); + } + + } + + @Override + public String getCommandName() { + return s_name; + } + + @Override + public long getEntityOwnerId() { + return CallContext.current().getCallingAccount().getId(); + } + +} \ No newline at end of file diff --git a/api/src/org/apache/cloudstack/api/response/SslCertResponse.java b/api/src/org/apache/cloudstack/api/response/SslCertResponse.java new file mode 100644 index 00000000000..3e8b7ae559d --- /dev/null +++ b/api/src/org/apache/cloudstack/api/response/SslCertResponse.java @@ -0,0 +1,90 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.response; + +import com.cloud.network.lb.SslCert; +import com.cloud.serializer.Param; +import com.google.gson.annotations.SerializedName; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseResponse; +import org.apache.cloudstack.api.EntityReference; + +import java.util.List; +//import org.apache.cloudstack.api.EntityReference; + +@EntityReference(value= SslCert.class) +public class SslCertResponse extends BaseResponse { + + @SerializedName(ApiConstants.ID) + @Param(description = "SSL certificate ID") + private String id; + + @SerializedName(ApiConstants.CERTIFICATE) + @Param(description = "certificate") + private String certificate; + + @SerializedName(ApiConstants.PRIVATE_KEY) + @Param(description = "private key") + private String privatekey; + + @SerializedName(ApiConstants.ACCOUNT) + @Param(description = "account for the certificate") + private String accountName; + + @SerializedName(ApiConstants.CERTIFICATE_CHAIN) + @Param(description = "certificate chain") + private String certchain; + + @SerializedName(ApiConstants.CERTIFICATE_FINGERPRINT) + @Param(description = "certificate fingerprint") + private String fingerprint; + + @SerializedName(ApiConstants.LOAD_BALANCER_RULE_LIST) + @Param(description = "List of loabalancers this certificate is bound to") + List lbIds; + + public SslCertResponse() { + } + + public void setId(String id) { + this.id = id; + } + + public void setCertificate(String cert) { + this.certificate = cert; + } + + public void setPrivatekey(String key) { + this.privatekey = key; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public void setCertchain(String chain) { + this.certchain = chain; + } + + public void setFingerprint(String fingerprint){ + this.fingerprint = fingerprint; + } + + public void setLbIds(List lbIds){ + this.lbIds = lbIds; + } +} diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 68d7303d0a7..cb9dcf0b071 100644 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -165,6 +165,14 @@ deleteLBHealthCheckPolicy=15 listLoadBalancerRuleInstances=15 updateLoadBalancerRule=15 +##### SSL offload commands + +uploadSslCert=15 +deleteSslCert=15 +listSslCerts=15 +assignCertToLoadBalancer=15 +removeCertFromLoadBalancer=15 + #### autoscale commands createCounter=1 createCondition=15 diff --git a/core/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java b/core/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java index 3a51e8ad6be..a6a46d55665 100644 --- a/core/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java +++ b/core/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java @@ -33,6 +33,7 @@ public class LoadBalancerConfigCommand extends NetworkElementCommand { public String lbStatsAuth = "admin1:AdMiN123"; public String lbStatsUri = "/admin?stats"; public String maxconn =""; + public String lbProtocol; public boolean keepAliveEnabled = false; NicTO nic; Long vpcId; diff --git a/engine/components-api/src/com/cloud/network/lb/LoadBalancingRulesManager.java b/engine/components-api/src/com/cloud/network/lb/LoadBalancingRulesManager.java index 3e325859a9a..22830d5a06a 100644 --- a/engine/components-api/src/com/cloud/network/lb/LoadBalancingRulesManager.java +++ b/engine/components-api/src/com/cloud/network/lb/LoadBalancingRulesManager.java @@ -25,6 +25,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.lb.LoadBalancingRule.LbDestination; import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy; import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy; +import com.cloud.network.lb.LoadBalancingRule.LbSslCert; import com.cloud.network.rules.LbStickinessMethod; import com.cloud.network.rules.LoadBalancer; import com.cloud.network.rules.LoadBalancerContainer.Scheme; @@ -33,7 +34,8 @@ import com.cloud.user.Account; public interface LoadBalancingRulesManager { LoadBalancer createPublicLoadBalancer(String xId, String name, String description, - int srcPort, int destPort, long sourceIpId, String protocol, String algorithm, boolean openFirewall, CallContext caller) + int srcPort, int destPort, long sourceIpId, String protocol, String algorithm, + boolean openFirewall, CallContext caller, String lbProtocol) throws NetworkRuleConflictException; boolean removeAllLoadBalanacersForIp(long ipId, Account caller, long callerUserId); @@ -42,6 +44,7 @@ public interface LoadBalancingRulesManager { List getStickinessPolicies(long lbId); List getStickinessMethods(long networkid); List getHealthCheckPolicies(long lbId); + LbSslCert getLbSslCert(long lbId); /** * Remove vm from all load balancers diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml index a64e5c06e7c..c71190b5cf5 100644 --- a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml +++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml @@ -189,6 +189,7 @@ + @@ -252,6 +253,7 @@ + diff --git a/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapDao.java b/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapDao.java new file mode 100644 index 00000000000..21c01d9c15e --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapDao.java @@ -0,0 +1,29 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.dao; + +import com.cloud.network.LBHealthCheckPolicyVO; +import com.cloud.utils.db.GenericDao; + +import java.util.List; + + +public interface LoadBalancerCertMapDao extends GenericDao { + List listByCertId(Long certId); + List listByAccountId(Long accountId); + LoadBalancerCertMapVO findByLbRuleId(Long id); +} diff --git a/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapDaoImpl.java b/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapDaoImpl.java new file mode 100644 index 00000000000..57506f9a6f0 --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapDaoImpl.java @@ -0,0 +1,79 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.dao; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.JoinBuilder; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; + +import javax.ejb.Local; +import javax.inject.Inject; +import java.util.List; + +@Local(value = {LoadBalancerCertMapDao.class}) +public class LoadBalancerCertMapDaoImpl extends GenericDaoBase implements LoadBalancerCertMapDao { + + private final SearchBuilder listByCertId; + private final SearchBuilder findByLbRuleId; + + + @Inject SslCertDao _sslCertDao; + + public LoadBalancerCertMapDaoImpl() { + + listByCertId = createSearchBuilder(); + listByCertId.and("certificateId", listByCertId.entity().getCertId(), SearchCriteria.Op.EQ); + listByCertId.done(); + + findByLbRuleId = createSearchBuilder(); + findByLbRuleId.and("loadBalancerId", findByLbRuleId.entity().getLbId(), SearchCriteria.Op.EQ); + findByLbRuleId.done(); + + } + + @Override + public List listByCertId(Long certId) { + SearchCriteria sc = listByCertId.create(); + sc.setParameters("certificateId", certId); + return listBy(sc); + } + + @Override + public LoadBalancerCertMapVO findByLbRuleId(Long LbId) { + SearchCriteria sc = findByLbRuleId.create(); + sc.setParameters("loadBalancerId", LbId); + return findOneBy(sc); + } + + @Override + public List listByAccountId(Long accountId) { + + SearchBuilder listByAccountId; + SearchBuilder certsForAccount; + + listByAccountId = createSearchBuilder(); + certsForAccount = _sslCertDao.createSearchBuilder(); + certsForAccount.and("accountId", certsForAccount.entity().getAccountId(), SearchCriteria.Op.EQ); + listByAccountId.join("certsForAccount", certsForAccount, certsForAccount.entity().getId(), listByAccountId.entity().getLbId(), JoinBuilder.JoinType.INNER); + certsForAccount.done(); + listByAccountId.done(); + + SearchCriteria sc = listByAccountId.create(); + sc.setParameters("accountId", accountId); + return listBy(sc); + } +} diff --git a/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapVO.java b/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapVO.java new file mode 100644 index 00000000000..535964757ec --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/LoadBalancerCertMapVO.java @@ -0,0 +1,96 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.dao; + + +import org.apache.cloudstack.api.InternalIdentity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.UUID; + + +@Entity +@Table(name="load_balancer_cert_map") +public class LoadBalancerCertMapVO implements InternalIdentity { + + @Id + @Column(name="id") + private Long id; + + @Column(name="uuid") + private String uuid; + + @Column(name="load_balancer_id") + private Long lbId; + + @Column(name="certificate_id") + private Long certId; + + @Column(name="revoke") + private boolean revoke = false; + + + public LoadBalancerCertMapVO() { + this.uuid = UUID.randomUUID().toString(); + } + + public LoadBalancerCertMapVO(Long lbId, Long certId, boolean revoke) { + + this.lbId = lbId; + this.certId = certId; + this.revoke = revoke; + this.uuid = UUID.randomUUID().toString(); + } + + // Getters + @Override + public long getId() { + return id; + } + + public String getUuid() { + return uuid; + } + + public Long getLbId() { + return lbId; + } + + public Long getCertId() { + return certId; + } + + public boolean isRevoke() { + return revoke; + } + + //Setters + public void setLbId(Long lbId) { + this.lbId = lbId; + } + + public void setCertId(Long certId) { + this.certId = certId; + } + + public void setRevoke(boolean revoke) { + this.revoke = revoke; + } +} diff --git a/engine/schema/src/com/cloud/network/dao/LoadBalancerVO.java b/engine/schema/src/com/cloud/network/dao/LoadBalancerVO.java index fee88cf7b0a..625eb6f651a 100644 --- a/engine/schema/src/com/cloud/network/dao/LoadBalancerVO.java +++ b/engine/schema/src/com/cloud/network/dao/LoadBalancerVO.java @@ -59,10 +59,15 @@ public class LoadBalancerVO extends FirewallRuleVO implements LoadBalancer { @Column(name="scheme") Scheme scheme = Scheme.Public; + @Column(name="lb_protocol") + String lbProtocol; + + public LoadBalancerVO() { } - public LoadBalancerVO(String xId, String name, String description, long srcIpId, int srcPort, int dstPort, String algorithm, long networkId, long accountId, long domainId) { + public LoadBalancerVO(String xId, String name, String description, long srcIpId, int srcPort, int dstPort, String algorithm, long networkId, + long accountId, long domainId, String lbProtocol) { super(xId, srcIpId, srcPort, NetUtils.TCP_PROTO, networkId, accountId, domainId, Purpose.LoadBalancing, null, null, null, null); this.name = name; this.description = description; @@ -70,6 +75,7 @@ public class LoadBalancerVO extends FirewallRuleVO implements LoadBalancer { this.defaultPortStart = dstPort; this.defaultPortEnd = dstPort; this.scheme = Scheme.Public; + this.lbProtocol = lbProtocol; } @Override @@ -101,6 +107,14 @@ public class LoadBalancerVO extends FirewallRuleVO implements LoadBalancer { this.name = name; } + public String getLbProtocol(){ + return lbProtocol; + } + + public void setLbProtocol(String lbProtocol){ + this.lbProtocol = lbProtocol; + } + public void setAlgorithm(String algorithm) { this.algorithm = algorithm; } diff --git a/engine/schema/src/com/cloud/network/dao/SslCertDao.java b/engine/schema/src/com/cloud/network/dao/SslCertDao.java new file mode 100644 index 00000000000..37520bbcb90 --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/SslCertDao.java @@ -0,0 +1,27 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.dao; + + +import com.cloud.utils.db.GenericDao; + +import java.util.List; + + +public interface SslCertDao extends GenericDao { + List listByAccountId(Long id); +} \ No newline at end of file diff --git a/engine/schema/src/com/cloud/network/dao/SslCertDaoImpl.java b/engine/schema/src/com/cloud/network/dao/SslCertDaoImpl.java new file mode 100644 index 00000000000..483c28d295b --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/SslCertDaoImpl.java @@ -0,0 +1,31 @@ +package com.cloud.network.dao; + +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; + +import javax.ejb.Local; +import java.util.List; + + + +@Local(value = {SslCertDao.class}) +public class SslCertDaoImpl extends GenericDaoBase implements SslCertDao { + + private final SearchBuilder listByAccountId; + + public SslCertDaoImpl() { + listByAccountId = createSearchBuilder(); + listByAccountId.and("accountId", listByAccountId.entity().getAccountId(), SearchCriteria.Op.EQ); + listByAccountId.done(); + } + + @Override + public List listByAccountId(Long accountId) { + SearchCriteria sc = listByAccountId.create(); + sc.setParameters("accountId", accountId); + return listBy(sc); + } + + +} diff --git a/engine/schema/src/com/cloud/network/dao/SslCertVO.java b/engine/schema/src/com/cloud/network/dao/SslCertVO.java new file mode 100644 index 00000000000..c26c2aa2740 --- /dev/null +++ b/engine/schema/src/com/cloud/network/dao/SslCertVO.java @@ -0,0 +1,132 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.dao; + + +import com.cloud.network.lb.SslCert; +import com.cloud.utils.db.Encrypt; +import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.InternalIdentity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.UUID; + +@Entity +@Table(name="sslcerts") +public class SslCertVO implements SslCert { + + @Id + @Column(name="id") + private Long id; + + @Column(name="uuid") + private String uuid; + + @Column(name="certificate",length=16384) + private String certificate; + + + @Column(name="chain",length=2097152) + private String chain; + + @Encrypt + @Column(name="key",length=16384) + private String key; + + @Encrypt + @Column(name="password") + private String password; + + @Column(name="account_id") + private Long accountId; + + @Column(name = "domain_id") + long domainId; + + @Column(name = "fingerprint") + String fingerPrint; + + + + + public SslCertVO() { + this.uuid = UUID.randomUUID().toString(); + } + + public SslCertVO(String cert, String key, String password, String chain, Long accountId, Long domainId, String fingerPrint) { + this.certificate = cert; + this.key = key; + this.chain = chain; + this.password = password; + this.accountId = accountId; + this.domainId = domainId; + this.fingerPrint = fingerPrint; + this.uuid = UUID.randomUUID().toString(); + } + + + // Getters + @Override + public long getId() { + return id; + } + + @Override + public String getUuid() { + return uuid; + } + + @Override + public String getCertificate() { + return certificate; + } + + + @Override + public String getKey() { + return key; + } + + + @Override + public String getChain() { + return chain; + } + + @Override + public long getAccountId() { + return accountId; + } + + @Override + public String getPassword() { + return password; + } + + @Override + public long getDomainId() { + return domainId; + } + + @Override + public String getFingerPrint() { + return fingerPrint; + } +} \ No newline at end of file diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java index 5c6f2e7dd63..e049cece058 100644 --- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java +++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java @@ -98,6 +98,7 @@ import com.cloud.network.dao.VirtualRouterProviderDao; import com.cloud.network.lb.LoadBalancingRule.LbDestination; import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy; import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy; +import com.cloud.network.lb.LoadBalancingRule.LbSslCert; import com.cloud.network.lb.dao.ElasticLbVmMapDao; import com.cloud.network.router.VirtualRouter; import com.cloud.network.router.VirtualRouter.RedundantState; @@ -290,6 +291,7 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast private void createApplyLoadBalancingRulesCommands( List rules, DomainRouterVO elbVm, Commands cmds, long guestNetworkId) { + /* XXX: cert */ LoadBalancerTO[] lbs = new LoadBalancerTO[rules.size()]; int i = 0; for (LoadBalancingRule rule : rules) { @@ -302,7 +304,8 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast int srcPort = rule.getSourcePortStart(); String uuid = rule.getUuid(); List destinations = rule.getDestinations(); - LoadBalancerTO lb = new LoadBalancerTO(uuid, elbIp, srcPort, protocol, algorithm, revoked, false, false, destinations); + LoadBalancerTO lb = new LoadBalancerTO(uuid, elbIp, srcPort, protocol, algorithm, revoked, + false, false, destinations); lbs[i++] = lb; } @@ -377,8 +380,9 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast List policyList = _lbMgr.getStickinessPolicies(lb.getId()); List hcPolicyList = _lbMgr.getHealthCheckPolicies(lb.getId()); Ip sourceIp = _networkModel.getPublicIpAddress(lb.getSourceIpAddressId()).getAddress(); + LbSslCert sslCert = _lbMgr.getLbSslCert(lb.getId()); LoadBalancingRule loadBalancing = new LoadBalancingRule( - lb, dstList, policyList, hcPolicyList, sourceIp); + lb, dstList, policyList, hcPolicyList, sourceIp, sslCert, lb.getLbProtocol()); lbRules.add(loadBalancing); } return applyLBRules(elbVm, lbRules, network.getId()); @@ -664,7 +668,7 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast result = _lbMgr.createPublicLoadBalancer(lb.getXid(), lb.getName(), lb.getDescription(), lb.getSourcePortStart(), lb.getDefaultPortStart(), ipId.longValue(), lb.getProtocol(), - lb.getAlgorithm(), false, CallContext.current()); + lb.getAlgorithm(), false, CallContext.current(), lb.getLbProtocol()); } catch (NetworkRuleConflictException e) { s_logger.warn("Failed to create LB rule, not continuing with ELB deployment"); if (newIp) { diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java index b6269ebae9d..b9482b5a490 100644 --- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java +++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java @@ -77,6 +77,7 @@ import com.cloud.network.lb.LoadBalancingRule; import com.cloud.network.lb.LoadBalancingRule.LbDestination; import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy; import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy; +import com.cloud.network.lb.LoadBalancingRule.LbSslCert; import com.cloud.network.lb.LoadBalancingRulesManager; import com.cloud.network.router.VirtualNetworkApplianceManager; import com.cloud.network.router.VirtualRouter; diff --git a/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/InternalLBVMManagerTest.java b/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/InternalLBVMManagerTest.java index 82f90fb9dbf..90d6a183eb2 100644 --- a/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/InternalLBVMManagerTest.java +++ b/plugins/network-elements/internal-loadbalancer/test/org/apache/cloudstack/internallbvmmgr/InternalLBVMManagerTest.java @@ -212,7 +212,7 @@ public class InternalLBVMManagerTest extends TestCase { List vms = new ArrayList(); List rules = new ArrayList(); LoadBalancingRule rule = new LoadBalancingRule(null, null, - null, null, null); + null, null, null, null, null); rules.add(rule); try { @@ -232,7 +232,7 @@ public class InternalLBVMManagerTest extends TestCase { List rules = new ArrayList(); LoadBalancingRule rule = new LoadBalancingRule(null, null, - null, null, null); + null, null, null, null, null); rules.add(rule); try { @@ -252,7 +252,7 @@ public class InternalLBVMManagerTest extends TestCase { List rules = new ArrayList(); LoadBalancingRule rule = new LoadBalancingRule(null, null, - null, null, null); + null, null, null, null, null); rules.add(rule); try { @@ -272,7 +272,7 @@ public class InternalLBVMManagerTest extends TestCase { List rules = new ArrayList(); LoadBalancingRule rule = new LoadBalancingRule(null, null, - null, null, null); + null, null, null, null, null); rules.add(rule); try { diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java index 8101864840b..de3d7e86665 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java @@ -161,6 +161,7 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl @Inject ExternalLoadBalancerDeviceDao _externalLoadBalancerDeviceDao; + private boolean canHandle(Network config, Service service) { DataCenter zone = _dcDao.findById(config.getDataCenterId()); boolean handleInAdvanceZone = (zone.getNetworkType() == NetworkType.Advanced && @@ -277,7 +278,7 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl // Supports only Public load balancing lbCapabilities.put(Capability.LbSchemes, LoadBalancerContainer.Scheme.Public.toString()); - + // Specifies that load balancing rules can support autoscaling and the list of counters it supports AutoScaleCounter counter; List counterList = new ArrayList(); @@ -319,6 +320,10 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl staticNatCapabilities.put(Capability.ElasticIp, "true"); capabilities.put(Service.StaticNat, staticNatCapabilities); + // Supports SSL offloading + lbCapabilities.put(Capability.SslTermination, "true"); + + // TODO - Murali, please put correct capabilities here Map firewallCapabilities = new HashMap(); firewallCapabilities.put(Capability.TrafficStatistics, "per public ip"); @@ -516,6 +521,7 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl cmdList.add(DeleteNetscalerLoadBalancerCmd.class); cmdList.add(ListNetscalerLoadBalancerNetworksCmd.class); cmdList.add(ListNetscalerLoadBalancersCmd.class); + return cmdList; } @@ -732,7 +738,8 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl List destinations = rule.getDestinations(); if ((destinations != null && !destinations.isEmpty()) || rule.isAutoScaleConfig()) { - LoadBalancerTO loadBalancer = new LoadBalancerTO(lbUuid, srcIp, srcPort, protocol, algorithm, revoked, false, false, destinations, rule.getStickinessPolicies(), rule.getHealthCheckPolicies()); + LoadBalancerTO loadBalancer = new LoadBalancerTO(lbUuid, srcIp, srcPort, protocol, algorithm, revoked, false, false, destinations, + rule.getStickinessPolicies(), rule.getHealthCheckPolicies(), rule.getLbSslCert(), rule.getLbProtocol()); if (rule.isAutoScaleConfig()) { loadBalancer.setAutoScaleVmGroup(rule.getAutoScaleVmGroup()); } @@ -894,7 +901,7 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl if ((destinations != null && !destinations.isEmpty()) || rule.isAutoScaleConfig()) { LoadBalancerTO loadBalancer = new LoadBalancerTO(lbUuid, srcIp, srcPort, protocol, algorithm, revoked, - false, false, destinations, null, rule.getHealthCheckPolicies()); + false, false, destinations, null, rule.getHealthCheckPolicies(), rule.getLbSslCert(), rule.getLbProtocol()); loadBalancersToApply.add(loadBalancer); } } @@ -1024,5 +1031,4 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl } return true; } - } diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java index fe072e13718..e48d31d3f0a 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java @@ -25,6 +25,10 @@ import java.util.Map; import javax.naming.ConfigurationException; +import com.citrix.netscaler.nitro.resource.config.ssl.sslcertkey; +import com.citrix.netscaler.nitro.resource.config.ssl.sslvserver_sslcertkey_binding; +import com.cloud.network.lb.LoadBalancingRule.LbSslCert; +import com.cloud.utils.ssh.SshHelper; import org.apache.log4j.Logger; import com.citrix.netscaler.nitro.exception.nitro_exception; @@ -235,6 +239,7 @@ public class NetscalerResource implements ServerResource { //enable load balancing feature enableLoadBalancingFeature(); + SSL.enableSslFeature(_netscalerService); //if the the device is cloud stack provisioned then make it part of the public network if (_cloudManaged) { @@ -550,6 +555,8 @@ public class NetscalerResource implements ServerResource { String lbAlgorithm = loadBalancer.getAlgorithm(); String nsVirtualServerName = generateNSVirtualServerName(srcIp, srcPort); String nsMonitorName = generateNSMonitorName(srcIp, srcPort); + LbSslCert sslCert = loadBalancer.getSslCert(); + if(loadBalancer.isAutoScaleVmGroupTO()) { applyAutoScaleConfig(loadBalancer); // Continue to process all the rules. @@ -558,6 +565,7 @@ public class NetscalerResource implements ServerResource { boolean hasMonitor = false; boolean deleteMonitor = false; boolean destinationsToAdd = false; + boolean deleteCert = false; for (DestinationTO destination : loadBalancer.getDestinations()) { if (!destination.isRevoked()) { destinationsToAdd = true; @@ -655,9 +663,35 @@ public class NetscalerResource implements ServerResource { } } + + + if(sslCert != null && lbProtocol.equals(NetUtils.SSL_PROTO)) { + if ( sslCert.isRevoked() ){ + deleteCert = true; + } else{ + + String certName = generateSslCertName(srcIp, srcPort); + String keyName = generateSslKeyName(srcIp, srcPort); + String certKeyName = generateSslCertKeyName(srcIp, srcPort); + + if ( SSL.isSslCertKeyPresent(_netscalerService, certKeyName)){ + SSL.deleteSslCertKey(_netscalerService, certKeyName); + } + + + SSL.uploadCert(_ip, _username, _password, certName, sslCert.getCert().getBytes()); + SSL.uploadKey(_ip, _username, _password, keyName, sslCert.getKey().getBytes()); + + SSL.createSslCertKey(_netscalerService, certName, keyName, certKeyName, sslCert.getPassword()); + SSL.bindCertKeyToVserver(_netscalerService, certKeyName, nsVirtualServerName); + } + + } + if (s_logger.isDebugEnabled()) { s_logger.debug("Successfully added LB destination: " + destination.getDestIp() + ":" + destination.getDestPort() + " to load balancer " + srcIp + ":" + srcPort); } + } else { // remove a destination from the deployed load balancing rule com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding[] serviceBindings = com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding.get(_netscalerService, nsVirtualServerName); @@ -731,11 +765,27 @@ public class NetscalerResource implements ServerResource { } removeLBVirtualServer(nsVirtualServerName); deleteMonitor = true; + deleteCert = true; } } if(deleteMonitor) { removeLBMonitor(nsMonitorName); } + if ( sslCert != null && deleteCert){ + + String certName = generateSslCertName(srcIp, srcPort); + String keyName = generateSslKeyName(srcIp, srcPort); + String certKeyName = generateSslCertKeyName(srcIp, srcPort); + + // unbind before deleting + if ( nsVirtualServerExists(nsVirtualServerName) ){ + SSL.unbindCertKeyFromVserver(_netscalerService, certKeyName, nsVirtualServerName); + } + + SSL.deleteSslCertKey(_netscalerService, certKeyName); + SSL.deleteCertFile(_ip, _username, _password, certName); + SSL.deleteKeyFile(_ip, _username, _password, keyName); + } } @@ -1666,6 +1716,173 @@ public class NetscalerResource implements ServerResource { } } + /* SSL Termination */ + private static class SSL { + + private static final String SSL_CERT_PATH = "/nsconfig/ssl/"; + private static final int SSH_PORT = 22; + + private static boolean isSslCertKeyPresent(nitro_service ns, String certKeyName) throws ExecutionException { + + String filter = "certkey:" + certKeyName; + + try { + if (sslcertkey.count_filtered(ns, filter) > 0) return true; + } catch (nitro_exception e){ + throw new ExecutionException("Failed to get certkey " + e.getMessage()); + } catch (Exception e){ + throw new ExecutionException("Failed to get certkey " + e.getMessage()); + } + + return false; + } + + private static void deleteSslCertKey(nitro_service ns, String certKeyName) throws ExecutionException { + try { + + sslcertkey certkey = new sslcertkey(); + certkey.set_certkey(certKeyName); + sslcertkey.delete(ns, certkey); + + } catch (nitro_exception e){ + throw new ExecutionException("Failed to delete certkey " + e.getMessage()); + } catch (Exception e){ + throw new ExecutionException("Failed to delete certkey " + e.getMessage()); + } + + } + + private static void deleteCertFile(String nsIp, String username, String password, String certName) throws Exception { + SshHelper.sshExecute(nsIp,SSH_PORT,username,null,password,"shell rm " + SSL_CERT_PATH + certName); + } + + private static void deleteKeyFile(String nsIp, String username, String password, String keyName) throws Exception { + SshHelper.sshExecute(nsIp,SSH_PORT,username,null,password,"shell rm " + SSL_CERT_PATH + keyName); + } + + private static void createSslCertKey(nitro_service ns, String certName, String keyName, String certKeyName, String password) throws ExecutionException { + s_logger.debug("Adding cert to netscaler"); + try { + sslcertkey certkey = new sslcertkey(); + certkey.set_certkey(certKeyName); + certkey.set_cert(SSL_CERT_PATH + certName); + certkey.set_key(SSL_CERT_PATH + keyName); + + if( password != null ) { + certkey.set_passplain(password); + } + + certkey.perform_operation(ns); + + } catch (nitro_exception e){ + throw new ExecutionException("Failed to add certkey binding " + e.getMessage()); + } catch (Exception e){ + throw new ExecutionException("Failed to add certkey binding " + e.getMessage()); + } + + } + + public static void updateCertKey(nitro_service ns, String certKeyName, String cert, String key, String password) throws ExecutionException { + try{ + sslcertkey certkey = sslcertkey.get(ns, certKeyName); + if ( cert != null ) + certkey.set_cert(cert); + if ( key != null ) + certkey.set_key(cert); + if ( password != null ) + certkey.set_passplain(cert); + + sslcertkey.change(ns,certkey); + + } catch (nitro_exception e){ + throw new ExecutionException("Failed to update ssl on load balancer due to " + e.getMessage()); + } catch (Exception e){ + throw new ExecutionException("Failed to update ssl on load balancer due to " + e.getMessage()); + } + } + + private static void bindCertKeyToVserver(nitro_service ns, String certKeyName, String vserver) throws ExecutionException { + s_logger.debug("Adding cert to netscaler"); + + try { + sslvserver_sslcertkey_binding cert_binding = new sslvserver_sslcertkey_binding(); + cert_binding.set_certkeyname(certKeyName); + cert_binding.set_vservername(vserver); + cert_binding.perform_operation(ns); + } catch (nitro_exception e){ + throw new ExecutionException("Failed to bind certkey to vserver due to " + e.getMessage()); + } catch (Exception e){ + throw new ExecutionException("Failed to bind certkey to vserver due to " + e.getMessage()); + } + } + + private static void unbindCertKeyFromVserver(nitro_service ns, String certKeyName, String vserver) throws ExecutionException { + try { + + sslvserver_sslcertkey_binding cert_binding = new sslvserver_sslcertkey_binding(); + cert_binding.set_certkeyname(certKeyName); + cert_binding.set_vservername(vserver); + sslvserver_sslcertkey_binding.delete(ns,cert_binding); + + } catch (nitro_exception e){ + throw new ExecutionException("Failed to unbind certkey to vserver due to " + e.getMessage()); + } catch (Exception e){ + throw new ExecutionException("Failed to unbind certkey to vserver due to " + e.getMessage()); + } + + } + + + private static void uploadCert(String nsIp, String user, String password, String certName, byte[] certData) throws ExecutionException { + try { + SshHelper.scpTo(nsIp,SSH_PORT,user,null,password, SSL_CERT_PATH, certData, certName, null); + } catch (Exception e){ + throw new ExecutionException("Failed to copy private key to device " + e.getMessage()); + } + } + + private static void uploadKey(String nsIp, String user, String password, String keyName, byte[] keyData) throws ExecutionException { + try { + SshHelper.scpTo(nsIp, SSH_PORT, user, null, password, SSL_CERT_PATH, keyData, keyName, null); + } catch (Exception e){ + throw new ExecutionException("Failed to copy private key to device " + e.getMessage()); + } + } + + + private static void enableSslFeature(nitro_service ns) throws ExecutionException { + try { + base_response result = ns.enable_features(new String[]{"SSL"}); + if( result.errorcode != 0 ) + throw new ExecutionException("Unable to enable SSL on LB"); + } catch (nitro_exception e){ + throw new ExecutionException("Failed to enable ssl feature on load balancer due to " + e.getMessage()); + } catch (Exception e){ + throw new ExecutionException("Failed to enable ssl feature on load balancer due to " + e.getMessage()); + } + } + + public static boolean checkSslFeature(nitro_service ns) throws ExecutionException { + try { + String[] features = ns.get_enabled_features(); + if (features != null) { + for (String feature : features) { + if (feature.equalsIgnoreCase("SSL")) { + return true; + } + } + } + return false; + } catch (nitro_exception e){ + throw new ExecutionException("Failed to check ssl feature on load balancer due to " + e.getMessage()); + } catch (Exception e){ + throw new ExecutionException("Failed to check ssl feature on load balancer due to " + e.getMessage()); + } + } + + + } + private void enableVPXInterfaces(String publicIf, String privateIf, ns ns_obj) { // enable VPX to use 10 gigabit Ethernet interfaces if public/private interface @@ -2110,6 +2327,25 @@ public class NetscalerResource implements ServerResource { } } + private boolean nsVirtualServerExists(String vserverName) throws ExecutionException { + try { + if (com.citrix.netscaler.nitro.resource.config.lb.lbvserver.get(_netscalerService, vserverName) != null) { + return true; + } else { + return false; + } + } catch (nitro_exception e) { + if (e.getErrorCode() == NitroError.NS_RESOURCE_NOT_EXISTS) { + return false; + } else { + throw new ExecutionException("Failed to verify VServer " + vserverName + " exists on the NetScaler device due to " + e.getMessage()); + } + } catch (Exception e) { + throw new ExecutionException("Failed to verify VServer " + vserverName + " exists on the NetScaler device due to " + e.getMessage()); + } + } + + private boolean nsVlanNsipBindingExists(long vlanTag, String vlanSelfIp) throws ExecutionException { try { vlan_nsip_binding[] vlanNsipBindings = vlan_nsip_binding.get(_netscalerService, vlanTag); @@ -2308,11 +2544,14 @@ public class NetscalerResource implements ServerResource { private String getNetScalerProtocol(LoadBalancerTO loadBalancer) throws ExecutionException { String port = Integer.toString(loadBalancer.getSrcPort()); - String lbProtocol = loadBalancer.getProtocol(); + String lbProtocol = loadBalancer.getLbProtocol(); StickinessPolicyTO[] stickyPolicies = loadBalancer.getStickinessPolicies(); String nsProtocol = "TCP"; - if ((stickyPolicies != null) && (stickyPolicies.length > 0) && (stickyPolicies[0] != null)){ + if(lbProtocol == null) + lbProtocol = loadBalancer.getProtocol(); + + if ((stickyPolicies != null) && (stickyPolicies.length > 0) && (stickyPolicies[0] != null)){ StickinessPolicyTO stickinessPolicy = stickyPolicies[0]; if (StickinessMethodType.LBCookieBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName()) || (StickinessMethodType.AppCookieBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName()))) { @@ -2321,6 +2560,10 @@ public class NetscalerResource implements ServerResource { } } + + if( lbProtocol.equalsIgnoreCase(NetUtils.SSL_PROTO) || lbProtocol.equalsIgnoreCase(NetUtils.HTTP_PROTO)) + return lbProtocol.toUpperCase(); + if (port.equals(NetUtils.HTTP_PORT)) { nsProtocol = "HTTP"; } else if (NetUtils.TCP_PROTO.equalsIgnoreCase(lbProtocol)) { @@ -3381,6 +3624,18 @@ public class NetscalerResource implements ServerResource { return counterName.replace(' ', '_'); } + private String generateSslCertName(String srcIp, long srcPort) { + // maximum length supported by NS is 31 + return genObjectName("Cloud-Cert", srcIp, srcPort); + } + + private String generateSslKeyName(String srcIp, long srcPort) { + return genObjectName("Cloud-Key", srcIp, srcPort); + } + private String generateSslCertKeyName(String srcIp, long srcPort) { + return genObjectName("Cloud-CertKey", srcIp, srcPort); + } + private String genObjectName(Object... args) { String objectName = ""; for (int i = 0; i < args.length; i++) { diff --git a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml index 5e3790825cb..f7a8d6795cd 100644 --- a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml +++ b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml @@ -223,4 +223,6 @@ + + diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java index 6ca40c01e98..8d54541dd62 100644 --- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java +++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java @@ -899,7 +899,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase if ((destinations != null && !destinations.isEmpty()) || rule.isAutoScaleConfig()) { boolean inline = _networkMgr.isNetworkInlineMode(network); LoadBalancerTO loadBalancer = new LoadBalancerTO(uuid, srcIp, srcPort, protocol, algorithm, revoked, false, inline, destinations, rule.getStickinessPolicies(), - rule.getHealthCheckPolicies()); + rule.getHealthCheckPolicies(), rule.getLbSslCert(), rule.getLbProtocol()); if (rule.isAutoScaleConfig()) { loadBalancer.setAutoScaleVmGroup(rule.getAutoScaleVmGroup()); } @@ -1184,7 +1184,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase if ((destinations != null && !destinations.isEmpty()) || !rule.isAutoScaleConfig()) { boolean inline = _networkMgr.isNetworkInlineMode(network); LoadBalancerTO loadBalancer = new LoadBalancerTO(uuid, srcIp, srcPort, protocol, algorithm, revoked, - false, inline, destinations, rule.getStickinessPolicies(), rule.getHealthCheckPolicies()); + false, inline, destinations, rule.getStickinessPolicies(), rule.getHealthCheckPolicies(), rule.getLbSslCert(), rule.getLbProtocol()); loadBalancersToApply.add(loadBalancer); } } @@ -1218,5 +1218,5 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase } } return null; - } + } } diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index 0d434784505..a1650e07109 100755 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -107,6 +107,9 @@ import com.cloud.network.dao.LoadBalancerVO; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkServiceMapDao; import com.cloud.network.dao.NetworkVO; +import com.cloud.network.dao.LoadBalancerCertMapDao; +import com.cloud.network.dao.LoadBalancerCertMapVO; +import com.cloud.network.dao.SslCertVO; import com.cloud.network.element.LoadBalancingServiceProvider; import com.cloud.network.lb.LoadBalancingRule.LbAutoScalePolicy; import com.cloud.network.lb.LoadBalancingRule.LbAutoScaleVmGroup; @@ -115,6 +118,7 @@ import com.cloud.network.lb.LoadBalancingRule.LbCondition; import com.cloud.network.lb.LoadBalancingRule.LbDestination; import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy; import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy; +import com.cloud.network.lb.LoadBalancingRule.LbSslCert; import com.cloud.network.rules.FirewallManager; import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.FirewallRule.FirewallRuleType; @@ -253,6 +257,9 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements IpAddressManager _ipAddrMgr; @Inject EntityManager _entityMgr; + @Inject + LoadBalancerCertMapDao _lbCertMapDao; + // Will return a string. For LB Stickiness this will be a json, for // autoscale this will be "," separated values @@ -350,7 +357,7 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements */ List policyList = getStickinessPolicies(lb.getId()); Ip sourceIp = getSourceIp(lb); - LoadBalancingRule rule = new LoadBalancingRule(lb, null, policyList, null, sourceIp); + LoadBalancingRule rule = new LoadBalancingRule(lb, null, policyList, null, sourceIp, null, lb.getLbProtocol()); rule.setAutoScaleVmGroup(lbAutoScaleVmGroup); if (!isRollBackAllowedForProvider(lb)) { @@ -558,7 +565,7 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements policyList.add(new LbStickinessPolicy(cmd.getStickinessMethodName(), lbpolicy.getParams())); Ip sourceIp = getSourceIp(loadBalancer); LoadBalancingRule lbRule = new LoadBalancingRule(loadBalancer, getExistingDestinations(lbpolicy.getId()), - policyList, null, sourceIp); + policyList, null, sourceIp,null, loadBalancer.getLbProtocol()); if (!validateLbRule(lbRule)) { throw new InvalidParameterValueException("Failed to create Stickiness policy: Validation Failed " + cmd.getLbRuleId()); @@ -905,7 +912,7 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements // hashealtChecks if (hcPolicyList != null && hcPolicyList.size() > 0) { Ip sourceIp = getSourceIp(lb); - LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, null, hcPolicyList, sourceIp); + LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, null, hcPolicyList, sourceIp, null, lb.getLbProtocol()); lbrules.add(loadBalancing); } } @@ -1087,12 +1094,161 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements return success; } + @Override + public boolean assignSSLCertToLoadBalancerRule(Long lbId, String certName, String publicCert, String privateKey) { + s_logger.error("Calling the manager for LB"); + LoadBalancerVO loadBalancer = _lbDao.findById(lbId); + + return false; //TODO + } + @Override @ActionEvent(eventType = EventTypes.EVENT_REMOVE_FROM_LOAD_BALANCER_RULE, eventDescription = "removing from load balancer", async = true) public boolean removeFromLoadBalancer(long loadBalancerId, List instanceIds) { return removeFromLoadBalancerInternal(loadBalancerId, instanceIds, true); } + @Override + public LbSslCert getLbSslCert(long lbRuleId) { + LoadBalancerCertMapVO lbCertMap = _lbCertMapDao.findByLbRuleId(lbRuleId); + + if ( lbCertMap == null) + return null; + + SslCertVO certVO = _entityMgr.findById(SslCertVO.class, lbCertMap.getCertId()); + if ( certVO == null) { + s_logger.warn("Cert rule with cert ID " + lbCertMap.getCertId() + " but Cert is not found"); + return null; + } + + return new LbSslCert(certVO.getCertificate(), certVO.getKey(), + certVO.getChain(), certVO.getPassword(), lbCertMap.isRevoke()); + } + + @Override + @DB + @ActionEvent(eventType = EventTypes.EVENT_LB_CERT_ASSIGN, eventDescription = "assigning certificate to load balancer", async = true) + public boolean assignCertToLoadBalancer(long lbRuleId, Long certId) { + CallContext caller = CallContext.current(); + + LoadBalancerVO loadBalancer = _lbDao.findById(Long.valueOf(lbRuleId)); + if (loadBalancer == null) { + throw new InvalidParameterException("Invalid load balancer id: " + lbRuleId); + } + + SslCertVO certVO = _entityMgr.findById(SslCertVO.class,certId); + if (certVO == null) { + throw new InvalidParameterException("Invalid certificate id: " + certId); + } + + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); + + // check if LB and Cert belong to the same account + if( loadBalancer.getAccountId() != certVO.getAccountId() ){ + throw new InvalidParameterValueException("Access denied for account " + certVO.getAccountId()); + } + + + String capability = getLBCapability(loadBalancer.getNetworkId(), Capability.SslTermination.getName()); + if ( capability == null){ + throw new InvalidParameterValueException("Ssl termination not supported by the loadbalancer"); + } + + //check if the lb is already bound + LoadBalancerCertMapVO certMapRule = _lbCertMapDao.findByLbRuleId(loadBalancer.getId()); + if (certMapRule != null) + throw new InvalidParameterValueException("Another certificate is already bound to the LB"); + + //check for correct port + if ( loadBalancer.getLbProtocol() == null || !(loadBalancer.getLbProtocol().equals(NetUtils.SSL_PROTO))) + throw new InvalidParameterValueException("Bad LB protocol: Expected ssl got " + loadBalancer.getLbProtocol()); + + + boolean success = false; + FirewallRule.State backupState = loadBalancer.getState(); + + try { + + loadBalancer.setState(FirewallRule.State.Add); + _lbDao.persist(loadBalancer); + LoadBalancerCertMapVO certMap = new LoadBalancerCertMapVO(lbRuleId,certId,false); + _lbCertMapDao.persist(certMap); + applyLoadBalancerConfig(loadBalancer.getId()); + /*s_logger.warn("Failed to apply Ssl Cert to LB " + loadBalancer.getId()); + CloudRuntimeException ex = new CloudRuntimeException( + "Failed to apply Ssl Cert to LB " + loadBalancer.getId()); + ex.addProxyObject(loadBalancer.getUuid(), "loadBalancerId"); + throw ex;*/ + success = true; + } catch (ResourceUnavailableException e) { + if (isRollBackAllowedForProvider(loadBalancer)) { + + loadBalancer.setState(backupState); + _lbDao.persist(loadBalancer); + LoadBalancerCertMapVO certMap = _lbCertMapDao.findByLbRuleId(lbRuleId); + _lbCertMapDao.remove(certMap.getId()); + s_logger.debug("LB Rollback rule id: " + loadBalancer.getId() + " while adding cert"); + } + s_logger.warn("Unable to apply the load balancer config because resource is unavaliable.", e); + } + return success; + } + + @Override + @DB + @ActionEvent(eventType = EventTypes.EVENT_LB_CERT_REMOVE, eventDescription = "removing certificate from load balancer", async = true) + public boolean removeCertFromLoadBalancer(long lbRuleId) { + CallContext caller = CallContext.current(); + + LoadBalancerVO loadBalancer = _lbDao.findById(lbRuleId); + LoadBalancerCertMapVO lbCertMap = _lbCertMapDao.findByLbRuleId(lbRuleId); + + if (loadBalancer == null) { + throw new InvalidParameterException("Invalid load balancer value: " + lbRuleId); + } + + if( lbCertMap == null ) { + throw new InvalidParameterException("No certificate is bound to lb with id: " + lbRuleId); + } + + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); + + boolean success = false; + FirewallRule.State backupState = loadBalancer.getState(); + try { + + loadBalancer.setState(FirewallRule.State.Add); + _lbDao.persist(loadBalancer); + lbCertMap.setRevoke(true); + _lbCertMapDao.persist(lbCertMap); + + if (!applyLoadBalancerConfig(lbRuleId)) { + s_logger.warn("Failed to remove cert from load balancer rule id " + lbRuleId); + CloudRuntimeException ex = new CloudRuntimeException( + "Failed to remove certificate load balancer rule id " + lbRuleId); + ex.addProxyObject(loadBalancer.getUuid(), "loadBalancerId"); + throw ex; + } + success = true; + } catch (ResourceUnavailableException e) { + if (isRollBackAllowedForProvider(loadBalancer)) { + lbCertMap.setRevoke(false); + _lbCertMapDao.persist(lbCertMap); + loadBalancer.setState(backupState); + _lbDao.persist(loadBalancer); + s_logger.debug("Rolled back certificate removal lb id " + lbRuleId); + } + s_logger.warn("Unable to apply the load balancer config because resource is unavaliable.", e); + if (!success) { + CloudRuntimeException ex = new CloudRuntimeException( + "Failed to remove certificate from load balancer rule id " + lbRuleId); + ex.addProxyObject(loadBalancer.getUuid(), "loadBalancerId"); + throw ex; + } + } + return success; + } + private boolean removeFromLoadBalancerInternal(long loadBalancerId, List instanceIds, boolean rollBack) { CallContext caller = CallContext.current(); @@ -1317,7 +1473,8 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements @Override @ActionEvent(eventType = EventTypes.EVENT_LOAD_BALANCER_CREATE, eventDescription = "creating load balancer") public LoadBalancer createPublicLoadBalancerRule(String xId, String name, String description, - int srcPortStart, int srcPortEnd, int defPortStart, int defPortEnd, Long ipAddrId, String protocol, String algorithm, long networkId, long lbOwnerId, boolean openFirewall) + int srcPortStart, int srcPortEnd, int defPortStart, int defPortEnd, Long ipAddrId, String protocol, String algorithm, + long networkId, long lbOwnerId, boolean openFirewall, String lbProtocol) throws NetworkRuleConflictException, InsufficientAddressCapacityException { Account lbOwner = _accountMgr.getAccount(lbOwnerId); @@ -1377,7 +1534,8 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements + network); } - result = createPublicLoadBalancer(xId, name, description, srcPortStart, defPortStart, ipVO.getId(), protocol, algorithm, openFirewall, CallContext.current()); + result = createPublicLoadBalancer(xId, name, description, srcPortStart, defPortStart, ipVO.getId(), protocol, + algorithm, openFirewall, CallContext.current(), lbProtocol); } catch (Exception ex) { s_logger.warn("Failed to create load balancer due to ", ex); if (ex instanceof NetworkRuleConflictException) { @@ -1407,13 +1565,14 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements @DB @Override public LoadBalancer createPublicLoadBalancer(final String xId, final String name, final String description, - final int srcPort, final int destPort, final long sourceIpId, final String protocol, final String algorithm, final boolean openFirewall, final CallContext caller) + final int srcPort, final int destPort, final long sourceIpId, final String protocol, + final String algorithm, final boolean openFirewall, final CallContext caller, final String lbProtocol) throws NetworkRuleConflictException { if (!NetUtils.isValidPort(destPort)) { throw new InvalidParameterValueException("privatePort is an invalid value: " + destPort); } - + if ((algorithm == null) || !NetUtils.isValidAlgorithm(algorithm)) { throw new InvalidParameterValueException("Invalid algorithm: " + algorithm); } @@ -1454,18 +1613,29 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements _firewallMgr.validateFirewallRule(caller.getCallingAccount(), ipAddr, srcPort, srcPort, protocol, Purpose.LoadBalancing, FirewallRuleType.User, networkId, null); + LoadBalancerVO newRule = new LoadBalancerVO(xId, name, description, + sourceIpId, srcPort, destPort, algorithm, + networkId, ipAddr.getAllocatedToAccountId(), ipAddr.getAllocatedInDomainId(), lbProtocol); + + // verify rule is supported by Lb provider of the network + Ip sourceIp = getSourceIp(newRule); + LoadBalancingRule loadBalancing = new LoadBalancingRule(newRule, new ArrayList(), + new ArrayList(), new ArrayList(), sourceIp, null, lbProtocol); + if (!validateLbRule(loadBalancing)) { + throw new InvalidParameterValueException("LB service provider cannot support this rule"); + } return Transaction.execute(new TransactionCallbackWithException() { @Override public LoadBalancerVO doInTransaction(TransactionStatus status) throws NetworkRuleConflictException { LoadBalancerVO newRule = new LoadBalancerVO(xId, name, description, sourceIpId, srcPort, destPort, algorithm, - networkId, ipAddr.getAllocatedToAccountId(), ipAddr.getAllocatedInDomainId()); + networkId, ipAddr.getAllocatedToAccountId(), ipAddr.getAllocatedInDomainId(), lbProtocol); // verify rule is supported by Lb provider of the network Ip sourceIp = getSourceIp(newRule); LoadBalancingRule loadBalancing = new LoadBalancingRule(newRule, new ArrayList(), - new ArrayList(), new ArrayList(), sourceIp); + new ArrayList(), new ArrayList(), sourceIp, null, lbProtocol); if (!validateLbRule(loadBalancing)) { throw new InvalidParameterValueException("LB service provider cannot support this rule"); } @@ -1510,7 +1680,6 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements } - @Override public boolean applyLoadBalancerConfig(long lbRuleId) throws ResourceUnavailableException { LoadBalancerVO lb = _lbDao.findById(lbRuleId); List lbs; @@ -1576,7 +1745,8 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements List policyList = getStickinessPolicies(lb.getId()); Ip sourceIp = getSourceIp(lb); - LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, null, policyList, null, sourceIp); + LbSslCert sslCert = getLbSslCert(lb.getId()); + LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, null, policyList, null, sourceIp, sslCert, lb.getLbProtocol()); if (_autoScaleVmGroupDao.isAutoScaleLoadBalancer(lb.getId())) { // Get the associated VmGroup @@ -1659,7 +1829,13 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements _lb2healthcheckDao.remove(lb.getId(), true); s_logger.debug("Load balancer rule id " + lb.getId() + " is removed health check monitors policies"); } - + + LoadBalancerCertMapVO lbCertMap = _lbCertMapDao.findByLbRuleId(lb.getId()); + if (lbCertMap != null && lbCertMap.isRevoke()) { + _lbCertMapDao.remove(lbCertMap.getId()); + s_logger.debug("Load balancer rule id " + lb.getId() + " removed certificate mapping"); + } + return checkForReleaseElasticIp; } }); diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 617d6ac8f3e..b8d0babe3f9 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -187,6 +187,7 @@ import com.cloud.network.lb.LoadBalancingRule; import com.cloud.network.lb.LoadBalancingRule.LbDestination; import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy; import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy; +import com.cloud.network.lb.LoadBalancingRule.LbSslCert; import com.cloud.network.lb.LoadBalancingRulesManager; import com.cloud.network.router.VirtualRouter.RedundantState; import com.cloud.network.router.VirtualRouter.Role; @@ -2544,7 +2545,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V List policyList = _lbMgr.getStickinessPolicies(lb.getId()); List hcPolicyList = _lbMgr.getHealthCheckPolicies(lb.getId()); Ip sourceIp = _networkModel.getPublicIpAddress(lb.getSourceIpAddressId()).getAddress(); - LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, policyList, hcPolicyList, sourceIp); + LbSslCert sslCert = _lbMgr.getLbSslCert(lb.getId()); + LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, policyList, hcPolicyList, sourceIp, sslCert, lb.getLbProtocol()); lbRules.add(loadBalancing); } } @@ -3680,8 +3682,11 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V List dstList = _lbMgr.getExistingDestinations(lb.getId()); List policyList = _lbMgr.getStickinessPolicies(lb.getId()); List hcPolicyList = _lbMgr.getHealthCheckPolicies(lb.getId()); + LbSslCert sslCert = _lbMgr.getLbSslCert(lb.getId()); Ip sourceIp = _networkModel.getPublicIpAddress(lb.getSourceIpAddressId()).getAddress(); - LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, policyList, hcPolicyList, sourceIp); + LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, policyList, hcPolicyList, sourceIp, + sslCert, lb.getLbProtocol()); + lbRules.add(loadBalancing); } return sendLBRules(router, lbRules, network.getId()); @@ -3716,8 +3721,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V List dstList = _lbMgr.getExistingDestinations(lb.getId()); List policyList = _lbMgr.getStickinessPolicies(lb.getId()); List hcPolicyList = _lbMgr.getHealthCheckPolicies(lb.getId()); + LbSslCert sslCert = _lbMgr.getLbSslCert(lb.getId()); Ip sourceIp = _networkModel.getPublicIpAddress(lb.getSourceIpAddressId()).getAddress(); - LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, policyList, hcPolicyList, sourceIp); + LoadBalancingRule loadBalancing = new LoadBalancingRule(lb, dstList, policyList, hcPolicyList, sourceIp, sslCert, lb.getLbProtocol()); lbRules.add(loadBalancing); } return sendLBRules(router, lbRules, network.getId()); diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 35bc6813c03..d083c11eceb 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -287,6 +287,11 @@ import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRuleI import org.apache.cloudstack.api.command.user.loadbalancer.ListLoadBalancerRulesCmd; import org.apache.cloudstack.api.command.user.loadbalancer.RemoveFromLoadBalancerRuleCmd; import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRuleCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.AssignCertToLoadBalancerCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.RemoveCertFromLoadBalancerCmd; import org.apache.cloudstack.api.command.user.nat.CreateIpForwardingRuleCmd; import org.apache.cloudstack.api.command.user.nat.DeleteIpForwardingRuleCmd; import org.apache.cloudstack.api.command.user.nat.DisableStaticNatCmd; @@ -2876,6 +2881,11 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe cmdList.add(UpdateNetworkACLItemCmd.class); cmdList.add(CleanVMReservationsCmd.class); cmdList.add(UpgradeRouterTemplateCmd.class); + cmdList.add(UploadSslCertCmd.class); + cmdList.add(DeleteSslCertCmd.class); + cmdList.add(ListSslCertsCmd.class); + cmdList.add(AssignCertToLoadBalancerCmd.class); + cmdList.add(RemoveCertFromLoadBalancerCmd.class); return cmdList; } diff --git a/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java b/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java index b7cd231831c..f0f0a6efbf2 100644 --- a/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java +++ b/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java @@ -146,7 +146,7 @@ public class ApplicationLoadBalancerManagerImpl extends ManagerBase implements A //4) Validate Load Balancing rule on the providers LoadBalancingRule loadBalancing = new LoadBalancingRule(newRule, new ArrayList(), - new ArrayList(), new ArrayList(), sourceIpAddr); + new ArrayList(), new ArrayList(), sourceIpAddr, null, null); if (!_lbMgr.validateLbRule(loadBalancing)) { throw new InvalidParameterValueException("LB service provider cannot support this rule"); } diff --git a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java new file mode 100644 index 00000000000..53dae507bbb --- /dev/null +++ b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java @@ -0,0 +1,477 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.network.lb; + +import com.cloud.event.ActionEvent; +import com.cloud.event.EventTypes; +import com.cloud.network.dao.*; +import com.cloud.network.lb.CertService; +import com.cloud.network.rules.LoadBalancer; +import com.cloud.user.dao.AccountDao; +import com.cloud.utils.db.EntityManager; +import com.cloud.utils.exception.CloudRuntimeException; +import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; +import org.apache.cloudstack.api.response.SslCertResponse; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.user.Account; +import com.cloud.user.AccountManager; +import com.cloud.utils.db.DB; +import org.apache.cloudstack.acl.SecurityChecker; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.openssl.PEMReader; +import org.bouncycastle.openssl.PasswordFinder; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.ejb.Local; +import javax.inject.Inject; +import java.io.IOException; +import java.io.StringReader; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.security.*; +import java.security.cert.*; +import java.security.cert.Certificate; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@Local(value = {CertService.class}) +public class CertServiceImpl implements CertService { + + private static final Logger s_logger = Logger.getLogger(CertServiceImpl.class); + + @Inject AccountManager _accountMgr; + @Inject AccountDao _accountDao; + @Inject SslCertDao _sslCertDao; + @Inject LoadBalancerCertMapDao _lbCertDao; + @Inject EntityManager _entityMgr; + + + + public CertServiceImpl() { + Security.addProvider(new BouncyCastleProvider()); + } + + @DB + @Override + @ActionEvent(eventType = EventTypes.EVENT_LB_CERT_UPLOAD, eventDescription = "Uploading a certificate to cloudstack", async = false) + public SslCertResponse uploadSslCert(UploadSslCertCmd certCmd) { + try { + + String cert = URLDecoder.decode(certCmd.getCert(), "UTF-8"); + String key = URLDecoder.decode(certCmd.getKey(), "UTF-8"); + String password = certCmd.getPassword(); + String chain = certCmd.getChain() == null ? null: URLDecoder.decode(certCmd.getChain(), "UTF-8"); + + validate(cert, key, password, chain); + s_logger.debug("Certificate Validation succeeded"); + String fingerPrint = generateFingerPrint(parseCertificate(cert)); + + Long accountId = CallContext.current().getCallingAccount().getId(); + Long domainId = CallContext.current().getCallingAccount().getDomainId(); + + + SslCertVO certVO = new SslCertVO(cert, key, password, chain, accountId, domainId, fingerPrint); + _sslCertDao.persist(certVO); + + + return createCertResponse(certVO, null); + + } catch (UnsupportedEncodingException e) { + throw new CloudRuntimeException("Error decoding certificate data"); + } + + } + + @DB + @Override + @ActionEvent(eventType = EventTypes.EVENT_LB_CERT_DELETE, eventDescription = "Deleting a certificate to cloudstack", async = false) + public void deleteSslCert(DeleteSslCertCmd deleteSslCertCmd) { + + CallContext ctx = CallContext.current(); + Account caller = ctx.getCallingAccount(); + + Long certId = deleteSslCertCmd.getId(); + SslCertVO certVO = _sslCertDao.findById(certId); + + if (certVO == null) { + throw new InvalidParameterValueException("Invalid certificate id: " + certId); + } + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.ModifyEntry, true, certVO); + + List lbCertRule = _lbCertDao.listByCertId(certId); + + if ( (lbCertRule != null) && (!lbCertRule.isEmpty()) ){ + String lbUuids = ""; + + for( LoadBalancerCertMapVO rule : lbCertRule ){ + LoadBalancerVO lb = _entityMgr.findById(LoadBalancerVO.class, rule.getLbId()); + lbUuids += " " + lb.getUuid(); + } + + throw new CloudRuntimeException("Certificate in use by a loadbalancer(s)" + lbUuids); + } + + _sslCertDao.remove(certId); + } + + @Override + public List listSslCerts(ListSslCertsCmd listSslCertCmd) { + CallContext ctx = CallContext.current(); + Account caller = ctx.getCallingAccount(); + + Long certId= listSslCertCmd.getCertId(); + Long accountId = listSslCertCmd.getAccountId(); + Long lbRuleId = listSslCertCmd.getLbId(); + + List certResponseList = new ArrayList(); + + if (certId == null && accountId == null && lbRuleId == null ) { + throw new InvalidParameterValueException("Invalid parameters either certificate ID or Account ID or Loadbalancer ID required"); + } + + List certLbMap = null; + SslCertVO certVO = null; + + + if(certId != null) { + + certVO = _sslCertDao.findById(certId); + + if (certVO == null) { + throw new InvalidParameterValueException("Invalid certificate id: " + certId); + } + + + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.ListEntry, true, certVO); + + certLbMap = _lbCertDao.listByCertId(certId); + + certResponseList.add(createCertResponse(certVO, certLbMap)); + return certResponseList; + } + + if ( lbRuleId != null) { + LoadBalancer lb = _entityMgr.findById(LoadBalancerVO.class, lbRuleId); + + if ( lb == null ){ + throw new InvalidParameterValueException("found no loadbalancer wth id: " + lbRuleId); + } + + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.ListEntry, true, lb); + + // get the cert id + LoadBalancerCertMapVO lbCertMapRule; + lbCertMapRule = _lbCertDao.findByLbRuleId(lbRuleId); + + if (lbCertMapRule == null) { + throw new InvalidParameterValueException("No certificate bound to loadbalancer id: " + lbRuleId); + } + + certVO = _sslCertDao.findById(lbCertMapRule.getCertId()); + certLbMap = _lbCertDao.listByCertId(lbCertMapRule.getCertId()); + + certResponseList.add(createCertResponse(certVO, certLbMap)); + return certResponseList; + + } + + //reached here look by accountId + List certVOList = _sslCertDao.listByAccountId(accountId); + if ( certVOList == null || certVOList.isEmpty()) + return certResponseList; + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.ListEntry, true, certVOList.get(0)); + + for( SslCertVO cert : certVOList ){ + certLbMap = _lbCertDao.listByCertId(cert.getId()); + certResponseList.add(createCertResponse(cert, certLbMap)); + } + + return certResponseList; + } + + + private void validate(String _cert, String _key, String _password, String _chain) { + Certificate cert; + PrivateKey key; + List chain=null; + + + try { + cert = parseCertificate(_cert); + key = parsePrivateKey(_key, _password); + + if ( _chain != null) { + chain = parseChain(_chain); + } + + } catch (IOException e) { + throw new IllegalArgumentException("Parsing certificate/key failed: " + e.getMessage()); + } + + validateCert(cert, _chain != null? true: false); + validateKeys(cert.getPublicKey(), key); + + if ( _chain != null ) + validateChain(chain, cert); + } + + public SslCertResponse createCertResponse(SslCertVO cert, List lbCertMap) { + SslCertResponse response = new SslCertResponse(); + + Account account = _accountDao.findByIdIncludingRemoved(cert.getAccountId()); + + response.setObjectName("sslcert"); + response.setId(cert.getUuid()); + response.setCertificate(cert.getCertificate()); + response.setPrivatekey(cert.getKey()); + response.setFingerprint(cert.getFingerPrint()); + response.setAccountName(account.getAccountName()); + + if ( cert.getChain() != null) + response.setCertchain(cert.getChain()); + + if ( lbCertMap != null && !lbCertMap.isEmpty()){ + List lbIds = new ArrayList(); + for ( LoadBalancerCertMapVO mapVO : lbCertMap ) { + LoadBalancer lb = _entityMgr.findById(LoadBalancerVO.class, mapVO.getLbId()); + lbIds.add(lb.getUuid()); + } + response.setLbIds(lbIds); + } + + return response; + } + + private void validateCert(Certificate cert, boolean chain_present) { + + if ( !( cert instanceof X509Certificate)) + throw new IllegalArgumentException("Invalid certificate format. Expected X509 certificate"); + + try { + ((X509Certificate)cert).checkValidity(); + } catch (Exception e) { + throw new IllegalArgumentException("Certificate expired or not valid"); + } + + if( !chain_present ) { + PublicKey pubKey = cert.getPublicKey(); + try { + cert.verify(pubKey); + } catch (Exception e) { + throw new IllegalArgumentException("No chain given and certificate not self signed"); + } + } + } + + private void validateKeys(PublicKey pubKey, PrivateKey privKey) { + + if (pubKey.getAlgorithm() != privKey.getAlgorithm()) + throw new IllegalArgumentException("Public and private key have different algorithms"); + + // No encryption for DSA + if ( pubKey.getAlgorithm() != "RSA") + return; + + try { + + String data = "ENCRYPT_DATA"; + SecureRandom random = new SecureRandom(); + Cipher cipher = Cipher.getInstance(pubKey.getAlgorithm()); + cipher.init(Cipher.ENCRYPT_MODE,privKey,random); + byte[] encryptedData = cipher.doFinal(data.getBytes()); + + cipher.init(Cipher.DECRYPT_MODE,pubKey,random); + String decreptedData = new String(cipher.doFinal(encryptedData)); + if (!decreptedData.equals(data)) + throw new IllegalArgumentException("Bad public-private key"); + + } catch (BadPaddingException e) { + throw new IllegalArgumentException("Bad public-private key"); + } catch (IllegalBlockSizeException e) { + throw new IllegalArgumentException("Bad public-private key"); + } catch (NoSuchPaddingException e) { + throw new IllegalArgumentException("Bad public-private key"); + } catch (InvalidKeyException e) { + throw new IllegalArgumentException("Invalid public-private key"); + } catch (NoSuchAlgorithmException e) { + throw new IllegalArgumentException("Invalid algorithm for public-private key"); + } + } + + + private void validateChain(List chain, Certificate cert) { + + List certs = new ArrayList(); + List root = new ArrayList(); + + Set anchors = new HashSet(); + + + certs.add(cert); // adding for self signed certs + certs.addAll(chain); + + for( Certificate c : certs) { + if ( !( c instanceof X509Certificate)) + throw new IllegalArgumentException("Invalid chain format. Expected X509 certificate"); + + X509Certificate xCert = (X509Certificate)c; + + Principal subject = xCert.getSubjectDN(); + Principal issuer = xCert.getIssuerDN(); + + if( issuer != null && subject.equals(issuer) ) { + root.add(c); + anchors.add(new TrustAnchor(xCert,null)); + } + } + + if ( root.size() == 0 ) + throw new IllegalArgumentException("No root certificates found for certificate chain",null); + + + X509CertSelector target = new X509CertSelector(); + target.setCertificate((X509Certificate)cert); + + PKIXBuilderParameters params = null; + try { + params = new PKIXBuilderParameters(anchors, target); + params.setRevocationEnabled(false); + params.addCertStore(CertStore.getInstance("Collection", new CollectionCertStoreParameters(certs))); + CertPathBuilder builder = CertPathBuilder.getInstance("PKIX"); + builder.build(params); + } catch (InvalidAlgorithmParameterException e) { + throw new IllegalArgumentException("Invalid certificate chain",null); + } catch (CertPathBuilderException e) { + throw new IllegalArgumentException("Invalid certificate chain",null); + } catch (NoSuchAlgorithmException e) { + throw new IllegalArgumentException("Invalid certificate chain",null); + } + + } + + public PrivateKey parsePrivateKey(String key, String password) throws IOException { + + PasswordFinder pGet = null; + + if( password != null ) + pGet = new KeyPassword(password.toCharArray()); + + PEMReader privateKey = new PEMReader(new StringReader(key), pGet); + Object obj = privateKey.readObject(); + + try { + + if ( obj instanceof KeyPair ) + return ((KeyPair)obj).getPrivate(); + + return (PrivateKey) obj; + + }catch (Exception e){ + e.printStackTrace(); + throw new IOException("Invalid Key format or invalid password."); + } + } + + + public Certificate parseCertificate(String cert) { + PEMReader certPem = new PEMReader(new StringReader(cert)); + try { + return (Certificate) certPem.readObject(); + } catch (Exception e) { + throw new InvalidParameterValueException("Invalid Certificate format. Expected X509 certificate"); + } + } + + + public List parseChain(String chain) throws IOException { + + List certs = new ArrayList(); + PEMReader reader = new PEMReader(new StringReader(chain)); + + Certificate crt = null; + + while ( ( crt = (Certificate) reader.readObject()) != null ) { + if ( crt instanceof X509Certificate) { + certs.add(crt); + } + } + if ( certs.size() == 0 ) + throw new IllegalArgumentException("Unable to decode certificate chain",null); + + return certs; + } + + + String generateFingerPrint(Certificate cert) { + + final char[] HEX = + {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + + StringBuilder buffer = new StringBuilder(60); + try { + + MessageDigest md = MessageDigest.getInstance("SHA-1"); + byte[] data = md.digest(cert.getEncoded()); + + for ( int i = 0 ; i < data.length ; i++ ) { + if ( buffer.length() > 0 ) { + buffer.append(":"); + } + + buffer.append(HEX[(0xF0 & data[i]) >>> 4]); + buffer.append(HEX[0x0F & data[i]]); + } + + } catch (CertificateEncodingException e) { + throw new InvalidParameterValueException("Bad certificate encoding"); + } catch (NoSuchAlgorithmException e) { + throw new InvalidParameterValueException("Bad certificate algorithm"); + } + + return buffer.toString(); + } + + + public static class KeyPassword implements PasswordFinder { + + boolean password_requested=false; + char[] password; + + + KeyPassword(char[] word){ + this.password = word; + } + + public char[] getPassword() { + password_requested=true; + return password; + } + + public boolean getPasswordRequested(){ + return password_requested; + } + } +} \ No newline at end of file diff --git a/server/test/org/apache/cloudstack/lb/ApplicationLoadBalancerTest.java b/server/test/org/apache/cloudstack/network/lb/ApplicationLoadBalancerTest.java similarity index 99% rename from server/test/org/apache/cloudstack/lb/ApplicationLoadBalancerTest.java rename to server/test/org/apache/cloudstack/network/lb/ApplicationLoadBalancerTest.java index 9b46e683113..82b11817948 100644 --- a/server/test/org/apache/cloudstack/lb/ApplicationLoadBalancerTest.java +++ b/server/test/org/apache/cloudstack/network/lb/ApplicationLoadBalancerTest.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package org.apache.cloudstack.lb; +package org.apache.cloudstack.network.lb; import java.io.IOException; import java.lang.reflect.Field; @@ -25,6 +25,7 @@ import javax.inject.Inject; import junit.framework.TestCase; +import org.apache.cloudstack.lb.ApplicationLoadBalancerRuleVO; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -335,7 +336,7 @@ public class ApplicationLoadBalancerTest extends TestCase { public AccountManager accountManager() { return Mockito.mock(AccountManager.class); } - + @Bean public LoadBalancingRulesManager loadBalancingRulesManager() { diff --git a/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java b/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java new file mode 100644 index 00000000000..e47fc013f05 --- /dev/null +++ b/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java @@ -0,0 +1,791 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.network.lb; + +import com.cloud.network.dao.*; +import com.cloud.user.Account; +import com.cloud.user.AccountManager; +import com.cloud.user.AccountVO; +import com.cloud.user.UserVO; +import com.cloud.user.dao.AccountDao; +import com.cloud.utils.db.EntityManager; +import com.cloud.utils.db.Transaction; +import com.cloud.utils.db.TransactionLegacy; +import junit.framework.TestCase; +import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; + +import static org.apache.commons.io.FileUtils.readFileToString; +import static org.mockito.Matchers.*; +import static org.mockito.Mockito.when; + +public class CertServiceTest extends TestCase { + + private static final Logger s_logger = Logger.getLogger( CertServiceTest.class); + + @Override + @Before + public void setUp() { + Account account = new AccountVO("testaccount", 1, "networkdomain", (short)0, UUID.randomUUID().toString()); + UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString()); + CallContext.register(user, account); + } + + @Override + @After + public void tearDown() { + CallContext.unregister(); + } + + @Test + public void testUploadSslCert() throws Exception { + + /* Test1 : Given a Certificate in bad format (Not PEM), upload should fail */ + runUploadSslCertBadFormat(); + + /* Test2: Given a Certificate which is not X509, upload should fail */ + runUploadSslCertNotX509(); + + /* Test3: Given an expired certificate, upload should fail */ + runUploadSslCertExpiredCert(); + + /* Test4: Given a private key which has a different algorithm than the certificate, + upload should fail. + */ + runUploadSslCertBadkeyAlgo(); + + /* Test5: Given a private key which does not match the public key in the certificate, + upload should fail + */ + runUploadSslCertBadkeyPair(); + + /* Test6: Given an encrypted private key with a bad password. Upload should fail. */ + runUploadSslCertBadPassword(); + + /* Test7: If no chain is given, the certificate should be self signed. Else, uploadShould Fail */ + runUploadSslCertNoChain(); + + /* Test8: Chain is given but does not have root certificate */ + runUploadSslCertNoRootCert(); + + /* Test9: The chain given is not the correct chain for the certificate */ + runUploadSslCertBadChain(); + + /* Test10: Given a Self-signed Certificate with encrypted key, upload should succeed */ + runUploadSslCertSelfSignedNoPassword(); + + /* Test11: Given a Self-signed Certificate with non-encrypted key, upload should succeed */ + runUploadSslCertSelfSignedWithPassword(); + + /* Test12: Given a certificate signed by a CA and a valid CA chain, upload should succeed */ + runUploadSslCertWithCAChain(); + + } + + private void runUploadSslCertWithCAChain() throws Exception { + //To change body of created methods use File | Settings | File Templates. + + TransactionLegacy txn = TransactionLegacy.open("runUploadSslCertWithCAChain"); + + String certFile = getClass().getResource("/certs/rsa_ca_signed.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_ca_signed.key").getFile(); + String chainFile = getClass().getResource("/certs/root_chain.crt").getFile(); + String password = "user"; + + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String chain = URLEncoder.encode(readFileToString(new File(chainFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + + certService._accountDao = Mockito.mock(AccountDao.class); + when(certService._accountDao.findByIdIncludingRemoved(anyLong())).thenReturn((AccountVO)account); + + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + Field passField = _class.getDeclaredField("password"); + passField.setAccessible(true); + passField.set(uploadCmd, password); + + Field chainField = _class.getDeclaredField("chain"); + chainField.setAccessible(true); + chainField.set(uploadCmd, chain); + + certService.uploadSslCert(uploadCmd); + } + + private void runUploadSslCertSelfSignedWithPassword() throws Exception { + + TransactionLegacy txn = TransactionLegacy.open("runUploadSslCertSelfSignedWithPassword"); + + String certFile = getClass().getResource("/certs/rsa_self_signed_with_pwd.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_self_signed_with_pwd.key").getFile(); + String password = "test"; + + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + + certService._accountDao = Mockito.mock(AccountDao.class); + when(certService._accountDao.findByIdIncludingRemoved(anyLong())).thenReturn((AccountVO)account); + + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + Field passField = _class.getDeclaredField("password"); + passField.setAccessible(true); + passField.set(uploadCmd, password); + + certService.uploadSslCert(uploadCmd); + } + + private void runUploadSslCertSelfSignedNoPassword() throws Exception { + + TransactionLegacy txn = TransactionLegacy.open("runUploadSslCertSelfSignedNoPassword"); + + String certFile = getClass().getResource("/certs/rsa_self_signed.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_self_signed.key").getFile(); + + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + + certService._accountDao = Mockito.mock(AccountDao.class); + when(certService._accountDao.findByIdIncludingRemoved(anyLong())).thenReturn((AccountVO)account); + + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + certService.uploadSslCert(uploadCmd); + } + + + private void runUploadSslCertBadChain() throws IOException, IllegalAccessException, NoSuchFieldException { + //To change body of created methods use File | Settings | File Templates. + String certFile = getClass().getResource("/certs/rsa_ca_signed.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_ca_signed.key").getFile(); + String chainFile = getClass().getResource("/certs/rsa_self_signed.crt").getFile(); + String password = "user"; + + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String chain = URLEncoder.encode(readFileToString(new File(chainFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + Field passField = _class.getDeclaredField("password"); + passField.setAccessible(true); + passField.set(uploadCmd, password); + + Field chainField = _class.getDeclaredField("chain"); + chainField.setAccessible(true); + chainField.set(uploadCmd, chain); + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("Invalid certificate chain")); + } + } + + private void runUploadSslCertNoRootCert() throws IOException, IllegalAccessException, NoSuchFieldException { + + //To change body of created methods use File | Settings | File Templates. + String certFile = getClass().getResource("/certs/rsa_ca_signed.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_ca_signed.key").getFile(); + String chainFile = getClass().getResource("/certs/rsa_ca_signed2.crt").getFile(); + String password = "user"; + + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String chain = URLEncoder.encode(readFileToString(new File(chainFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + Field passField = _class.getDeclaredField("password"); + passField.setAccessible(true); + passField.set(uploadCmd, password); + + Field chainField = _class.getDeclaredField("chain"); + chainField.setAccessible(true); + chainField.set(uploadCmd, chain); + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("No root certificates found")); + } + + } + + private void runUploadSslCertNoChain() throws IOException, IllegalAccessException, NoSuchFieldException { + + String certFile = getClass().getResource("/certs/rsa_ca_signed.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_ca_signed.key").getFile(); + String password = "user"; + + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + Field passField = _class.getDeclaredField("password"); + passField.setAccessible(true); + passField.set(uploadCmd, password); + + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("No chain given and certificate not self signed")); + } + + } + + private void runUploadSslCertBadPassword() throws IOException, IllegalAccessException, NoSuchFieldException { + + String certFile = getClass().getResource("/certs/rsa_self_signed_with_pwd.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_self_signed_with_pwd.key").getFile(); + String password = "bad_password"; + + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + Field passField = _class.getDeclaredField("password"); + passField.setAccessible(true); + passField.set(uploadCmd, password); + + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("please check password and data")); + } + + } + + private void runUploadSslCertBadkeyPair() throws IOException, IllegalAccessException, NoSuchFieldException { + // Reading appropritate files + String certFile = getClass().getResource("/certs/rsa_self_signed.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_random_pkey.key").getFile(); + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("Bad public-private key")); + } + } + + private void runUploadSslCertBadkeyAlgo() throws IOException, IllegalAccessException, NoSuchFieldException { + + // Reading appropritate files + String certFile = getClass().getResource("/certs/rsa_self_signed.crt").getFile(); + String keyFile = getClass().getResource("/certs/dsa_self_signed.key").getFile(); + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("Public and private key have different algorithms")); + } + } + + private void runUploadSslCertExpiredCert() throws IOException, IllegalAccessException, NoSuchFieldException { + + // Reading appropritate files + String certFile = getClass().getResource("/certs/expired_cert.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_self_signed.key").getFile(); + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("Certificate expired")); + } + } + + private void runUploadSslCertNotX509() throws IOException, IllegalAccessException, NoSuchFieldException { + // Reading appropritate files + String certFile = getClass().getResource("/certs/non_x509_pem.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_self_signed.key").getFile(); + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("Expected X509 certificate")); + } + } + + private void runUploadSslCertBadFormat() throws IOException, IllegalAccessException, NoSuchFieldException { + + // Reading appropritate files + String certFile = getClass().getResource("/certs/bad_format_cert.crt").getFile(); + String keyFile = getClass().getResource("/certs/rsa_self_signed.key").getFile(); + + String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); + String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.persist(any(SslCertVO.class))).thenReturn(new SslCertVO()); + + //creating the command + UploadSslCertCmd uploadCmd = new UploadSslCertCmdExtn(); + Class _class = uploadCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("cert"); + certField.setAccessible(true); + certField.set(uploadCmd, cert); + + Field keyField = _class.getDeclaredField("key"); + keyField.setAccessible(true); + keyField.set(uploadCmd, key); + + try { + certService.uploadSslCert(uploadCmd); + } catch (Exception e) { + assertTrue(e.getMessage().contains("Invalid certificate format")); + } + } + + + @Test + public void testDeleteSslCert() throws Exception { + /* Test1: Delete with an invalid ID should fail */ + runDeleteSslCertInvalidId(); + + /* Test2: Delete with a cert id bound to a lb should fail */ + runDeleteSslCertBoundCert(); + + /* Test3: Delete with a valid Id should succeed */ + runDeleteSslCertValid(); + + + } + + private void runDeleteSslCertValid() throws Exception { + + TransactionLegacy txn = TransactionLegacy.open("runDeleteSslCertValid"); + + CertServiceImpl certService = new CertServiceImpl(); + long certId = 1; + + //setting mock objects + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.remove(anyLong())).thenReturn(true); + when(certService._sslCertDao.findById(anyLong())).thenReturn(new SslCertVO()); + + // a rule holding the cert + + certService._lbCertDao = Mockito.mock(LoadBalancerCertMapDao.class); + when(certService._lbCertDao.listByCertId(anyLong())).thenReturn(null); + + //creating the command + DeleteSslCertCmd deleteCmd = new DeleteSslCertCmdExtn(); + Class _class = deleteCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("id"); + certField.setAccessible(true); + certField.set(deleteCmd, certId); + + certService.deleteSslCert(deleteCmd); + } + + private void runDeleteSslCertBoundCert() throws NoSuchFieldException, IllegalAccessException { + + TransactionLegacy txn = TransactionLegacy.open("runDeleteSslCertBoundCert"); + + CertServiceImpl certService = new CertServiceImpl(); + + //setting mock objects + long certId = 1; + + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.remove(anyLong())).thenReturn(true); + when(certService._sslCertDao.findById(anyLong())).thenReturn(new SslCertVO()); + + // rule holding the cert + certService._lbCertDao = Mockito.mock(LoadBalancerCertMapDao.class); + + List lbMapList = new ArrayList(); + lbMapList.add(new LoadBalancerCertMapVO()); + + certService._lbCertDao = Mockito.mock(LoadBalancerCertMapDao.class); + when(certService._lbCertDao.listByCertId(anyLong())).thenReturn(lbMapList); + + + certService._entityMgr = Mockito.mock(EntityManager.class); + when(certService._entityMgr.findById(eq(LoadBalancerVO.class), anyLong())).thenReturn(new LoadBalancerVO()); + + //creating the command + DeleteSslCertCmd deleteCmd = new DeleteSslCertCmdExtn(); + Class _class = deleteCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("id"); + certField.setAccessible(true); + certField.set(deleteCmd, certId); + + try { + certService.deleteSslCert(deleteCmd); + }catch (Exception e){ + assertTrue(e.getMessage().contains("Certificate in use by a loadbalancer")); + } + + + } + + private void runDeleteSslCertInvalidId() throws NoSuchFieldException, IllegalAccessException { + + TransactionLegacy txn = TransactionLegacy.open("runDeleteSslCertInvalidId"); + + long certId = 1; + CertServiceImpl certService = new CertServiceImpl(); + + certService._accountMgr = Mockito.mock(AccountManager.class); + Account account = new AccountVO("testaccount", 1, + "networkdomain", (short) 0, UUID.randomUUID().toString()); + when(certService._accountMgr.getAccount(anyLong())).thenReturn(account); + + certService._sslCertDao = Mockito.mock(SslCertDao.class); + when(certService._sslCertDao.remove(anyLong())).thenReturn(true); + when(certService._sslCertDao.findById(anyLong())).thenReturn(null); + + // no rule holding the cert + certService._lbCertDao = Mockito.mock(LoadBalancerCertMapDao.class); + when(certService._lbCertDao.listByCertId(anyLong())).thenReturn(null); + + //creating the command + DeleteSslCertCmd deleteCmd = new DeleteSslCertCmdExtn(); + Class _class = deleteCmd.getClass().getSuperclass(); + + Field certField = _class.getDeclaredField("id"); + certField.setAccessible(true); + certField.set(deleteCmd, certId); + + try { + certService.deleteSslCert(deleteCmd); + }catch (Exception e){ + assertTrue(e.getMessage().contains("Invalid certificate id")); + } + + } + + + public class UploadSslCertCmdExtn extends UploadSslCertCmd { + @Override + public long getEntityOwnerId() { + return 1; + } + } + + public class DeleteSslCertCmdExtn extends DeleteSslCertCmd { + @Override + public long getEntityOwnerId() { + return 1; + } + } +} diff --git a/server/test/resources/certs/bad_format_cert.crt b/server/test/resources/certs/bad_format_cert.crt new file mode 100644 index 00000000000..bab377a1720 --- /dev/null +++ b/server/test/resources/certs/bad_format_cert.crt @@ -0,0 +1 @@ +BAD FORMAT CERT diff --git a/server/test/resources/certs/dsa_self_signed.crt b/server/test/resources/certs/dsa_self_signed.crt new file mode 100644 index 00000000000..9ee3dc8e5dc --- /dev/null +++ b/server/test/resources/certs/dsa_self_signed.crt @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEaDCCBBACCQDB6QTHSA74AzAJBgcqhkjOOAQDMEUxCzAJBgNVBAYTAkFVMRMw +EQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0 +eSBMdGQwHhcNMTMxMDIxMTUxMzE1WhcNMTQxMDIxMTUxMzE1WjBFMQswCQYDVQQG +EwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lk +Z2l0cyBQdHkgTHRkMIIDSDCCAjoGByqGSM44BAEwggItAoIBAQD1cLkWeTvzloom +uaHmB0ANyrmHTum6bVVMyN2V/it8BAErugqQBIaNtF2EOmJ3baxsxIROOqJ5uVx0 +pymYVr4BcS3R6H2G7lSWHa5iA/UMfVp9yHroK+WYdN5ZVKGYcUTvKZXtyr2OX3Rc +KJJ2yp4qbcQTB2GlV6eZdpX3l38G/03n/Wi5yjU2/p56R80FAaLtCr4wJoS2aXxU +Iytps+msEn0LRZuFHpW1sLIKPLRCnjFXWeWKdJu6bggUVB0GjfsZR67XzFY5nRvX +7/vW2XS5Vo4X6gSOym0O/8/vzUp1gQSwHiMQQRAoRYoZPxWo8ACMsqdj0MTbN32y +b11//OlXAiEAoR8xDStCDTaQ2Ale9swNzLB8vWFzmSLQXXOM1PY10fMCggEBAO1p +RV1kluxjYCKec12MKdTBqO2QZnOOVFsY2vpIavgqpxyGaHRwY8Cm7BGosV2chMZw +G6xMz5CRnR55KasaX1Vz2xAz7PwczXWDQA59Il5tQbQdewitm1S3NRb1n9u+cNkQ +E6ZekjdW9tRykvaNQHH8EBzgQ9KXCYzJ8nFLk2DMt2Mor/paXfobNzO/vi2UgL+B +5/E8BXoMtBFPhiz72CsCiXp/usROe/UAejow/CTHYC2mfcPhKt2jIVelXx7Baf0n +K1SWKBpNI4ucBj+/4L3Be0ldqDGmeTRUNTNpJIzmAyplUvnpOiqCbzKst57+l4ZE +xdVgv2LiIrTaqTn1L4sDggEGAAKCAQEAv0hyFYj8IMEaOCk9+6wb32NGEGoEz4re +YW1O02Kij2/0YJk0CPyg0ozIpJq9FiHvOzE+2/Eg5jLVTLlAJbjnGjSnzZJ6pJHw +zhwnJ9wT4to51jLvG1v82iL2FfFKOZFjABxC+kND9cAUXu3URIGfdYJl1rBxvOD1 +WZ03Gk90GMCLUIMqqUYBQg7XRNVf0k1AgiRgDWpdLkKOGiDntAj/unXdFrbse2xD +IbqBGhCNtPVx34CZ3bUWrvYBoj+BUinfItRK4rkZTEGJinoxbKDvdqoewgk2nSty +7CH40wFS4ni4DCvYTEwUoUuciQaU4XUOOSYFS9IjNWOR8uGBtORteTAJBgcqhkjO +OAQDA0cAMEQCIHqfrNbyMadxZ3uCPr8QPj+17XZZod8B7F8VgZW3R5vSAiAV/WMF +vQ1Dwpr4wJOjNELDe5AEH9WGvevfuc54vmdAdg== +-----END CERTIFICATE----- diff --git a/server/test/resources/certs/dsa_self_signed.key b/server/test/resources/certs/dsa_self_signed.key new file mode 100644 index 00000000000..9a9d6675d5d --- /dev/null +++ b/server/test/resources/certs/dsa_self_signed.key @@ -0,0 +1,20 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIDVwIBAAKCAQEA9XC5Fnk785aKJrmh5gdADcq5h07pum1VTMjdlf4rfAQBK7oK +kASGjbRdhDpid22sbMSETjqieblcdKcpmFa+AXEt0eh9hu5Ulh2uYgP1DH1afch6 +6CvlmHTeWVShmHFE7ymV7cq9jl90XCiSdsqeKm3EEwdhpVenmXaV95d/Bv9N5/1o +uco1Nv6eekfNBQGi7Qq+MCaEtml8VCMrabPprBJ9C0WbhR6VtbCyCjy0Qp4xV1nl +inSbum4IFFQdBo37GUeu18xWOZ0b1+/71tl0uVaOF+oEjsptDv/P781KdYEEsB4j +EEEQKEWKGT8VqPAAjLKnY9DE2zd9sm9df/zpVwIhAKEfMQ0rQg02kNgJXvbMDcyw +fL1hc5ki0F1zjNT2NdHzAoIBAQDtaUVdZJbsY2AinnNdjCnUwajtkGZzjlRbGNr6 +SGr4Kqcchmh0cGPApuwRqLFdnITGcBusTM+QkZ0eeSmrGl9Vc9sQM+z8HM11g0AO +fSJebUG0HXsIrZtUtzUW9Z/bvnDZEBOmXpI3VvbUcpL2jUBx/BAc4EPSlwmMyfJx +S5NgzLdjKK/6Wl36Gzczv74tlIC/gefxPAV6DLQRT4Ys+9grAol6f7rETnv1AHo6 +MPwkx2Atpn3D4SrdoyFXpV8ewWn9JytUligaTSOLnAY/v+C9wXtJXagxpnk0VDUz +aSSM5gMqZVL56Toqgm8yrLee/peGRMXVYL9i4iK02qk59S+LAoIBAQC/SHIViPwg +wRo4KT37rBvfY0YQagTPit5hbU7TYqKPb/RgmTQI/KDSjMikmr0WIe87MT7b8SDm +MtVMuUAluOcaNKfNknqkkfDOHCcn3BPi2jnWMu8bW/zaIvYV8Uo5kWMAHEL6Q0P1 +wBRe7dREgZ91gmXWsHG84PVZnTcaT3QYwItQgyqpRgFCDtdE1V/STUCCJGANal0u +Qo4aIOe0CP+6dd0Wtux7bEMhuoEaEI209XHfgJndtRau9gGiP4FSKd8i1EriuRlM +QYmKejFsoO92qh7CCTadK3LsIfjTAVLieLgMK9hMTBShS5yJBpThdQ45JgVL0iM1 +Y5Hy4YG05G15AiBO/b8wvyKsJJAInNbsLH7OPitH3qKsI18IxykJSl9lTw== +-----END DSA PRIVATE KEY----- diff --git a/server/test/resources/certs/expired_cert.crt b/server/test/resources/certs/expired_cert.crt new file mode 100644 index 00000000000..d133f24bb74 --- /dev/null +++ b/server/test/resources/certs/expired_cert.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDVzCCAj+gAwIBAgIJAJRInPvOqxbXMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV +BAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg +Q29tcGFueSBMdGQwHhcNMTMxMDIxMjAwNjA5WhcNMTMxMDIwMjAwNjA5WjBCMQsw +CQYDVQQGEwJYWDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZh +dWx0IENvbXBhbnkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +3rASFvBmAF+CHn58TU5ib0HuMD4gxutohjzQjJXYRFs1cmiLb9esO0Cvk0DFaQuq +lpxw4Dhe6kxRbNQKkPFr0zsv9B8I/o8UQmclnZ0I++ixlAq4VyP6H0sewrmdVbrV +mSH0eG1t0hLqXUmxX/XX1kkbHOgZQQk90Sew23VwTVxbywq8yjkYLa2hlBXh33rX +siky7JFiF0TJE2r6wNB60BQMdi2EErtBUPL/1LD7+VuB/Y6xZpwivKwMIXeFdzSr +I2gGCn+zf01kNfHj0YrA2bH0i5FX4/9YSpd8PFIOYc/gA+3MNO0xMWchbz6AfjPQ +aR4tGLsRBjjwvLIZwHzyWQIDAQABo1AwTjAdBgNVHQ4EFgQUo/kIdWN+yxvnWUoK +/ZJYNl2wY9cwHwYDVR0jBBgwFoAUo/kIdWN+yxvnWUoK/ZJYNl2wY9cwDAYDVR0T +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAJ/LwjkhXQFOcfUmAoIeBIDAMayy7 +HEJusMOA+uUPPuEemgU7DTbwABCaavfBza7QvG171LsTGtvgnvwDg7rdScUOcoX8 +w0XZbhr+dZzvashVmMz4oY6hGw29eGo7M01Rm4msX7bW1IXmdWmDcqcNT6/dKOgj +tjMR2JvN9I4qwZ41xXAeUHDUqKjgsKlhflBbOX7K07tbpHFMQZcoOs19Jqve8Gfm +MbH0hZw3LC2YNed8ne/3/lXKNZIhbyZp1IJ/rjgruEZ0ObOwqB1IGR0UjQbAw102 +1D4L8FOzmDi4LfhKPgGc/BMeuPRozxQi60TzrnXN5eQSb0ukFvScMhAIrQ== +-----END CERTIFICATE----- diff --git a/server/test/resources/certs/non_x509_pem.crt b/server/test/resources/certs/non_x509_pem.crt new file mode 100644 index 00000000000..fbbae8ed75f --- /dev/null +++ b/server/test/resources/certs/non_x509_pem.crt @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICtzCCAZ8CAQAwcjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx +ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDENMAsGA1UEAwwEU3ll +ZDEcMBoGCSqGSIb3DQEJARYNc3llZEB0ZXN0LmNvbTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAKmQeRXpkeGRhzdj3aJiWUcZtKdcjPCdtphx8gHk1GV1 +vHK2zYenwe23EbSsfkOAQx2p86jCpghN7b+ECilmou4C7ASPS2U8n+GhWdl4eUK4 +Gmz7+daRqcDQOCTCJWSybtShYzvfp2SaEt/TcUgDT+k6xRitqcIkAY7boGY1Cehy +O6hYdlFkg0oU1XCA0usIaSEi7gOTijpGe2jSh7CTBRRWiClQnqE8VT7x4hXQEDF6 +u26K/ptAL90bgyFUuX2dEH5dKd/5QAyAfdrLV6a3wIvikCUGZy23Twtxot4kFVYf +S2x3H9BS6j/mIvrUj95CLi2Eu6t4z5uHMOrf8k0NjN8CAwEAAaAAMA0GCSqGSIb3 +DQEBBQUAA4IBAQBa5B6xzAkx3OtJEgOkTJ0nID2TsTt6eQBrp+//jhT/9yKLHmd5 +SeNcLzMWDlTQ+zNlLf9+lreO+CmlolaOKDRXh9eXbyNq0/I2QxOEsIlXqH4dVoCB +6UkV8eA0lFeNdFJaCla5/QTKmv4f0eUakbI5Scd1PlBr+YOplvI9fpLaxHGmVzCX +s3WQ7m7SN5hZav7dO8krheZL7N3AYZoCY0QbQ3JTeoakLenmFXqvsckP6in5NQJh +ECaJprYxrxR+5GPjpUkxu7YGLloXHvnnINeZGJG0TB7kPDO+axDxloiI2eYlT/mp +HxdgL9BvDYNfI+0NcZYHguz8GWuWiTZC7F26 +-----END CERTIFICATE REQUEST----- diff --git a/server/test/resources/certs/root_chain.crt b/server/test/resources/certs/root_chain.crt new file mode 100644 index 00000000000..2ed80858532 --- /dev/null +++ b/server/test/resources/certs/root_chain.crt @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDnTCCAoWgAwIBAgIJALXV1B5/vewgMA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNV +BAYTAkFVMQ0wCwYDVQQIDARTb21lMQwwCgYDVQQKDANPcmcxDDAKBgNVBAsMA0Rl +djENMAsGA1UEAwwETmFtZTEcMBoGCSqGSIb3DQEJARYNdGVzdEBtYWlsLmNvbTAe +Fw0xMzEwMjExNjAxMDdaFw0xNjEwMjAxNjAxMDdaMGUxCzAJBgNVBAYTAkFVMQ0w +CwYDVQQIDARTb21lMQwwCgYDVQQKDANPcmcxDDAKBgNVBAsMA0RldjENMAsGA1UE +AwwETmFtZTEcMBoGCSqGSIb3DQEJARYNdGVzdEBtYWlsLmNvbTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBALQZLQa2R64GRCuoh59VFvKoXnAM+4H4sW9E +jiURT/CeH6rbD0IbEMZZ3o84VfQw1zDsVXN/GXq3IEMp8uBBpWJuZRBF1UeDMYlB +bouMqUGL05Ov51zK2aQK/83S8MoQI7KV1FGJNti4iwUzemG1fClrBqjCFJQKmv8y +0z1UaeniAR7ygedIB4I2Y4a/DxtI0e2EsS0TcViwKHGrLArO0GfvNbH+tXqTaotF +X5eyinUFqQxT3JvnlIIernk0ly8c07mqOFbFqHrhFXxddD4pZrUetHXM2MKLdCMu +fvXsmMXSAgQ5F97GWmiDEJ9zMDxGoSmhTIN96FwPCRDr7e22lEsCAwEAAaNQME4w +HQYDVR0OBBYEFIxSziB7ssNqFvhV2MSf1GYvGHQYMB8GA1UdIwQYMBaAFIxSziB7 +ssNqFvhV2MSf1GYvGHQYMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB +AB1rcxZL6xGuk8PSoBQ0imREcVf9BcEvGIC6uubPSXuoJ/gr584vo3pRJpTpHQyK +xUUwG6gCaDgAMYX177GBamGCt056ThSLKFROIPVrigZ5yY1NWznNq3zjWS4jIHkV +vGd+Gx8t3qYBhsn+v6Y6gRTjMOVQum+rvxvixG7n97DaxBnrwNWXbzZQ9spHrQsT +dsSF/kf9NKkWM0zKh+f/FSNmveJKKvZ+WQZC/MKUfc5VHjyLldXhrffcxzek/dOc +8YADSICSizvXCP/QjyVVl8dpKr/3c00r16Ei3QQaFhHES0bv/sKLnTwQwKDfJthu +bQj7M/XGWi33JQgoMHktYhI= +-----END CERTIFICATE----- diff --git a/server/test/resources/certs/rsa_ca_signed.crt b/server/test/resources/certs/rsa_ca_signed.crt new file mode 100644 index 00000000000..fb74f17574b --- /dev/null +++ b/server/test/resources/certs/rsa_ca_signed.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID1TCCAr2gAwIBAgIJALXV1B5/vewhMA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNV +BAYTAkFVMQ0wCwYDVQQIDARTb21lMQwwCgYDVQQKDANPcmcxDDAKBgNVBAsMA0Rl +djENMAsGA1UEAwwETmFtZTEcMBoGCSqGSIb3DQEJARYNdGVzdEBtYWlsLmNvbTAe +Fw0xMzEwMjExNjE4MjJaFw0xNDEwMjExNjE4MjJaMHIxCzAJBgNVBAYTAkFVMRMw +EQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0 +eSBMdGQxDTALBgNVBAMMBFN5ZWQxHDAaBgkqhkiG9w0BCQEWDXN5ZWRAdGVzdC5j +b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpkHkV6ZHhkYc3Y92i +YllHGbSnXIzwnbaYcfIB5NRldbxyts2Hp8HttxG0rH5DgEMdqfOowqYITe2/hAop +ZqLuAuwEj0tlPJ/hoVnZeHlCuBps+/nWkanA0DgkwiVksm7UoWM736dkmhLf03FI +A0/pOsUYranCJAGO26BmNQnocjuoWHZRZINKFNVwgNLrCGkhIu4Dk4o6Rnto0oew +kwUUVogpUJ6hPFU+8eIV0BAxertuiv6bQC/dG4MhVLl9nRB+XSnf+UAMgH3ay1em +t8CL4pAlBmctt08LcaLeJBVWH0tsdx/QUuo/5iL61I/eQi4thLureM+bhzDq3/JN +DYzfAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wg +R2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBR2LIRfVveDgQB3dC7TOYhX +BEv71DAfBgNVHSMEGDAWgBSMUs4ge7LDahb4VdjEn9RmLxh0GDANBgkqhkiG9w0B +AQUFAAOCAQEAPjN/sdLcPfMh5ep29vp/7JTh6dUYnBNATYaXxx8j2XdnMCKeRfgP +WOJur8HDPSayWWKKlztiQbJV5jDS5vyuMWI1a5/KIAQlOJep+anpR1QnQaX4/M4Z +YUJo1fPs6tg47dXRpZZaJ+Hqwh0ZftCQoUq/sBxawXf6sbxsjoUmzxQLBqzYo1LJ +jwxBs6C9aM8LDHFz4TVlyclSFQXiLMosj1jLBQ+TqzCxS6qOfJeMM9STXI9W3F2k +duXeceqOwEkh8aeSUIztYFpX34d4SA4DDX5GUEaOeOR/abnXjH52vE6tM/m7NOve +5+I/BrlT3heRqiD6Z2ofSsFhG86YeF9Q3w== +-----END CERTIFICATE----- diff --git a/server/test/resources/certs/rsa_ca_signed.key b/server/test/resources/certs/rsa_ca_signed.key new file mode 100644 index 00000000000..d30dd8e8e99 --- /dev/null +++ b/server/test/resources/certs/rsa_ca_signed.key @@ -0,0 +1,30 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIN4x8YHLIb60CAggA +MBQGCCqGSIb3DQMHBAiuWe+C2SitUgSCBMhVxMKivNaQh9SQedh2GQ8vlhI2/mKf +r6zVUgODOdmFRj/PAlQu6B+VH8u2Ef5tr74O9UyZUQpC6oI0npvQOGqnhIxECR8D +zepFlC0s+6kNRqfzXiMhGTsfbs3xUE1TZK1z5556OS4GlihIB0E5F7GdlulHELeA +dnEItqDffWPQczTmSmFqtH7G/ksGQhSA2reBIDNgxWreBh9x9h2TftEvhhogdkr2 +XQpzxcby2v2z6Hut1lfVkLQNdvdHYdDG751NQltOmGvncXkTNJ+tSByXuY9ITtYz +XqwY/vAEX+YYjCrWcvMmhU1t6B9cZ3viFzIIIltqtvDo3rybicpM3xvmnYnTF35j +sGebcynzZedrLUHwD6/o0jBzFJN26QBxDGrlmn9E8HBhmjMCeSyZTXtSkwN0dAhu +EHT2NgdC/4G4+JHsb3Oetl6AbUyYs2eWTRgr6bgBezbiDqKMj1QtGECkPQE9tFFP +Jtma6lGJ1/u8zLFYNjigKZgXaNbtlMpslk+KDTGaTSbbVEaaxWSc0YlHz329ovQC +1btrTE71FoNjRsTRaDRXC7BfrrMtnLhG2SmROKzyBtoxFymfEmASpdGERO+c2712 +Z0NLpHJL5ocsRr/onVi0auFC/nuaq6QqYF5OPtZhYh3+IDd193LP3xo8hnFjTq90 +9zV1QI2uHfTfijI4OABYSSZLxrl2IFF7Z/e4XkWSXrneR2Ne5GoYX7w6wshiuubQ +bDPUHODsy7uQJ3ZEmmmd5xWvA3h3F5Yyls3WEuz8+jYR4iPKdjt8DJuz9j+7IP3C +LoRa3KhxIPAzziQw+tMFVCozLLfS1kN8mg5SwU9Dp4HUPY/n3KnjVSjUJ347KAgW ++ykPlz4S1H0A2GyGWhdyX3J839UOdXfCsfKQQ1FLOBvhQgBNGzoRIgDrsZdrxgWa +XtF+Ct2/2/O+503I6X90maXzhshmGw/NKsiNx7YOdUiu6w3N4LajIWE689UUU7Dr +EtM8HcfmBnE/cZTbeWbQBfl1GqigMp+YOAY2sw0rZdF4ocmnqoCWLVN2j8O/re5g +20y5eHkztPOZ+NNczo5PP96ng1XEMVzs/h6xDHzsak6osZb5b+Hs9kcYuqBEqr16 +3DVwaZ45dGwNN90Q9YmrgEdCqtCAU12w/YYVB/aB701Ijg0NhVsh7PgWaJIOJD56 +YTaiWIzQaZ/uM0KlgLz2eI9VXcuv24gUMAUMaI84mInnIrax1zFMrlCjEcR8Zxvk +jCCY6Uq9WH30cUo7cMHWLWMzsl7PC7xpYSHPClqzCUluUgQwqoOs5Ux4nYl+JI7C +ZfJ8BUMCD2RJtjvJhkE6LEkcrCjwnvappRaXbN54IVXpuMl2XYtp44T117QulEj1 +I/jk1mrpkXRKi9ZsKsjDH9VMy1hcKHn4CgTxmtRYN6LPA4tamxzVLxIi6YDU0142 +l1u763cT7cH14lvzUvEQMFbk/s0AUl8zeZAwjDayNlD/ljz7nZnJ3NToMlxeoK0a +F6c/RgQBwxR8NMdo19Irv8stxo9WGB2/0Q8WCxW7ENHlBpvX5zXKRJMswFKp0ft6 +dT7hOBPgJlD7C1eX5jVcSz6kDRM6gQ7K/c5QcJa6qNAC2Jw6yBBYltqiRalFWX46 +VcM= +-----END ENCRYPTED PRIVATE KEY----- diff --git a/server/test/resources/certs/rsa_ca_signed2.crt b/server/test/resources/certs/rsa_ca_signed2.crt new file mode 100644 index 00000000000..fb74f17574b --- /dev/null +++ b/server/test/resources/certs/rsa_ca_signed2.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID1TCCAr2gAwIBAgIJALXV1B5/vewhMA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNV +BAYTAkFVMQ0wCwYDVQQIDARTb21lMQwwCgYDVQQKDANPcmcxDDAKBgNVBAsMA0Rl +djENMAsGA1UEAwwETmFtZTEcMBoGCSqGSIb3DQEJARYNdGVzdEBtYWlsLmNvbTAe +Fw0xMzEwMjExNjE4MjJaFw0xNDEwMjExNjE4MjJaMHIxCzAJBgNVBAYTAkFVMRMw +EQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0 +eSBMdGQxDTALBgNVBAMMBFN5ZWQxHDAaBgkqhkiG9w0BCQEWDXN5ZWRAdGVzdC5j +b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpkHkV6ZHhkYc3Y92i +YllHGbSnXIzwnbaYcfIB5NRldbxyts2Hp8HttxG0rH5DgEMdqfOowqYITe2/hAop +ZqLuAuwEj0tlPJ/hoVnZeHlCuBps+/nWkanA0DgkwiVksm7UoWM736dkmhLf03FI +A0/pOsUYranCJAGO26BmNQnocjuoWHZRZINKFNVwgNLrCGkhIu4Dk4o6Rnto0oew +kwUUVogpUJ6hPFU+8eIV0BAxertuiv6bQC/dG4MhVLl9nRB+XSnf+UAMgH3ay1em +t8CL4pAlBmctt08LcaLeJBVWH0tsdx/QUuo/5iL61I/eQi4thLureM+bhzDq3/JN +DYzfAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wg +R2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBR2LIRfVveDgQB3dC7TOYhX +BEv71DAfBgNVHSMEGDAWgBSMUs4ge7LDahb4VdjEn9RmLxh0GDANBgkqhkiG9w0B +AQUFAAOCAQEAPjN/sdLcPfMh5ep29vp/7JTh6dUYnBNATYaXxx8j2XdnMCKeRfgP +WOJur8HDPSayWWKKlztiQbJV5jDS5vyuMWI1a5/KIAQlOJep+anpR1QnQaX4/M4Z +YUJo1fPs6tg47dXRpZZaJ+Hqwh0ZftCQoUq/sBxawXf6sbxsjoUmzxQLBqzYo1LJ +jwxBs6C9aM8LDHFz4TVlyclSFQXiLMosj1jLBQ+TqzCxS6qOfJeMM9STXI9W3F2k +duXeceqOwEkh8aeSUIztYFpX34d4SA4DDX5GUEaOeOR/abnXjH52vE6tM/m7NOve +5+I/BrlT3heRqiD6Z2ofSsFhG86YeF9Q3w== +-----END CERTIFICATE----- diff --git a/server/test/resources/certs/rsa_ca_signed2.key b/server/test/resources/certs/rsa_ca_signed2.key new file mode 100644 index 00000000000..d30dd8e8e99 --- /dev/null +++ b/server/test/resources/certs/rsa_ca_signed2.key @@ -0,0 +1,30 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIN4x8YHLIb60CAggA +MBQGCCqGSIb3DQMHBAiuWe+C2SitUgSCBMhVxMKivNaQh9SQedh2GQ8vlhI2/mKf +r6zVUgODOdmFRj/PAlQu6B+VH8u2Ef5tr74O9UyZUQpC6oI0npvQOGqnhIxECR8D +zepFlC0s+6kNRqfzXiMhGTsfbs3xUE1TZK1z5556OS4GlihIB0E5F7GdlulHELeA +dnEItqDffWPQczTmSmFqtH7G/ksGQhSA2reBIDNgxWreBh9x9h2TftEvhhogdkr2 +XQpzxcby2v2z6Hut1lfVkLQNdvdHYdDG751NQltOmGvncXkTNJ+tSByXuY9ITtYz +XqwY/vAEX+YYjCrWcvMmhU1t6B9cZ3viFzIIIltqtvDo3rybicpM3xvmnYnTF35j +sGebcynzZedrLUHwD6/o0jBzFJN26QBxDGrlmn9E8HBhmjMCeSyZTXtSkwN0dAhu +EHT2NgdC/4G4+JHsb3Oetl6AbUyYs2eWTRgr6bgBezbiDqKMj1QtGECkPQE9tFFP +Jtma6lGJ1/u8zLFYNjigKZgXaNbtlMpslk+KDTGaTSbbVEaaxWSc0YlHz329ovQC +1btrTE71FoNjRsTRaDRXC7BfrrMtnLhG2SmROKzyBtoxFymfEmASpdGERO+c2712 +Z0NLpHJL5ocsRr/onVi0auFC/nuaq6QqYF5OPtZhYh3+IDd193LP3xo8hnFjTq90 +9zV1QI2uHfTfijI4OABYSSZLxrl2IFF7Z/e4XkWSXrneR2Ne5GoYX7w6wshiuubQ +bDPUHODsy7uQJ3ZEmmmd5xWvA3h3F5Yyls3WEuz8+jYR4iPKdjt8DJuz9j+7IP3C +LoRa3KhxIPAzziQw+tMFVCozLLfS1kN8mg5SwU9Dp4HUPY/n3KnjVSjUJ347KAgW ++ykPlz4S1H0A2GyGWhdyX3J839UOdXfCsfKQQ1FLOBvhQgBNGzoRIgDrsZdrxgWa +XtF+Ct2/2/O+503I6X90maXzhshmGw/NKsiNx7YOdUiu6w3N4LajIWE689UUU7Dr +EtM8HcfmBnE/cZTbeWbQBfl1GqigMp+YOAY2sw0rZdF4ocmnqoCWLVN2j8O/re5g +20y5eHkztPOZ+NNczo5PP96ng1XEMVzs/h6xDHzsak6osZb5b+Hs9kcYuqBEqr16 +3DVwaZ45dGwNN90Q9YmrgEdCqtCAU12w/YYVB/aB701Ijg0NhVsh7PgWaJIOJD56 +YTaiWIzQaZ/uM0KlgLz2eI9VXcuv24gUMAUMaI84mInnIrax1zFMrlCjEcR8Zxvk +jCCY6Uq9WH30cUo7cMHWLWMzsl7PC7xpYSHPClqzCUluUgQwqoOs5Ux4nYl+JI7C +ZfJ8BUMCD2RJtjvJhkE6LEkcrCjwnvappRaXbN54IVXpuMl2XYtp44T117QulEj1 +I/jk1mrpkXRKi9ZsKsjDH9VMy1hcKHn4CgTxmtRYN6LPA4tamxzVLxIi6YDU0142 +l1u763cT7cH14lvzUvEQMFbk/s0AUl8zeZAwjDayNlD/ljz7nZnJ3NToMlxeoK0a +F6c/RgQBwxR8NMdo19Irv8stxo9WGB2/0Q8WCxW7ENHlBpvX5zXKRJMswFKp0ft6 +dT7hOBPgJlD7C1eX5jVcSz6kDRM6gQ7K/c5QcJa6qNAC2Jw6yBBYltqiRalFWX46 +VcM= +-----END ENCRYPTED PRIVATE KEY----- diff --git a/server/test/resources/certs/rsa_random_pkey.key b/server/test/resources/certs/rsa_random_pkey.key new file mode 100644 index 00000000000..8c29b3e20de --- /dev/null +++ b/server/test/resources/certs/rsa_random_pkey.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQD2ZYOSvqPjro7k +JKWggB0FJL45mz3pfvBR0NcHTGgHKdh5hml1GiHHPanYnWqRuKFI7UPWLq3xllvJ +jolMjX6FGzPFuh4wHQ3gHMFlmpi6o1gUkk5QxAeCWmsA77qJAAiLVbm27sqfpvSG +ec6KJOcePDDN/6Jp363Gf8JuSssafg6fAbfwLp7Cm1cxFM3RKN13fUdy50+OcXv7 +uvUlzHZ2ZIVK7FnlFoXOfhFHoyfdZL2Qm8xV3SuUllNPGl7aCM59Y6xR743Rq01j +3E6hHNZ82GlJGaOL413oVsp5J9ZmKV+WM7plFIn86p2JGMoA2xjtON+X6BZdz3YT +ymp7ic+7AgMBAAECggEBAKvkNd3x0TPNWzIdvs4xkg08jNhzTMXQIKdzIg+dZhVZ +RAPDmV5wVJBCnHLZnrb6LspJe8G33vFjC7WZEn+tVk5Vo9CU/uph2oQ2i1TufQ33 +VkNDrg76MqLloTCODXv14gASVfUgsYqfVodaApStGe8l3oZXiF6EBR8tkd6PnxFi +8TPAalFS/0mfjj/dA9zHXoZ0iyl+h6had6kqJNNbP8zgD+TbnfJZVkURNB0cyGVI +8/8d/eO05oQ1DpuvTJ+Q5i8wTDjikUzc4btt6coA/ho4QuOvfsZGsgCzCYsUn0+W +GA+Vn2PVEFV5hJ+MZ9gGmQ5ouC/IVAYkBBC7HlNX70ECgYEA+3DC6rTvXqdrjZz1 +TFWcITfAt7WzfGlHi2LBZ/JNmyIetXmF/sHpqGKkvp7iHDMJ4NeEBXSN9tbbEfhc +1yU+HXYlKkeaZAGaNiCSvqlr/Bouy7dX3jG8xgPGQ1o2gyluaoTEwORf2LgmApYA +q/eQyWTKHLxatTnjlqLULerxqv8CgYEA+t1Wa00XHHgB1D4was59qnpPemIUxpvm +4e3wjyQs6P2kH0F0rKyytQaSXKhkBYRcmh0EnyNSGu7wxM5l3aDTzCDgBHmb1i9P +UXLzWUYnsSgUpUB8jL6YDlUmQ1AMMDqvLagLlOLqPkRmNjN1P4/+6mdoxD5SL0rv +5FeRaOAGR0UCgYEAjWEgGDzYg058CUqCGwPgIEVrFWETpRbFZbiHq1zxChOrVLsZ +/t8l9MpSe+R2mwiPu18zGqYo1OyGjZorCcYlIQe3agiM5UKJZXn3SUGWOFC4k09q +FsO8s1KX/nMRR7raHQa+Yv+GbSNOLBIQGqG/RZ5ojrPSBSihsaeoypDahh0CgYEA ++OK3ZmVpVHlLd0LrzktnKceHKqg8bH8oJWZnj9wYIl/igI/0LYx5EFigxQTblw2m +wc+gUjI8tzPv85HCRovVFWRYXJg6H9l4HBqrjBqqLnzRXtIHv6soOLAJ8iZssTzH +p8hdFS27sGMz9PpAjPtTsUM/EdOyvfDe5/Bo91+rWvECgYEAxgvptntWbXc8QI9n +DFYGigeza0sQTmFtSsob5cux9dtPORChdb6EPNTgOPOfKD4QMkmar/VWedeXOHb9 +Cy1Qz7bgOhIUSMdXzw4hPOmLrT7IbhG5CHawwHanGycrQ/bJcV00lsv0BEj3N/NJ +PW/vxADWc9H3AcVeMi5So6gTBt4= +-----END PRIVATE KEY----- diff --git a/server/test/resources/certs/rsa_self_signed.crt b/server/test/resources/certs/rsa_self_signed.crt new file mode 100644 index 00000000000..710326ef8e5 --- /dev/null +++ b/server/test/resources/certs/rsa_self_signed.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBjCCAe4CCQCEkqahWR0hjjANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB +VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 +cyBQdHkgTHRkMB4XDTEzMTAyMTEzNTIyMFoXDTE0MTAyMTEzNTIyMFowRTELMAkG +A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 +IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN6wEhbwZgBfgh5+fE1OYm9B7jA+IMbraIY80IyV2ERbNXJoi2/XrDtAr5NAxWkL +qpaccOA4XupMUWzUCpDxa9M7L/QfCP6PFEJnJZ2dCPvosZQKuFcj+h9LHsK5nVW6 +1Zkh9HhtbdIS6l1JsV/119ZJGxzoGUEJPdEnsNt1cE1cW8sKvMo5GC2toZQV4d96 +17IpMuyRYhdEyRNq+sDQetAUDHYthBK7QVDy/9Sw+/lbgf2OsWacIrysDCF3hXc0 +qyNoBgp/s39NZDXx49GKwNmx9IuRV+P/WEqXfDxSDmHP4APtzDTtMTFnIW8+gH4z +0GkeLRi7EQY48LyyGcB88lkCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAlgx04bvU +/EE5z7lJsYmUM2oi8FjqZcZkD4F1ku7zvdAXaDNhOHjrR5LxGL+iI/N9S8lKVeSV +xZv+EXAT0NqkTidNFjvP7coctDrrM+JHSNTRlr2GnnYjCnjEph4+ZXNppx8vnhXe +7jDnHoXL/C5GIPOm0+LQaH1AlGTPF0lnBrtQaz1UG34vCr8SSUtRbTDDxH/liXfc +hfvVnf4OV5Duj0oUXsmB3YzITYZnZ/xvZ4Dw6rOU/U5Vetng+msOOt8momeTCnWB +/d1clA7rulJTCNZXb0YyaUNaC6eQX7S9JHnluB67b9yp4yg8f00qz4xR165eTQmq +mLiuE/U5fTODvA== +-----END CERTIFICATE----- diff --git a/server/test/resources/certs/rsa_self_signed.key b/server/test/resources/certs/rsa_self_signed.key new file mode 100644 index 00000000000..14b95e6ea1f --- /dev/null +++ b/server/test/resources/certs/rsa_self_signed.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA3rASFvBmAF+CHn58TU5ib0HuMD4gxutohjzQjJXYRFs1cmiL +b9esO0Cvk0DFaQuqlpxw4Dhe6kxRbNQKkPFr0zsv9B8I/o8UQmclnZ0I++ixlAq4 +VyP6H0sewrmdVbrVmSH0eG1t0hLqXUmxX/XX1kkbHOgZQQk90Sew23VwTVxbywq8 +yjkYLa2hlBXh33rXsiky7JFiF0TJE2r6wNB60BQMdi2EErtBUPL/1LD7+VuB/Y6x +ZpwivKwMIXeFdzSrI2gGCn+zf01kNfHj0YrA2bH0i5FX4/9YSpd8PFIOYc/gA+3M +NO0xMWchbz6AfjPQaR4tGLsRBjjwvLIZwHzyWQIDAQABAoIBAFBYus4oAsWTsEEM +ZhEGfSGjaith3zWmblowyxZOYm+XcRtMeTLrYCso1bCNqCyUlwIsg9WCwUxMKPzZ +LM7LLJpUOqMcJ4ShXy/uQ3Yw2LL7bEb77zMRugdcdUbQ7eGmvba4t5pT8VHgnUr3 +cdYrv6qDShMN8z6x9OnoJjmoj9J5Ggda6DhsXsvl5Ox85XMOJKd9yyaUfa/qy8b6 +wIyixGQ/9l/GwGONgtrF7yKW3YUE+uhoEp4pqgKsGUIke3l7aWug6dCDjKDMdbX5 +jwSSiw2ilTpQJhi1r8JIMOfMea3addf39VySK7e6cSWhsf1VTVwneJbka13xS6uR +SSdvs7kCgYEA9ynOXh/1+VkpCHJBAPWEIUtPn16KGJB6YEsEf7cfaAQfzQCwJ8E4 +I7/WsHveHXs80HLS/ZJQlIXXsdeMiWdu1rnsQiVBZMmSNOpOD8iP/6mv8eqeeNr+ +3e3JG+j+l3w+/RzX516WC5JPMIsNSIzSlyx8Yht4IYA2uvpJcLdMW2MCgYEA5qY/ +xht6UlbLevGzFFFnM5R9LWSs+Ip88HCBmEwbow7FQTc0TXYbOKxGtPqn88dM91XT +NMpPaGenuioRz+P1sbEFOP/iE4Hyob8643NMkAiwwoxzSf2Bsj+ebJ/U7oC0xKYx +yjLeFWINhDy+I3LDLEXTTfv5GNrFlitqBEA+ThMCgYEAmOrJnhyCD4JlS698nj5I +QF0a5wwTvnzs6dSf9PB0QuOCVVBerEn0FNIk3s3UL0NG7eSMu4uhxTJFr+cfMQfI +YJtpG8d2/QdlKM3p/APna5Mtoyu4XieH1gC/E0CE+25IfksxHRm9FW2xBuSRFFjk +FdnVHtHF8lwkAGzHsTAG0ucCgYEAigFdVT7psMyoEZb+7KBMXKtzPq7nZAsQ+JiI +okSfoK/czMmoLNUHMqC56d20koNkhPVAW2zVmIW08QntAHPIdZqSomlQrxVoxOjz +5lX9sIzSnoWFEfdyG+I++4Wi1VYDU0qRrgdDpI23wrDJn9Ix/5KD/TxP7lQwN0sg +swxxeysCgYBBXGBBJR7+AbreFpOHitw0h32Qdmy6zHTEF8e0SjmEgDv3uwGDdsYO +QQ7g9QPPPUsYtl0+mUmCwDrw1sJeVFtp86AQlQMV89pR2yXZLf0xwT7IN6RAH5Bi +WlV2/pmiMuWB1qSUKgdPzVEd6aqtjD0TIjtryDBHp76YHJR6SzdCCA== +-----END RSA PRIVATE KEY----- diff --git a/server/test/resources/certs/rsa_self_signed_with_pwd.crt b/server/test/resources/certs/rsa_self_signed_with_pwd.crt new file mode 100644 index 00000000000..de5e5c9ac0b --- /dev/null +++ b/server/test/resources/certs/rsa_self_signed_with_pwd.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDBjCCAe4CCQD5Q6qF5dVV0jANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB +VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0 +cyBQdHkgTHRkMB4XDTEzMTAyMTEzNTgwNFoXDTE0MTAyMTEzNTgwNFowRTELMAkG +A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0 +IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN/7lJtiEs68IC1ZPxY9NA34z9T4AU4LPS/kbQtuxx4X72XOBy+y0cB/qdMD7JNV +h8Mq4URDljhSDyVPdH/+jQr+7kWx2gNe2R/DCnd/meVwwU30JJvpGVZXt+MTef5N +QAbSfDMsuT4FaUY80InbDd24HelrjwunPdY9wwKXO6zL2fLjyDRediiydxcx18Vb +Dq1cm7DRi4mNkmA3RwBQMhxGp3VsfXJ4Hy2WTRCCCxWHZphAh3EUJGK3idum6/7j +HbAwpM/t1kNWN8PZiYDZ1HbccgjmqB7Cub10BfB9g1RByiQ/C87o5cKtQha3uuXR +iBcHISoDydQrgxKgUpiqEF0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEASvulIaVb +zh8z2TysE6RFoYTAYIRXghFrmqCUyyQmUVTvs6vN8iaSXr+WMQJcpgXewWcFrDhr +mIcyRCvF91ZYb7q6lMZFSpE6u/SUGIEtxGUDAfbkbQdKYmrMcbggUUIvSzgUFisO +Kr0H9PEO4AWtCCrtOJFc7jgu03Sv06wDxn9ghkyiBRnVkbAhoKfKnI179yKruJWR +A3ieEj0eFoUbeSH8hDkToj4ynpkAvEGoHjHG9j+8FJxy/PTjkyVPl1ykTs+2Jc1B +Snx8f2afdTenPWyyBm3wFuRZjEAJJLUO0kxM7E8hAwhGsr+XYanwcr1oA1dz6M3f +cq26lpjTH5ITwQ== +-----END CERTIFICATE----- diff --git a/server/test/resources/certs/rsa_self_signed_with_pwd.key b/server/test/resources/certs/rsa_self_signed_with_pwd.key new file mode 100644 index 00000000000..d645a716632 --- /dev/null +++ b/server/test/resources/certs/rsa_self_signed_with_pwd.key @@ -0,0 +1,30 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,CCA6E4CB4C4039DD + +TaVCJtB0dE9xTZbX7GOaGJwwGHVAMjU1GbRIHf0jODdP+quZvbjklNqsw8Ozlia9 +q/G+UqtRJGlIPPLpce0YCrTo0P3eixZdMs0+hioAEJ4OLtL0SAC6b8q/gB6HRfAx +BvNg+umTqeF9YB68Tcuv/2g4VGKiaePQACyOzMdf7lGY7ojxoJCYZa1mfKb7jWrg +FLwmTtLLhNjb6CnOKo3klIef3A6zdutpgxF1gARzdRyXg4qCA3boYnwEptTOlJFu +ovxbhDG9iuYYr4gXYSs1pLYptEC8J6iWpG/qzkwfr4l5Cfg5uF00bbxQE5+WeRaj +YFicvXjB/kcoFZuCL7M/YRXYxkJ/EZ19xI9HZNBQ4L738StkSBKL4OhpF/qgYZ2y +ZLRV6XT4AijUA0Ef7YTuUsTL7Qt9drj09gCtAzXTA7gpZBn5SqT9kWhuwSzY302l +KF8DIC6A52igk2QKPLbleM/V8eCu6n+J4uF+0GwVRROuG7ThxAQiUlJKhoEYrndL +nzT7jHVLftjilhVWFu2On62bRf5t1QZuob+1AdK0ukvEIVsYnN4bnlAkc99Wi6C0 +ZJd9qW5L4A9XAC2gcjr3m0Rzw3RO+k17faR8YfmTuJvGyBf5fnrSFoNkrninXQXp +sk0ajRi4PJ4XTswLyxjWRSt3egNsZBSKnVCibca/QoDEdZHSKXo2FlYiUYx8JHQX +SPUsLl9OQKC1W8/+ReryqBLHCkiGEsvT8gVaXga0uhVaqe+PaVur2tbOHl4yCysC ++ZlnKwsC84LQsUvpENdCh+D7E1I1Rao9IJMR6q9azKq8Ck63cOJ1fA9xSnxJGoCA +IlGLttlXrR32EtzYwEnlqf1nI/IqNQrAXQKrP5VPzHsgMFu5uD4OEZa92Q5cVTsz +ap/1UEqiJVYUt6nuA+aqOUlyjC0oNtYL/VO4DbHTFcHa8SI2cPSS6ebPMWPGHjUm +l9bWa6Q9iyplCYS6hinAVsAaLVjPi1Eu9Pc8rxFCmoiJYJju5NZuGI5UBK64dqcX +T6trWl0kB8QY63JtnrZaoStoSPImV5KVseUKDV8TM3Y76h1nLV3MSmAD1ivk9oKs +VKeVrDhZBWUq9Dqre/+lVGO0a2wo5VTR8hfpf8QkODPLeyNZNdfGKzkkFLuXa8V5 +ELhLQJ3FnbEU3NEvMwikV9MhP/ELPTkZwJr/NKv+9JLs9eXtwz29I/Q8byQVrCCs +hAuDl0zHGRnqdpdSImeS2EXGx631zGMwSe8fhKelni5h6hXrXz52asr0k30BxWjf +WUn1uTInwVjWGy9B5j3mZlVDotFbvVAZgtR0IoFwihPl4VZd9oS13l+hMfrTy1YZ +8xFNg8ZqUQ0lSmKfOVqSBT0lP8tM8LuGxgY4cWluhsAQxR5Nl7wkundnqjcwEDDu +Jz2rD54St1EZYGLDJZSfC7mpG2PgodsdeopQCTyFhHWa8s3caZ40GFOwaR+/5+YF +1oRvkR1Yr4qIS7KbX4xsaFfAA5b8QfLA74L05PAgDwKofam2GFAlAKHOcI6mexPq +aySON9MNdnXBNxs16mBJLzCX5ljQb0ilJildVEI3aVmABptM4ehEiw== +-----END RSA PRIVATE KEY----- diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index 7bacefe31b0..53cd0bf594f 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -41,6 +41,8 @@ ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `power_state_update_count` INT DEFA ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `power_host` bigint unsigned; ALTER TABLE `cloud`.`vm_instance` ADD CONSTRAINT `fk_vm_instance__power_host` FOREIGN KEY (`power_host`) REFERENCES `cloud`.`host`(`id`); +ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `lb_protocol` VARCHAR(40); + DROP TABLE IF EXISTS `cloud`.`vm_snapshot_details`; CREATE TABLE `cloud`.`vm_snapshot_details` ( `id` bigint unsigned UNIQUE NOT NULL, @@ -464,6 +466,32 @@ CREATE VIEW `cloud`.`storage_pool_view` AS and async_job.instance_type = 'StoragePool' and async_job.job_status = 0; + +CREATE TABLE `sslcerts` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `uuid` varchar(40) DEFAULT NULL, + `account_id` bigint(20) unsigned NOT NULL, + `domain_id` bigint(20) unsigned NOT NULL, + `certificate` text NOT NULL, + `fingerprint` varchar(62) NOT NULL, + `key` text NOT NULL, + `chain` text, + `password` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `fk_sslcert__account_id` FOREIGN KEY (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_sslcert__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE +); + +CREATE TABLE `load_balancer_cert_map` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `uuid` varchar(40) DEFAULT NULL, + `load_balancer_id` bigint(20) unsigned NOT NULL, + `certificate_id` bigint(20) unsigned NOT NULL, + `revoke` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + CONSTRAINT `fk_load_balancer_cert_map__certificate_id` FOREIGN KEY (`certificate_id`) REFERENCES `sslcerts` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk_load_balancer_cert_map__load_balancer_id` FOREIGN KEY (`load_balancer_id`) REFERENCES `load_balancing_rules` (`id`) ON DELETE CASCADE); + ALTER TABLE `cloud`.`host` ADD COLUMN `cpu_sockets` int(10) unsigned DEFAULT NULL COMMENT "the number of CPU sockets on the host" AFTER pod_id; DROP VIEW IF EXISTS `cloud`.`host_view`; diff --git a/utils/src/com/cloud/utils/net/NetUtils.java b/utils/src/com/cloud/utils/net/NetUtils.java index f5904250bb4..8a351097845 100755 --- a/utils/src/com/cloud/utils/net/NetUtils.java +++ b/utils/src/com/cloud/utils/net/NetUtils.java @@ -52,6 +52,7 @@ import com.cloud.utils.script.Script; public class NetUtils { protected final static Logger s_logger = Logger.getLogger(NetUtils.class); public final static String HTTP_PORT = "80"; + public final static String HTTPS_PORT = "443"; public final static int VPN_PORT = 500; public final static int VPN_NATT_PORT = 4500; public final static int VPN_L2TP_PORT = 1701; @@ -61,6 +62,8 @@ public class NetUtils { public final static String ANY_PROTO = "any"; public final static String ICMP_PROTO = "icmp"; public final static String ALL_PROTO = "all"; + public final static String HTTP_PROTO = "http"; + public final static String SSL_PROTO = "ssl"; public final static String ALL_CIDRS = "0.0.0.0/0"; public final static int PORT_RANGE_MIN = 0; From d05891afa1bbe942a6ea286166b2a6bf1b691b5e Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Thu, 7 Nov 2013 17:24:23 +0530 Subject: [PATCH 100/108] CLOUDSTACK-4994. Cannot attach VMwareInstallerISO to VMs that are of guest operating system CentOS 6.1 CentOS 6.2 CentOS 6.3 CentOS 6.4. Cause - This issue can occur in VMware setups if the guest operating system is not specified when we install the virtual machine. In which case, since we map the OS to 'Other OS', VMwareInstallerISO attachment fails. Added the necessary guest OS mapping for VMware. --- .../cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java index 6ee0f753d79..b8c3e8dc58a 100755 --- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareGuestOsMapper.java @@ -121,6 +121,14 @@ public class VmwareGuestOsMapper { s_mapper.put("CentOS 5.6 (64-bit)", VirtualMachineGuestOsIdentifier.CENTOS_64_GUEST); s_mapper.put("CentOS 6.0 (32-bit)", VirtualMachineGuestOsIdentifier.CENTOS_GUEST); s_mapper.put("CentOS 6.0 (64-bit)", VirtualMachineGuestOsIdentifier.CENTOS_64_GUEST); + s_mapper.put("CentOS 6.1 (32-bit)", VirtualMachineGuestOsIdentifier.CENTOS_GUEST); + s_mapper.put("CentOS 6.1 (64-bit)", VirtualMachineGuestOsIdentifier.CENTOS_64_GUEST); + s_mapper.put("CentOS 6.2 (32-bit)", VirtualMachineGuestOsIdentifier.CENTOS_GUEST); + s_mapper.put("CentOS 6.2 (64-bit)", VirtualMachineGuestOsIdentifier.CENTOS_64_GUEST); + s_mapper.put("CentOS 6.3 (32-bit)", VirtualMachineGuestOsIdentifier.CENTOS_GUEST); + s_mapper.put("CentOS 6.3 (64-bit)", VirtualMachineGuestOsIdentifier.CENTOS_64_GUEST); + s_mapper.put("CentOS 6.4 (32-bit)", VirtualMachineGuestOsIdentifier.CENTOS_GUEST); + s_mapper.put("CentOS 6.4 (64-bit)", VirtualMachineGuestOsIdentifier.CENTOS_64_GUEST); s_mapper.put("Other CentOS (32-bit)", VirtualMachineGuestOsIdentifier.CENTOS_GUEST); s_mapper.put("Other CentOS (64-bit)", VirtualMachineGuestOsIdentifier.CENTOS_64_GUEST); From 011b87eadcf3dd9694080a23ebe1eebd65676e79 Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Fri, 8 Nov 2013 18:00:55 +0530 Subject: [PATCH 101/108] fixed indentaion problem in utils.py :359 Conflicts: tools/marvin/marvin/integration/lib/utils.py --- tools/marvin/marvin/integration/lib/utils.py | 31 ++++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index a106fc0e2f8..df3ca8aac9c 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -329,11 +329,10 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): (config.mgtSvr[0].mgtSvrIp, e)) return 'snapshot exists' in result - def validateList(inp): - ''' - @name: validateList - @Description: 1. A utility function to validate + """ + @name: validateList + @Description: 1. A utility function to validate whether the input passed is a list 2. The list is empty or not 3. If it is list and not empty, return PASS and first element @@ -350,18 +349,18 @@ def validateList(inp): default to None. INVALID_INPUT EMPTY_LIST - ''' - ret = [FAIL, None, None] - if inp is None: - ret[2] = INVALID_INPUT - return ret - if not isinstance(inp, list): - ret[2] = INVALID_INPUT - return ret - if len(inp) == 0: - ret[2] = EMPTY_LIST - return ret - return [PASS, inp[0], None] + """ + ret = [FAIL, None, None] + if inp is None: + ret[2] = INVALID_INPUT + return ret + if not isinstance(inp, list): + ret[2] = INVALID_INPUT + return ret + if len(inp) == 0: + ret[2] = EMPTY_LIST + return ret + return [PASS, inp[0], None] def verifyElementInList(inp, toverify, responsevar=None, pos=0): ''' From a2117d46f90ae6a96e3d046e306e524756609f5d Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Fri, 8 Nov 2013 18:51:43 +0530 Subject: [PATCH 102/108] CLOUDSTACK-5107: Decreasing memory in service offering so as not to run out of resources Signed-off-by: Girish Shilamkar --- .../component/test_memory_limits.py | 40 ++++++------- .../component/test_mm_domain_limits.py | 59 +++++++++---------- .../component/test_mm_project_limits.py | 2 +- 3 files changed, 50 insertions(+), 51 deletions(-) diff --git a/test/integration/component/test_memory_limits.py b/test/integration/component/test_memory_limits.py index 18eab4c2383..7da85a5854f 100644 --- a/test/integration/component/test_memory_limits.py +++ b/test/integration/component/test_memory_limits.py @@ -55,7 +55,7 @@ class Services: "displaytext": "Tiny Instance", "cpunumber": 1, "cpuspeed": 100, # in MHz - "memory": 5120, # In MBs + "memory": 2048, # In MBs }, "virtual_machine": { "displayname": "TestVM", @@ -177,10 +177,10 @@ class TestMemoryLimits(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) def test_01_stop_start_instance(self): - """Test Deploy VM with 5 GB RAM & verify the usage""" + """Test Deploy VM with specified RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM & Deploy VM as root admin + # 1. Create compute offering with specified RAM & Deploy VM as root admin # 2 .List Resource count for the root admin Memory usage # 3. Stop and start instance, resource count should list properly. @@ -229,10 +229,10 @@ class TestMemoryLimits(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) def test_02_migrate_instance(self): - """Test Deploy VM with 5 GB RAM & verify the usage""" + """Test Deploy VM with specified RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM & Deploy VM as root admin + # 1. Create compute offering with specified RAM & Deploy VM as root admin # 2. List Resource count for the root admin Memory usage # 3. Migrate vm, resource count should list properly. @@ -268,10 +268,10 @@ class TestMemoryLimits(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) def test_03_delete_instance(self): - """Test Deploy VM with 5 GB RAM & verify the usage""" + """Test Deploy VM with specified GB RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM & Deploy VM as root admin + # 1. Create compute offering with specified RAM & Deploy VM as root admin # 2. List Resource count for the root admin Memory usage # 3. Delete instance, resource count should be 0 after delete operation. @@ -306,11 +306,11 @@ class TestMemoryLimits(cloudstackTestCase): return @attr(tags=["advanced", "advancedns","simulator"]) - def test_04_deploy_multiple_vm_with_5gb_ram(self): - """Test Deploy multiple VM with 5 GB RAM & verify the usage""" + def test_04_deploy_multiple_vm(self): + """Test Deploy multiple VM with specified RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM + # 1. Create compute offering with specified RAM # 2. Deploy multiple VMs with this service offering # 3. List Resource count for the root admin Memory usage # 4. Memory usage should list properly @@ -550,10 +550,10 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) def test_02_migrate_instance(self): - """Test Deploy VM with 5 GB memory & verify the usage""" + """Test Deploy VM with specified memory & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB memory in child domains of root domain & Deploy VM + # 1. Create compute offering with specified memory in child domains of root domain & Deploy VM # 2. List Resource count # 3. Migrate instance to another host # 4. Resource count should list properly. @@ -608,10 +608,10 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) def test_03_delete_instance(self): - """Test Deploy VM with 5 GB RAM & verify the usage""" + """Test Deploy VM with specified RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM in child domains of root domain & Deploy VM + # 1. Create compute offering with specified RAM in child domains of root domain & Deploy VM # 2. List Resource count for the Memory usage # 3. Delete instance # 4. Resource count should list as 0 @@ -663,16 +663,16 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) @attr(configuration='max.account.memory') def test_04_deploy_multiple_vm(self): - """Test Deploy multiple VM with 5 GB memory & verify the usage""" - #keep the configuration value - max.account.memory = 20480 + """Test Deploy multiple VM with 2 GB memory & verify the usage""" + #keep the configuration value - max.account.memory = 8192 (maximum 4 instances per account with 2 GB RAM) # Validate the following - # 1. Create compute offering with 5 GB RAM + # 1. Create compute offering with 2 GB RAM # 2. Deploy multiple VMs with this service offering in child domains of root domain # 3. List Resource count for the root admin Memory usage # 4. Memory usage should list properly - self.debug("Creating service offering with 5 GB RAM") + self.debug("Creating service offering with 2 GB RAM") self.service_offering = ServiceOffering.create( self.apiclient, self.services["service_offering"] @@ -695,8 +695,8 @@ class TestDomainMemoryLimitsConfiguration(cloudstackTestCase): domainid = self.domain.id ) - if memory_account_gc[0].max != 20480: - self.skipTest("This test case requires configuration value max.account.memory to be 20480") + if memory_account_gc[0].max != 8192: + self.skipTest("This test case requires configuration value max.account.memory to be 8192") api_client = self.testClient.createUserApiClient( UserName=self.account.name, diff --git a/test/integration/component/test_mm_domain_limits.py b/test/integration/component/test_mm_domain_limits.py index d87db84a470..c8560873560 100644 --- a/test/integration/component/test_mm_domain_limits.py +++ b/test/integration/component/test_mm_domain_limits.py @@ -56,7 +56,7 @@ class Services: "displaytext": "Tiny Instance", "cpunumber": 1, "cpuspeed": 100, # in MHz - "memory": 5120, # In MBs + "memory": 2048, # In MBs }, "virtual_machine": { "displayname": "TestVM", @@ -183,7 +183,7 @@ class TestDomainMemoryLimits(cloudstackTestCase): Resources.updateLimit(self.apiclient, resourcetype=9, - max=15360, + max=6144, account=self.child_do_admin_1.name, domainid=self.child_do_admin_1.domainid) @@ -203,17 +203,17 @@ class TestDomainMemoryLimits(cloudstackTestCase): Resources.updateLimit(self.apiclient, resourcetype=9, - max=15360, + max=6144, account=self.child_do_admin_2.name, domainid=self.child_do_admin_2.domainid) return @attr(tags=["advanced", "advancedns","simulator"]) def test_01_change_service_offering(self): - """Test Deploy VM with 5 GB RAM & verify the usage""" + """Test Deploy VM with specified RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM & Deploy VM in the created domain + # 1. Create compute offering with specified RAM & Deploy VM in the created domain # 2. List Resource count for the root admin Memory usage # 3. Upgrade and downgrade service offering # 4. Resource count should list properly for the domain @@ -228,7 +228,7 @@ class TestDomainMemoryLimits(cloudstackTestCase): self.domain = domain #Resetting memory count in service offering - self.services["service_offering"]["memory"] = 5120 + self.services["service_offering"]["memory"] = 2048 self.debug("Creating an instance with service offering: %s" % self.service_offering.name) @@ -266,24 +266,24 @@ class TestDomainMemoryLimits(cloudstackTestCase): self.assertEqual(resource_count_after_stop, expected_resource_count, "Resource count should be same after stopping the instance") - self.debug("Creating service offering with 7 GB RAM") - self.services["service_offering"]["memory"] = 7168 - self.service_offering_7gb = ServiceOffering.create( + self.debug("Creating service offering with 5 GB RAM") + self.services["service_offering"]["memory"] = 5120 + self.service_offering_5gb = ServiceOffering.create( self.apiclient, self.services["service_offering"] ) # Adding to cleanup list after execution - self.cleanup.append(self.service_offering_7gb) + self.cleanup.append(self.service_offering_5gb) self.debug( "Upgrade service offering of instance %s from %s to %s" % (vm.name, self.service_offering.name, - self.service_offering_7gb.name)) + self.service_offering_5gb.name)) try: vm.change_service_offering(self.apiclient, - serviceOfferingId=self.service_offering_7gb.id) + serviceOfferingId=self.service_offering_5gb.id) except Exception as e: self.fail("Failed to change service offering of vm %s - %s" % (vm.name, e)) @@ -305,7 +305,7 @@ class TestDomainMemoryLimits(cloudstackTestCase): self.debug( "Down grade service offering of instance %s from %s to %s" % (vm.name, - self.service_offering_7gb.name, + self.service_offering_5gb.name, self.service_offering.name)) try: @@ -349,15 +349,15 @@ class TestDomainMemoryLimits(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) def test_02_migrate_vm(self): - """Test Deploy VM with 5 GB RAM & verify the usage""" + """Test Deploy VM with specified RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM & Deploy VM in the created domain + # 1. Create compute offering with specified RAM & Deploy VM in the created domain # 2. List Resource count for the root admin Memory usage # 3. Migrate vm to another host, resource count should list properly. #Resetting memory count in service offering - self.services["service_offering"]["memory"] = 5120 + self.services["service_offering"]["memory"] = 2048 self.debug("Setting up account and domain hierarchy") self.setupAccounts() @@ -408,15 +408,15 @@ class TestDomainMemoryLimits(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) def test_03_delete_vm(self): - """Test Deploy VM with 5 GB RAM & verify the usage""" + """Test Deploy VM with specified RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM & Deploy VM in the created domain + # 1. Create compute offering with specified RAM & Deploy VM in the created domain # 2. List Resource count for the root admin Memory usage # 3. Delete vm, resource count should list as 0 after delete operation. # Resetting the memory count of service offering - self.services["service_offering"]["memory"] = 5120 + self.services["service_offering"]["memory"] = 2048 self.debug("Setting up account and domain hierarchy") self.setupAccounts() @@ -467,16 +467,16 @@ class TestDomainMemoryLimits(cloudstackTestCase): @attr(tags=["advanced", "advancedns","simulator"]) def test_04_deploy_multiple_vm(self): - """Test Deploy multiple VM with 5 GB RAM & verify the usage""" + """Test Deploy multiple VM with specified RAM & verify the usage""" # Validate the following - # 1. Create compute offering with 5 GB RAM + # 1. Create compute offering with specified RAM # 2. Deploy multiple VMs with this service offering # 3. List Resource count for the root admin Memory usage # 4. Memory usage should list properly # Resetting the memory count of service offering - self.services["service_offering"]["memory"] = 5120 + self.services["service_offering"]["memory"] = 2048 self.debug("Setting up account and domain hierarchy") self.setupAccounts() @@ -607,7 +607,7 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase): self.domain.name) Resources.updateLimit(self.apiclient, resourcetype=9, - max=10240, + max=4096, account=self.parentd_admin.name, domainid=self.parentd_admin.domainid) self.debug("Creating a sub-domain under: %s" % self.parent_domain.name) @@ -631,14 +631,14 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase): self.cdomain_1.name) Resources.updateLimit(self.apiclient, resourcetype=9, - max=5120, + max=2048, domainid=self.cadmin_1.domainid) self.debug("Updating the Memory resource count for account: %s" % self.cadmin_1.name) Resources.updateLimit(self.apiclient, resourcetype=9, - max=2148, + max=2048, account=self.cadmin_1.name, domainid=self.cadmin_1.domainid) @@ -653,14 +653,14 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase): self.cdomain_2.name) Resources.updateLimit(self.apiclient, resourcetype=9, - max=5120, + max=2048, domainid=self.cadmin_2.domainid) self.debug("Updating the Memory resource count for domain: %s" % self.cadmin_2.name) Resources.updateLimit(self.apiclient, resourcetype=9, - max=2148, + max=2048, account=self.cadmin_2.name, domainid=self.cadmin_2.domainid) @@ -684,9 +684,8 @@ class TestMultipleChildDomainsMemory(cloudstackTestCase): """Test memory limits with multiple child domains""" # Validate the following - # 1. Create Domain1 with 10 GB RAM and 2 child domains with 5 GB - # each.Assign 2 GB for Domain1 admin1 & Domain1 User1 .Assign 2 - # GB for Domain2 admin1 & Domain2 User1 + # 1. Create Domain1 with 4 GB RAM and 2 child domains with 2 GB + # each. # 2. Deploy VM's by Domain1 admin1/user1/ Domain2 user1/Admin1 account # and verify the resource updates # 3. Deploy VM by admin account after reaching max parent domain limit diff --git a/test/integration/component/test_mm_project_limits.py b/test/integration/component/test_mm_project_limits.py index 1c0ed92d89e..ffeb20a5740 100644 --- a/test/integration/component/test_mm_project_limits.py +++ b/test/integration/component/test_mm_project_limits.py @@ -55,7 +55,7 @@ class Services: "displaytext": "Tiny Instance", "cpunumber": 1, "cpuspeed": 100, # in MHz - "memory": 5120, # In MBs + "memory": 2048, # In MBs }, "virtual_machine": { "displayname": "TestVM", From 1e57f1cee7ef0d7ef2d50dbd5be4197ed1b738ad Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Fri, 8 Nov 2013 19:50:22 +0530 Subject: [PATCH 103/108] Modified remoteSSHClient references to SshClient --- tools/marvin/marvin/integration/lib/common.py | 4 ++-- tools/marvin/marvin/integration/lib/utils.py | 8 ++++---- tools/marvin/marvin/sandbox/demo/live/testSshDeployVM.py | 4 ++-- .../marvin/sandbox/demo/simulator/testcase/libs/common.py | 4 ++-- .../marvin/sandbox/demo/simulator/testcase/libs/utils.py | 8 ++++---- .../sandbox/demo/simulator/testcase/test_vm_life_cycle.py | 2 +- tools/marvin/marvin/sshClient.py | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py index 1386eaf7d96..6c2bb2aced1 100644 --- a/tools/marvin/marvin/integration/lib/common.py +++ b/tools/marvin/marvin/integration/lib/common.py @@ -19,7 +19,7 @@ #Import Local Modules from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from utils import * from base import * from marvin.codes import PASS @@ -217,7 +217,7 @@ def download_systemplates_sec_storage(server, services): try: # Login to management server - ssh = remoteSSHClient( + ssh = SshClient( server["ipaddress"], server["port"], server["username"], diff --git a/tools/marvin/marvin/integration/lib/utils.py b/tools/marvin/marvin/integration/lib/utils.py index df3ca8aac9c..0fe3c26adbf 100644 --- a/tools/marvin/marvin/integration/lib/utils.py +++ b/tools/marvin/marvin/integration/lib/utils.py @@ -29,7 +29,7 @@ import socket import urlparse import datetime from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from marvin.codes import * @@ -124,7 +124,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryin ''' try: - ssh = remoteSSHClient( + ssh = SshClient( host=ipaddress, port=port, user=username, @@ -190,7 +190,7 @@ def get_process_status(hostip, port, username, password, linklocalip, process, h """Double hop and returns a process status""" #SSH to the machine - ssh = remoteSSHClient(hostip, port, username, password) + ssh = SshClient(hostip, port, username, password) if str(hypervisor).lower() == 'vmware': ssh_command = "ssh -i /var/cloudstack/management/.ssh/id_rsa -ostricthostkeychecking=no " else: @@ -296,7 +296,7 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): mgtSvr, user, passwd = config.mgtSvr[0].mgtSvrIp, config.mgtSvr[0].user, config.mgtSvr[0].passwd try: - ssh_client = remoteSSHClient( + ssh_client = SshClient( mgtSvr, 22, user, diff --git a/tools/marvin/marvin/sandbox/demo/live/testSshDeployVM.py b/tools/marvin/marvin/sandbox/demo/live/testSshDeployVM.py index 5438e40d6c8..38351861de7 100644 --- a/tools/marvin/marvin/sandbox/demo/live/testSshDeployVM.py +++ b/tools/marvin/marvin/sandbox/demo/live/testSshDeployVM.py @@ -20,7 +20,7 @@ import marvin from marvin.cloudstackTestCase import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient @UserName('demo', 'ROOT', '0') @@ -84,7 +84,7 @@ class TestSshDeployVm(cloudstackTestCase): # SSH login and compare hostname self.debug("Attempting to SSH into %s over %s of %s"%(nattedip, "22", vm.name)) - ssh_client = remoteSSHClient(nattedip, "22", "root", "password") + ssh_client = SshClient(nattedip, "22", "root", "password") stdout = ssh_client.execute("hostname") self.assertEqual(hostname, stdout[0], "cloudstack VM name and hostname \ diff --git a/tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/common.py b/tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/common.py index fc184016d43..e0c452741b1 100644 --- a/tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/common.py +++ b/tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/common.py @@ -22,7 +22,7 @@ #Import Local Modules from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -import marvin.remoteSSHClient +import marvin.sshClient from utils import * from base import * @@ -102,7 +102,7 @@ def download_systemplates_sec_storage(server, services): try: # Login to management server - ssh = marvin.remoteSSHClient.remoteSSHClient( + ssh = marvin.sshClient.SshClient( server["ipaddress"], server["port"], server["username"], diff --git a/tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/utils.py b/tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/utils.py index 8abed18b99d..f26d2c0212b 100644 --- a/tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/utils.py +++ b/tools/marvin/marvin/sandbox/demo/simulator/testcase/libs/utils.py @@ -20,10 +20,10 @@ """ import time -import marvin.remoteSSHClient +import marvin.sshClient from marvin.cloudstackAPI import * import marvin.cloudstackConnection -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient #from marvin.cloudstackConnection import cloudConnection import marvin.configGenerator import logging @@ -44,7 +44,7 @@ def is_server_ssh_ready(ipaddress, port, username, password, retries=50): loop_cnt = retries while True: try: - ssh = marvin.remoteSSHClient.remoteSSHClient( + ssh = marvin.sshClient.SshClient( ipaddress, port, username, @@ -89,7 +89,7 @@ def get_process_status(hostip, port, username, password, linklocalip, process): """Double hop and returns a process status""" #SSH to the machine - ssh = marvin.remoteSSHClient.remoteSSHClient( + ssh = marvin.sshClient.SshClient( hostip, port, username, diff --git a/tools/marvin/marvin/sandbox/demo/simulator/testcase/test_vm_life_cycle.py b/tools/marvin/marvin/sandbox/demo/simulator/testcase/test_vm_life_cycle.py index 9bc7e149f97..2e612021f6c 100644 --- a/tools/marvin/marvin/sandbox/demo/simulator/testcase/test_vm_life_cycle.py +++ b/tools/marvin/marvin/sandbox/demo/simulator/testcase/test_vm_life_cycle.py @@ -22,7 +22,7 @@ import marvin from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * -from marvin.remoteSSHClient import remoteSSHClient +from marvin.sshClient import SshClient from testcase.libs.utils import * from testcase.libs.base import * diff --git a/tools/marvin/marvin/sshClient.py b/tools/marvin/marvin/sshClient.py index 58f2602107b..fd8726cee37 100644 --- a/tools/marvin/marvin/sshClient.py +++ b/tools/marvin/marvin/sshClient.py @@ -178,5 +178,5 @@ class SshClient(object): if __name__ == "__main__": with contextlib.closing(SshClient("10.223.75.10", 22, "root", - "password")) as ssh: + "password")) as ssh: print ssh.execute("ls -l") From 97348217c47ad1cb4e242a04ddfcc3696c2a280f Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Thu, 7 Nov 2013 14:38:15 +0530 Subject: [PATCH 104/108] BUG-ID: CS-17753 unable to attach more than 5 data volumes to a VM running on ESX due to SCSI ID conflict between new volume and ID reserved for the virtual SCSI adapter Increasing the max data volumes limit in create-schema.sql to 13 for vmware. --- setup/db/create-schema.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index 79550aee1bb..9c07a4494f6 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -1674,10 +1674,10 @@ INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('XenServer', '5.6 SP2', 50, 1); INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit) VALUES ('XenServer', '6.0', 50, 1, 13); INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit) VALUES ('XenServer', '6.0.2', 50, 1, 13); -INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('VMware', 'default', 128, 0); -INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('VMware', '4.0', 128, 0); -INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('VMware', '4.1', 128, 0); -INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('VMware', '5.0', 128, 0); +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit) VALUES ('VMware', 'default', 128, 0, 13); +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit) VALUES ('VMware', '4.0', 128, 0, 13); +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit) VALUES ('VMware', '4.1', 128, 0, 13); +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled, max_data_volumes_limit) VALUES ('VMware', '5.0', 128, 0, 13); INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('KVM', 'default', 50, 1); INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('Ovm', 'default', 25, 1); INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('Ovm', '2.3', 25, 1); From 4674ae4dd347ebf0d921247666db6f21518a0f08 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 8 Nov 2013 14:36:48 +0100 Subject: [PATCH 105/108] CLOUDSTACK-5076: fix wrong bridge name in vm domain xml desc after upgrade from 4.0 or before to 4.2 (cherry picked from commit 86976fb298bb05b7a5380573e292ec9687169228) --- .../kvm/resource/LibvirtComputingResource.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 00412d2efca..63bd5dc051a 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -199,6 +199,7 @@ import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.GuestDef; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.GuestResourceDef; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InputDef; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef; +import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.InterfaceDef.guestNetType; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.SerialDef; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.TermPolicy; import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.VirtioSerialDef; @@ -4396,6 +4397,21 @@ ServerResource { try { dm = conn.domainLookupByName(vmName); String vmDef = dm.getXMLDesc(0); + LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser(); + parser.parseDomainXML(vmDef); + for (InterfaceDef nic :parser.getInterfaces()) { + if ((nic.getNetType() == guestNetType.BRIDGE) && (nic.getBrName().startsWith("cloudVirBr"))) { + try { + int vnetId = Integer.parseInt(nic.getBrName().replaceFirst("cloudVirBr", "")); + String pifName = getPif(_guestBridgeName); + String newBrName = "br" + pifName + "-"+ vnetId; + vmDef = vmDef.replaceAll("'" + nic.getBrName() + "'", "'" + newBrName + "'"); + s_logger.debug("VM bridge name is changed from " + nic.getBrName() + " to " + newBrName); + } catch (NumberFormatException e) { + continue; + } + } + } s_logger.debug(vmDef); msg = stopVM(conn, vmName); msg = startVM(conn, vmName, vmDef); From 19e9849d862cba607f4190ccb8d0f3d6a37dc5ae Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Fri, 8 Nov 2013 19:49:10 +0530 Subject: [PATCH 106/108] Enabled the traffic lable support the hyperv hypervisor type. Modified the physical_network_traffic_types table to introduce hyperv_network lable column. Modified associated VO's and impls classes. Modified the List/Update/Add TrafficType command api's and response classes. Fixed the Unit tests --- api/src/com/cloud/network/NetworkService.java | 4 ++-- .../cloud/network/PhysicalNetworkTrafficType.java | 2 ++ .../org/apache/cloudstack/api/ApiConstants.java | 1 + .../command/admin/usage/AddTrafficTypeCmd.java | 9 ++++++++- .../command/admin/usage/UpdateTrafficTypeCmd.java | 9 ++++++++- .../api/response/TrafficTypeResponse.java | 10 ++++++++++ .../subsystem/api/storage/DataStoreProvider.java | 2 +- .../dao/PhysicalNetworkTrafficTypeDaoImpl.java | 13 ++++++++++++- .../network/dao/PhysicalNetworkTrafficTypeVO.java | 15 ++++++++++++++- .../contrail/management/ManagementServerMock.java | 6 +++--- server/src/com/cloud/api/ApiResponseHelper.java | 1 + server/src/com/cloud/configuration/Config.java | 5 +++++ .../configuration/ConfigurationManagerImpl.java | 2 +- .../src/com/cloud/network/NetworkModelImpl.java | 13 +++++++++++++ .../src/com/cloud/network/NetworkServiceImpl.java | 13 ++++++++++--- .../com/cloud/vpc/MockNetworkManagerImpl.java | 4 ++-- setup/db/db/schema-421to430.sql | 1 + 17 files changed, 94 insertions(+), 16 deletions(-) diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java index 8f81697158d..b91a63d75f1 100755 --- a/api/src/com/cloud/network/NetworkService.java +++ b/api/src/com/cloud/network/NetworkService.java @@ -116,11 +116,11 @@ public interface NetworkService { long findPhysicalNetworkId(long zoneId, String tag, TrafficType trafficType); PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficType, - String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan); + String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan, String hypervLabel); PhysicalNetworkTrafficType getPhysicalNetworkTrafficType(Long id); - PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel); + PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel, String hypervLabel); boolean deletePhysicalNetworkTrafficType(Long id); diff --git a/api/src/com/cloud/network/PhysicalNetworkTrafficType.java b/api/src/com/cloud/network/PhysicalNetworkTrafficType.java index a385b533af8..ad3b93d4406 100644 --- a/api/src/com/cloud/network/PhysicalNetworkTrafficType.java +++ b/api/src/com/cloud/network/PhysicalNetworkTrafficType.java @@ -37,4 +37,6 @@ public interface PhysicalNetworkTrafficType extends InternalIdentity, Identity { String getVmwareNetworkLabel(); String getSimulatorNetworkLabel(); + + String getHypervNetworkLabel(); } diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index ae6be63dcf9..82b2af69759 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -355,6 +355,7 @@ public class ApiConstants { public static final String XEN_NETWORK_LABEL = "xennetworklabel"; public static final String KVM_NETWORK_LABEL = "kvmnetworklabel"; public static final String VMWARE_NETWORK_LABEL = "vmwarenetworklabel"; + public static final String HYPERV_NETWORK_LABEL = "hypervnetworklabel"; public static final String NETWORK_SERVICE_PROVIDER_ID = "nspid"; public static final String SERVICE_LIST = "servicelist"; public static final String CAN_ENABLE_INDIVIDUAL_SERVICE = "canenableindividualservice"; diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java index 3957e6948f3..f6e4319fdee 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java @@ -60,6 +60,9 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd { @Parameter(name=ApiConstants.VMWARE_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a VMware host") private String vmwareLabel; + @Parameter(name=ApiConstants.HYPERV_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a Hyperv host") + private String hypervLabel; + @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="The VLAN id to be used for Management traffic by VMware host") private String vlan; @@ -88,6 +91,10 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd { return vmwareLabel; } + public String getHypervLabel() { + return hypervLabel; + } + public String getSimulatorLabel() { //simulators will have no labels return null; @@ -130,7 +137,7 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd { @Override public void create() throws ResourceAllocationException { - PhysicalNetworkTrafficType result = _networkService.addTrafficTypeToPhysicalNetwork(getPhysicalNetworkId(), getTrafficType(), getXenLabel(), getKvmLabel(), getVmwareLabel(), getSimulatorLabel(), getVlan()); + PhysicalNetworkTrafficType result = _networkService.addTrafficTypeToPhysicalNetwork(getPhysicalNetworkId(), getTrafficType(), getXenLabel(), getKvmLabel(), getVmwareLabel(), getSimulatorLabel(), getVlan(), getHypervLabel()); if (result != null) { setEntityId(result.getId()); setEntityUuid(result.getUuid()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java index e54b87c0591..c1e36aae802 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java @@ -23,6 +23,7 @@ import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.BaseCmd.CommandType; import org.apache.cloudstack.api.response.TrafficTypeResponse; import org.apache.log4j.Logger; @@ -53,6 +54,8 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd { @Parameter(name=ApiConstants.VMWARE_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a VMware host") private String vmwareLabel; + @Parameter(name=ApiConstants.HYPERV_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a Hyperv host") + private String hypervLabel; ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// @@ -73,6 +76,10 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd { return vmwareLabel; } + public String getHypervLabel() { + return hypervLabel; + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @@ -89,7 +96,7 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd { @Override public void execute(){ - PhysicalNetworkTrafficType result = _networkService.updatePhysicalNetworkTrafficType(getId(), getXenLabel(), getKvmLabel(), getVmwareLabel()); + PhysicalNetworkTrafficType result = _networkService.updatePhysicalNetworkTrafficType(getId(), getXenLabel(), getKvmLabel(), getVmwareLabel(), getHypervLabel()); if (result != null) { TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result); response.setResponseName(getCommandName()); diff --git a/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java b/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java index 494048e347f..0205daa8cff 100644 --- a/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java +++ b/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java @@ -45,6 +45,9 @@ public class TrafficTypeResponse extends BaseResponse { @SerializedName(ApiConstants.VMWARE_NETWORK_LABEL) @Param(description="The network name label of the physical device dedicated to this traffic on a VMware host") private String vmwareNetworkLabel; + @SerializedName(ApiConstants.HYPERV_NETWORK_LABEL) @Param(description="The network name label of the physical device dedicated to this traffic on a HyperV host") + private String hypervNetworkLabel; + @Override public String getObjectId() { @@ -82,10 +85,17 @@ public class TrafficTypeResponse extends BaseResponse { public String getKvmLabel() { return kvmNetworkLabel; } + public String getHypervLabel() { + return hypervNetworkLabel; + } public void setXenLabel(String xenLabel) { this.xenNetworkLabel = xenLabel; } + + public void setHypervLabel(String hypervLabel) { + this.hypervNetworkLabel = hypervLabel; + } public void setKvmLabel(String kvmLabel) { this.kvmNetworkLabel = kvmLabel; diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java index 855f0854103..7b5f8d967ee 100644 --- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java +++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreProvider.java @@ -27,7 +27,7 @@ public interface DataStoreProvider { static final String S3_IMAGE = "S3"; static final String SWIFT_IMAGE = "Swift"; static final String SAMPLE_IMAGE = "Sample"; - + static final String SMB = "NFS"; static final String DEFAULT_PRIMARY = "DefaultPrimary"; static enum DataStoreProviderType { diff --git a/engine/schema/src/com/cloud/network/dao/PhysicalNetworkTrafficTypeDaoImpl.java b/engine/schema/src/com/cloud/network/dao/PhysicalNetworkTrafficTypeDaoImpl.java index 2a712a6127d..8f7b319546d 100755 --- a/engine/schema/src/com/cloud/network/dao/PhysicalNetworkTrafficTypeDaoImpl.java +++ b/engine/schema/src/com/cloud/network/dao/PhysicalNetworkTrafficTypeDaoImpl.java @@ -41,6 +41,7 @@ public class PhysicalNetworkTrafficTypeDaoImpl extends GenericDaoBase vmWareAllFieldsSearch; final GenericSearchBuilder simulatorAllFieldsSearch; final GenericSearchBuilder ovmAllFieldsSearch; + final GenericSearchBuilder hypervAllFieldsSearch; protected PhysicalNetworkTrafficTypeDaoImpl() { super(); @@ -55,6 +56,13 @@ public class PhysicalNetworkTrafficTypeDaoImpl extends GenericDaoBase nets = _physicalNetworkDao.listByZoneAndTrafficType(_zone.getId(), TrafficType.Public); if (nets == null || nets.isEmpty()) { - _networkService.addTrafficTypeToPhysicalNetwork(_znet.getId(), TrafficType.Public.toString(), null, null, null, null, null); + _networkService.addTrafficTypeToPhysicalNetwork(_znet.getId(), TrafficType.Public.toString(), null, null, null, null, null, null); } } catch (InvalidParameterValueException e) { List isolationMethods = new ArrayList(); @@ -325,7 +325,7 @@ public class ManagementServerMock { null, "znet"); List nets = _physicalNetworkDao.listByZoneAndTrafficType(_zone.getId(), TrafficType.Public); if (nets == null || nets.isEmpty()) { - _networkService.addTrafficTypeToPhysicalNetwork(_znet.getId(), TrafficType.Public.toString(), null, null, null, null, null); + _networkService.addTrafficTypeToPhysicalNetwork(_znet.getId(), TrafficType.Public.toString(), null, null, null, null, null, null); } } if (_znet.getState() != PhysicalNetwork.State.Enabled) { @@ -344,7 +344,7 @@ public class ManagementServerMock { } if (!found) { _networkService.addTrafficTypeToPhysicalNetwork(_znet.getId(), TrafficType.Guest.toString(), - null, null, null, null, null); + null, null, null, null, null, null); } Pair, Integer> providers = diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index e1c48cf8294..f70af5f9a05 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -2696,6 +2696,7 @@ public class ApiResponseHelper implements ResponseGenerator { response.setXenLabel(result.getXenNetworkLabel()); response.setKvmLabel(result.getKvmNetworkLabel()); response.setVmwareLabel(result.getVmwareNetworkLabel()); + response.setHypervLabel(result.getHypervNetworkLabel()); response.setObjectName("traffictype"); return response; diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index e78757639ee..bc805b7043e 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -275,6 +275,11 @@ public enum Config { KvmPrivateNetwork("Hidden", ManagementServer.class, String.class, "kvm.private.network.device", null, "Specify the private bridge on host for private network", null), KvmGuestNetwork("Hidden", ManagementServer.class, String.class, "kvm.guest.network.device", null, "Specify the private bridge on host for private network", null), KvmSshToAgentEnabled("Advanced", ManagementServer.class, Boolean.class, "kvm.ssh.to.agent", "true", "Specify whether or not the management server is allowed to SSH into KVM Agents", null), + + // Hyperv + HypervPublicNetwork("Hidden", ManagementServer.class, String.class, "hyperv.public.network.device", null, "Specify the public virtual switch on host for public network", null), + HypervPrivateNetwork("Hidden", ManagementServer.class, String.class, "hyperv.private.network.device", null, "Specify the virtual switch on host for private network", null), + HypervGuestNetwork("Hidden", ManagementServer.class, String.class, "hyperv.guest.network.device", null, "Specify the virtual switch on host for private network", null), // Usage UsageExecutionTimezone("Usage", ManagementServer.class, String.class, "usage.execution.timezone", null, "The timezone to use for usage job execution time", null), diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index c3a196f0a63..82256ca952e 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -1738,7 +1738,7 @@ ConfigurationManagerImpl extends ManagerBase implements ConfigurationManager, Co _networkSvc.addTrafficTypeToPhysicalNetwork(mgmtPhyNetwork.getId(), TrafficType.Storage.toString(), mgmtTraffic.getXenNetworkLabel(), mgmtTraffic.getKvmNetworkLabel(), mgmtTraffic.getVmwareNetworkLabel(), - mgmtTraffic.getSimulatorNetworkLabel(), mgmtTraffic.getVlan()); + mgmtTraffic.getSimulatorNetworkLabel(), mgmtTraffic.getVlan(), mgmtTraffic.getHypervNetworkLabel()); s_logger.info("No storage traffic type was specified by admin, create default storage traffic on physical network " + mgmtPhyNetwork.getId() + " with same configure of management traffic type"); } diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java index c8733b0cc8d..4a298cbe258 100755 --- a/server/src/com/cloud/network/NetworkModelImpl.java +++ b/server/src/com/cloud/network/NetworkModelImpl.java @@ -1179,6 +1179,9 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel { break; case VMware : label = mgmtTraffic.getVmwareNetworkLabel(); break; + case Hyperv: + label = mgmtTraffic.getHypervNetworkLabel(); + break; } return label; } @@ -1204,6 +1207,9 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel { break; case VMware : label = storageTraffic.getVmwareNetworkLabel(); break; + case Hyperv: + label = storageTraffic.getHypervNetworkLabel(); + break; } return label; } @@ -1549,6 +1555,9 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel { case VMware: label = publicTraffic.getVmwareNetworkLabel(); break; + case Hyperv: + label = publicTraffic.getHypervNetworkLabel(); + break; } return label; } @@ -1578,6 +1587,10 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel { case VMware: label = guestTraffic.getVmwareNetworkLabel(); break; + case Hyperv: + label = guestTraffic.getHypervNetworkLabel(); + break; + } return label; } diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index 7e971bd0e25..c6c78f50fc3 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -3542,7 +3542,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { @Override @DB @ActionEvent(eventType = EventTypes.EVENT_TRAFFIC_TYPE_CREATE, eventDescription = "Creating Physical Network TrafficType", create = true) - public PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficTypeStr, String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan) { + public PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficTypeStr, String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan, String hypervLabel) { // verify input parameters PhysicalNetworkVO network = _physicalNetworkDao.findById(physicalNetworkId); @@ -3592,7 +3592,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { if (xenLabel == null) { xenLabel = getDefaultXenNetworkLabel(trafficType); } - PhysicalNetworkTrafficTypeVO pNetworktrafficType = new PhysicalNetworkTrafficTypeVO(physicalNetworkId, trafficType, xenLabel, kvmLabel, vmwareLabel, simulatorLabel, vlan); + PhysicalNetworkTrafficTypeVO pNetworktrafficType = new PhysicalNetworkTrafficTypeVO(physicalNetworkId, trafficType, xenLabel, kvmLabel, vmwareLabel, simulatorLabel, vlan, hypervLabel); pNetworktrafficType = _pNTrafficTypeDao.persist(pNetworktrafficType); return pNetworktrafficType; @@ -3636,7 +3636,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { @Override @ActionEvent(eventType = EventTypes.EVENT_TRAFFIC_TYPE_UPDATE, eventDescription = "Updating physical network TrafficType", async = true) - public PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel) { + public PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel, String hypervLabel) { PhysicalNetworkTrafficTypeVO trafficType = _pNTrafficTypeDao.findById(id); @@ -3662,6 +3662,13 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } trafficType.setVmwareNetworkLabel(vmwareLabel); } + + if (hypervLabel != null) { + if("".equals(hypervLabel)){ + hypervLabel = null; + } + trafficType.setHypervNetworkLabel(hypervLabel); + } _pNTrafficTypeDao.update(id, trafficType); return trafficType; diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java index 35fde8e277d..705a254dde5 100644 --- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java @@ -520,7 +520,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkOrches */ @Override public PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficType, - String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan) { + String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan, String hypervLabel) { // TODO Auto-generated method stub return null; } @@ -547,7 +547,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkOrches */ @Override public PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, - String vmwareLabel) { + String vmwareLabel, String hypervLabel) { // TODO Auto-generated method stub return null; } diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index 53cd0bf594f..dbfab4a5bb8 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -493,6 +493,7 @@ CREATE TABLE `load_balancer_cert_map` ( CONSTRAINT `fk_load_balancer_cert_map__load_balancer_id` FOREIGN KEY (`load_balancer_id`) REFERENCES `load_balancing_rules` (`id`) ON DELETE CASCADE); ALTER TABLE `cloud`.`host` ADD COLUMN `cpu_sockets` int(10) unsigned DEFAULT NULL COMMENT "the number of CPU sockets on the host" AFTER pod_id; +ALTER TABLE `cloud`.`physical_network_traffic_types` ADD COLUMN `hyperv_network_label` varchar(255) DEFAULT NULL COMMENT 'The network name label of the physical device dedicated to this traffic on a HyperV host'; DROP VIEW IF EXISTS `cloud`.`host_view`; CREATE VIEW `cloud`.`host_view` AS From 09ca263afd0d85e8ef53bba7925060d49a282fe3 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 8 Nov 2013 16:02:59 +0100 Subject: [PATCH 107/108] fix apidocs build error --- tools/apidoc/gen_toc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/apidoc/gen_toc.py b/tools/apidoc/gen_toc.py index aa73b2a74de..d58252ca61b 100644 --- a/tools/apidoc/gen_toc.py +++ b/tools/apidoc/gen_toc.py @@ -79,6 +79,7 @@ known_categories = { 'ServiceOffering': 'Service Offering', 'DiskOffering': 'Disk Offering', 'LoadBalancer': 'Load Balancer', + 'SslCert': 'Load Balancer', 'Router': 'Router', 'SystemVm': 'System VM', 'Configuration': 'Configuration', From fdb3b49228061cbcf5f2ef44664ebbf92fe6c356 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 8 Nov 2013 16:17:53 +0100 Subject: [PATCH 108/108] CLOUDSTACK-4923: add missing Network limits in Domain details page (cherry picked from commit 20fd5dc84f0c7e0d639991ca1a8baffffd9538a6) --- ui/scripts/domains.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ui/scripts/domains.js b/ui/scripts/domains.js index 7306a38d2d7..5d8fd689bfb 100644 --- a/ui/scripts/domains.js +++ b/ui/scripts/domains.js @@ -213,6 +213,17 @@ }); } + if (args.data.networkLimit != null) { + $.ajax({ + url: createURL("updateResourceLimit&domainid=" + args.context.domains[0].id + "&resourceType=6&max=" + args.data.networkLimit), + dataType: "json", + async: false, + success: function(json) { + domainObj["networkLimit"] = args.data.networkLimit; + } + }); + } + if (args.data.primaryStorageLimit != null) { $.ajax({ url: createURL("updateResourceLimit&domainid=" + args.context.domains[0].id + "&resourceType=10&max=" + args.data.primaryStorageLimit), @@ -432,6 +443,15 @@ return true; } }, + networkLimit: { + label: 'label.network.limits', + isEditable: function(args) { + if (args.domains[0].id == g_domainid) //disallow to update the field on the domain you log in as + return false; + else + return true; + } + }, primaryStorageLimit: { label: 'label.primary.storage.limits', isEditable: function(args) { @@ -560,6 +580,9 @@ case "4": domainObj["templateLimit"] = limit.max; break; + case "6": + domainObj["networkLimit"] = limit.max; + break; case "7": domainObj["vpcLimit"] = limit.max; break;